contentoh-components-library 21.4.60 → 21.4.62

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 (73) hide show
  1. package/dist/components/molecules/BoxAttribute/styles.js +1 -1
  2. package/dist/components/molecules/BoxButtons/index.js +1 -0
  3. package/dist/components/molecules/TagAndInput/index.js +64 -3
  4. package/dist/components/organisms/InputGroup/index.js +153 -48
  5. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +82 -146
  6. package/dist/components/pages/ProviderProductEdition/index.js +231 -203
  7. package/dist/components/pages/RetailerProductEdition/index.js +5 -5
  8. package/dist/global-files/data.js +8 -4
  9. package/package.json +1 -1
  10. package/src/assets/images/Icons/info.svg +8 -0
  11. package/src/components/atoms/TabSection/styles.js +23 -0
  12. package/src/components/molecules/BoxAttribute/BoxAttribute.stories.js +16 -0
  13. package/src/components/molecules/BoxAttribute/index.js +71 -0
  14. package/src/components/molecules/BoxAttribute/styles.js +38 -0
  15. package/src/components/molecules/BoxButtons/BoxButtons.stories.js +15 -0
  16. package/src/components/molecules/BoxButtons/index.js +28 -0
  17. package/src/components/molecules/BoxButtons/styles.js +43 -0
  18. package/src/components/molecules/TagAndInput/index.js +52 -8
  19. package/src/components/organisms/Box/Box.stories.js +17 -0
  20. package/src/components/organisms/Box/index.js +103 -0
  21. package/src/components/organisms/Box/styles.js +48 -0
  22. package/src/components/organisms/BoxOnboarding/BoxOnboarding.stories.js +17 -0
  23. package/src/components/organisms/BoxOnboarding/index.js +60 -0
  24. package/src/components/organisms/BoxOnboarding/styles.js +44 -0
  25. package/src/components/organisms/InputGroup/index.js +233 -87
  26. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +86 -175
  27. package/src/components/pages/ProviderProductEdition/index.js +97 -73
  28. package/src/components/pages/ProviderProductEdition/out.json +0 -0
  29. package/src/components/pages/RetailerProductEdition/index.js +7 -5
  30. package/src/global-files/data.js +11 -2
  31. package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
  32. package/dist/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -90
  33. package/dist/components/atoms/ImageCarousel/index.js +0 -120
  34. package/dist/components/atoms/ImageCarousel/styles.js +0 -18
  35. package/dist/components/atoms/PercentTag/PercentTag.stories.js +0 -31
  36. package/dist/components/atoms/PercentTag/index.js +0 -23
  37. package/dist/components/atoms/PercentTag/styles.js +0 -22
  38. package/dist/components/atoms/RatingStars/RatingStars.stories.js +0 -30
  39. package/dist/components/atoms/RatingStars/index.js +0 -53
  40. package/dist/components/atoms/RatingStars/styles.js +0 -18
  41. package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -48
  42. package/dist/components/atoms/RetailerCatalog/index.js +0 -69
  43. package/dist/components/atoms/RetailerCatalog/styles.js +0 -20
  44. package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +0 -33
  45. package/dist/components/atoms/RetailerOption/index.js +0 -62
  46. package/dist/components/atoms/RetailerOption/styles.js +0 -20
  47. package/dist/components/atoms/RetailersList/RetailersList.stories.js +0 -45
  48. package/dist/components/atoms/RetailersList/index.js +0 -46
  49. package/dist/components/atoms/RetailersList/styles.js +0 -18
  50. package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +0 -73
  51. package/dist/components/atoms/UserCatalog/index.js +0 -101
  52. package/dist/components/atoms/UserCatalog/styles.js +0 -18
  53. package/dist/components/atoms/UserOption/UserOption.stories.js +0 -40
  54. package/dist/components/atoms/UserOption/index.js +0 -130
  55. package/dist/components/atoms/UserOption/styles.js +0 -20
  56. package/dist/components/atoms/UserSelector/UserSelector.stories.js +0 -40
  57. package/dist/components/atoms/UserSelector/index.js +0 -98
  58. package/dist/components/atoms/UserSelector/styles.js +0 -32
  59. package/dist/components/molecules/GridItem/GridItem.stories.js +0 -123
  60. package/dist/components/molecules/GridItem/index.js +0 -152
  61. package/dist/components/molecules/GridItem/styles.js +0 -20
  62. package/dist/components/molecules/HeaderItem/ColumnItem.js +0 -23
  63. package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +0 -70
  64. package/dist/components/molecules/HeaderItem/index.js +0 -42
  65. package/dist/components/molecules/HeaderItem/styles.js +0 -30
  66. package/dist/components/molecules/RowItem/ColumnItem.js +0 -23
  67. package/dist/components/molecules/RowItem/RowItem.stories.js +0 -5242
  68. package/dist/components/molecules/RowItem/index.js +0 -58
  69. package/dist/components/molecules/RowItem/styles.js +0 -30
  70. package/dist/components/organisms/GridProducts/GridProducts.stories.js +0 -5097
  71. package/dist/components/organisms/GridProducts/index.js +0 -63
  72. package/dist/components/organisms/GridProducts/styles.js +0 -18
  73. package/dist/components/organisms/GridProducts/utils.js +0 -149
@@ -0,0 +1,60 @@
1
+ import { Container } from "./styles";
2
+ import { FontFamily, GlobalColors } from "../../../global-files/variables";
3
+ import { BoxAttribute } from "../../molecules/BoxAttribute";
4
+ import { useState, useEffect, memo } from "react";
5
+ import { isEqual } from "lodash";
6
+
7
+ export const BoxOnboarding = memo(
8
+ ({
9
+ panelColor,
10
+ index,
11
+ onChange,
12
+ data,
13
+ dataInputs,
14
+ inputs,
15
+ }) => {
16
+ const [atributos, setAtributos] = useState({});
17
+ const [isLoading, setIsLoading] = useState(true);
18
+
19
+ useEffect(() => {
20
+ onChange && onChange(atributos);
21
+ }, [atributos]);
22
+
23
+
24
+ useEffect(() => {
25
+ if (isLoading && Object.keys(data).length > 0) {
26
+ setAtributos(data);
27
+ setIsLoading(false);
28
+ }
29
+ }, [data]);
30
+
31
+ return (
32
+ <Container
33
+ panelColor={panelColor}
34
+ fontFamily={FontFamily.Raleway}
35
+ color={GlobalColors.original_magenta}
36
+ >
37
+ <div id="contenedor-caja">
38
+ <p fontFamily={FontFamily.Raleway}>Caja {index + 1}</p>
39
+ {inputs.map((attrId) => {
40
+ return (
41
+ <BoxAttribute
42
+ id={attrId}
43
+ key={attrId}
44
+ borderType="rectangle"
45
+ className="caja"
46
+ text={dataInputs[attrId]?.name}
47
+ required={dataInputs[attrId]?.required}
48
+ description={dataInputs[attrId]?.description}
49
+ atributos={atributos}
50
+ setAtributos={setAtributos}
51
+ />
52
+ );
53
+ })}
54
+
55
+ </div>
56
+ </Container>
57
+ );
58
+ },
59
+ isEqual
60
+ );
@@ -0,0 +1,44 @@
1
+ import styled from "styled-components";
2
+ import { FontFamily, GlobalColors } from "../../../global-files/variables";
3
+
4
+ export const Container = styled.div`
5
+ font-family: ${FontFamily.Roboto}, sans-serif;
6
+ font-weight: 400;
7
+ font-size: var(--size);
8
+ line-height: 1.2;
9
+ background: white;
10
+ position: relative;
11
+ overflow: hidden;
12
+ width: 80%;
13
+ height: 100%;
14
+ text-align: center;
15
+ #contenedor-caja {
16
+ display: flex;
17
+ justify-content: space-between;
18
+ color: #262626;
19
+ }
20
+ #atr-alto {
21
+ display: flex;
22
+ justify-content: space-between;
23
+ align-items: center;
24
+ }
25
+ p {
26
+ font-family: ${FontFamily.RobotoMedium}, sans-serif;
27
+ font-size: 12px;
28
+ line-height: 1.2;
29
+ font-weight: 600;
30
+ align-self: center;
31
+ }
32
+ }
33
+ .icon-red {
34
+ color: #B64545;
35
+ height:18px;
36
+ }
37
+ .icon-gray {
38
+ color: #707070;
39
+ }
40
+ .icon-gray-l {
41
+ color: #707070;
42
+ height:18px;
43
+ }
44
+ `
@@ -1,6 +1,9 @@
1
1
  import { Container } from "./styles";
2
2
  import { ScreenHeader } from "../../atoms/ScreenHeader";
3
3
  import { TagAndInput } from "../../molecules/TagAndInput";
4
+ import { BoxOnboarding } from "../BoxOnboarding";
5
+ import { Box } from "../Box";
6
+ import { useEffect, useState } from "react";
4
7
 
5
8
  export const InputGroup = ({
6
9
  inputGroup = {},
@@ -16,6 +19,9 @@ export const InputGroup = ({
16
19
  version,
17
20
  dinamicHeight,
18
21
  compare,
22
+ groupData = [],
23
+ setUpdatedBoxData,
24
+ activeRetailer
19
25
  }) => {
20
26
  const inputTypeValue = (type) => {
21
27
  switch (type) {
@@ -27,101 +33,241 @@ export const InputGroup = ({
27
33
  return "text";
28
34
  }
29
35
  };
36
+ const [showBox, setShowBox] = useState(false);
30
37
 
31
38
  const isEquals = (dataInputsVal, auditInputsVal) => {
32
39
  const result = dataInputsVal === auditInputsVal;
33
40
  return result;
34
41
  };
35
42
 
36
- return (
37
- <Container
38
- className={
39
- activeSection === "Ficha técnica"
40
- ? "datasheets-layout"
41
- : "descriptions-layout"
43
+ useEffect(() => {
44
+ if (inputGroup.groupId === "16" && activeRetailer && activeRetailer?.retailer?.id) {
45
+ if (activeRetailer?.retailer?.id === 68) {
46
+ setShowBox(true);
47
+ } else {
48
+ setShowBox(false);
42
49
  }
43
- >
44
- {inputGroup?.dataGroup && (
45
- <ScreenHeader
46
- headerType={"retailer-name-header"}
47
- text={inputGroup?.dataGroup}
48
- />
49
- )}
50
- <div className="inputs-container">
51
- {inputGroup?.inputs?.map((input, index) =>
52
- activeSection === "Ficha técnica" ? (
53
- <TagAndInput
54
- key={
55
- index +
56
- "-" +
57
- dataInputs[input]?.value +
58
- "-" +
59
- dataInputs[input]?.id +
60
- "-" +
61
- compare
62
- }
63
- //disabled={input === 40001}
64
- disabled={false}
65
- inputId={dataInputs[input]?.id}
66
- version={version}
67
- inputType={inputTypeValue(dataInputs[input]?.type)}
68
- label={
69
- dataInputs[input]?.name +
70
- (dataInputs[input]?.required ? "*" : "")
71
- }
72
- value={
73
- compare ? auditInputs[input]?.value : dataInputs[input]?.value
74
- }
75
- inputPlaceHolder={input?.placeholder}
76
- articleId={articleId}
77
- isRequired={dataInputs[input]?.required}
78
- updatedDatasheets={updatedDatasheets}
79
- setUpdatedDatasheets={setUpdatedDatasheets}
80
- maxChar={
81
- dataInputs[input]?.max_chars
82
- ? dataInputs[input]?.max_chars
83
- : 999
84
- }
85
- optionList={dataInputs[input]?.option_list}
86
- description={dataInputs[input]?.description}
87
- showTooltip={true}
88
- auditClass={
89
- compare &&
90
- !isEquals(dataInputs[input].value, auditInputs[input].value)
91
- ? "audit-class"
92
- : ""
93
- }
50
+ }
51
+ }, [activeRetailer, inputGroup.groupId]);
52
+
53
+ // useEffect(() => {
54
+ // if (showBox) {
55
+ // // Realiza la acción que deseas cuando showBox es true
56
+ // console.log("showBox es true");
57
+ // } else {
58
+ // // Realiza la acción que deseas cuando showBox es false
59
+ // console.log("showBox es false");
60
+ // }
61
+ // }, [showBox]);
62
+
63
+ return (
64
+ <>
65
+ {inputGroup.groupId === "16" && activeRetailer?.retailer?.id === 68 && (
66
+ <Container
67
+ className={
68
+ activeSection === "Ficha técnica"
69
+ ? "datasheets-layout"
70
+ : "descriptions-layout"
71
+ }
72
+ >
73
+ <Box
74
+ inputGroup={inputGroup}
75
+ dataInputs={dataInputs}
76
+ onChange={setUpdatedBoxData}
94
77
  />
95
- ) : (
96
- <TagAndInput
97
- key={index + "-" + input?.value + "-" + compare}
98
- inputId={input.id}
99
- index={index}
100
- inputType={"textarea"}
101
- label={input?.name + (input.required ? "*" : "")}
102
- value={
103
- compare ? auditInputGroup?.inputs[index]?.value : input?.value
104
- }
105
- isRequired={input.required}
106
- maxChar={input.max_chars}
107
- inputPlaceHolder={input?.placeholder}
108
- updatedDescriptions={updatedDescriptions}
109
- setUpdatedDescriptions={setUpdatedDescriptions}
110
- articleId={articleId}
111
- version={version}
112
- dinamicHeight={dinamicHeight}
113
- description={input?.description}
114
- showTooltip={true}
115
- auditClass={
116
- compare &&
117
- !isEquals(input?.value, auditInputGroup?.inputs[index]?.value)
118
- ? "audit-class"
119
- : ""
120
- }
121
- />
122
- )
78
+ </Container>
79
+ )}
80
+ {(inputGroup.groupId !== "16") && (
81
+ <Container
82
+ className={
83
+ activeSection === "Ficha técnica"
84
+ ? "datasheets-layout"
85
+ : "descriptions-layout"
86
+ }
87
+ >
88
+ {inputGroup?.dataGroup && (
89
+ <ScreenHeader
90
+ headerType={"retailer-name-header"}
91
+ text={`${inputGroup?.dataGroup}`}
92
+ />
123
93
  )}
124
- </div>
125
- </Container>
94
+ <div className="inputs-container">
95
+ {inputGroup?.inputs?.map((input, index) =>
96
+ activeSection === "Ficha técnica" ? (
97
+ <>
98
+ <TagAndInput
99
+ key={
100
+ index +
101
+ "-" +
102
+ dataInputs[input]?.value +
103
+ "-" +
104
+ dataInputs[input]?.id +
105
+ "-" +
106
+ compare
107
+ }
108
+ //disabled={input === 40001}
109
+ disabled={false}
110
+ inputId={dataInputs[input]?.id}
111
+ version={version}
112
+ inputType={inputTypeValue(dataInputs[input]?.type)}
113
+ label={
114
+ dataInputs[input]?.name +
115
+ (dataInputs[input]?.required ? "*" : "")
116
+ }
117
+ value={
118
+ compare ? auditInputs[input]?.value : dataInputs[input]?.value
119
+ }
120
+ inputPlaceHolder={input?.placeholder}
121
+ articleId={articleId}
122
+ isRequired={dataInputs[input]?.required}
123
+ updatedDatasheets={updatedDatasheets}
124
+ setUpdatedDatasheets={setUpdatedDatasheets}
125
+ maxChar={
126
+ dataInputs[input]?.max_chars
127
+ ? dataInputs[input]?.max_chars
128
+ : 999
129
+ }
130
+ optionList={dataInputs[input]?.option_list}
131
+ description={dataInputs[input]?.description}
132
+ showTooltip={true}
133
+ auditClass={
134
+ compare &&
135
+ !isEquals(dataInputs[input].value, auditInputs[input].value)
136
+ ? "audit-class"
137
+ : ""
138
+ }
139
+ />
140
+ </>
141
+ ) : (
142
+ <TagAndInput
143
+ key={index + "-" + input?.value + "-" + compare}
144
+ inputId={input.id}
145
+ index={index}
146
+ inputType={"textarea"}
147
+ label={input?.name + (input.required ? "*" : "")}
148
+ value={
149
+ compare ? auditInputGroup?.inputs[index]?.value : input?.value
150
+ }
151
+ isRequired={input.required}
152
+ maxChar={input.max_chars}
153
+ inputPlaceHolder={input?.placeholder}
154
+ updatedDescriptions={updatedDescriptions}
155
+ setUpdatedDescriptions={setUpdatedDescriptions}
156
+ articleId={articleId}
157
+ version={version}
158
+ dinamicHeight={dinamicHeight}
159
+ description={input?.description}
160
+ showTooltip={true}
161
+ auditClass={
162
+ compare &&
163
+ !isEquals(input?.value, auditInputGroup?.inputs[index]?.value)
164
+ ? "audit-class"
165
+ : ""
166
+ }
167
+ />
168
+ )
169
+ )}
170
+ </div>
171
+ </Container>
172
+ )}
173
+ {(inputGroup.groupId === "16" && activeRetailer?.retailer?.id === 74) && (
174
+ <Container
175
+ className={
176
+ activeSection === "Ficha técnica"
177
+ ? "datasheets-layout"
178
+ : "descriptions-layout"
179
+ }
180
+ >
181
+ {inputGroup?.dataGroup && (
182
+ <ScreenHeader
183
+ headerType={"retailer-name-header"}
184
+ text={`${inputGroup?.dataGroup}`}
185
+ />
186
+ )}
187
+ <div className="inputs-container">
188
+ {inputGroup?.inputs?.map((input, index) =>
189
+ activeSection === "Ficha técnica" ? (
190
+ <>
191
+ <TagAndInput
192
+ key={
193
+ index +
194
+ "-" +
195
+ dataInputs[input]?.value +
196
+ "-" +
197
+ dataInputs[input]?.id +
198
+ "-" +
199
+ compare
200
+ }
201
+ //disabled={input === 40001}
202
+ disabled={false}
203
+ inputId={dataInputs[input]?.id}
204
+ version={version}
205
+ inputType={inputTypeValue(dataInputs[input]?.type)}
206
+ label={
207
+ dataInputs[input]?.name +
208
+ (dataInputs[input]?.required ? "*" : "")
209
+ }
210
+ value={
211
+ compare
212
+ ? auditInputs[input]?.value
213
+ : dataInputs[input]?.value
214
+ }
215
+ inputPlaceHolder={input?.placeholder}
216
+ articleId={articleId}
217
+ isRequired={dataInputs[input]?.required}
218
+ updatedDatasheets={updatedDatasheets}
219
+ setUpdatedDatasheets={setUpdatedDatasheets}
220
+ maxChar={
221
+ dataInputs[input]?.max_chars
222
+ ? dataInputs[input]?.max_chars
223
+ : 999
224
+ }
225
+ optionList={dataInputs[input]?.option_list}
226
+ description={dataInputs[input]?.description}
227
+ showTooltip={true}
228
+ inputGroup={inputGroup}
229
+ dataInputs={dataInputs}
230
+ onChange={setUpdatedBoxData}
231
+ auditClass={
232
+ compare &&
233
+ !isEquals(dataInputs[input].value, auditInputs[input].value)
234
+ ? "audit-class"
235
+ : ""
236
+ }
237
+ />
238
+ </>
239
+ ) : (
240
+ <TagAndInput
241
+ key={index + "-" + input?.value + "-" + compare}
242
+ inputId={input.id}
243
+ index={index}
244
+ inputType={"textarea"}
245
+ label={input?.name + (input.required ? "*" : "")}
246
+ value={
247
+ compare ? auditInputGroup?.inputs[index]?.value : input?.value
248
+ }
249
+ isRequired={input.required}
250
+ maxChar={input.max_chars}
251
+ inputPlaceHolder={input?.placeholder}
252
+ updatedDescriptions={updatedDescriptions}
253
+ setUpdatedDescriptions={setUpdatedDescriptions}
254
+ articleId={articleId}
255
+ version={version}
256
+ dinamicHeight={dinamicHeight}
257
+ description={input?.description}
258
+ showTooltip={true}
259
+ auditClass={
260
+ compare &&
261
+ !isEquals(input?.value, auditInputGroup?.inputs[index]?.value)
262
+ ? "audit-class"
263
+ : ""
264
+ }
265
+ />
266
+ )
267
+ )}
268
+ </div>
269
+ </Container>
270
+ )}
271
+ </>
126
272
  );
127
273
  };