contentoh-components-library 21.0.72 → 21.0.75

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 (196) hide show
  1. package/.env.development +21 -4
  2. package/.env.production +19 -2
  3. package/CHANGELOG.md +37 -0
  4. package/dist/assets/images/generalButton/downloadIcon.svg +3 -0
  5. package/dist/assets/images/genericModal/closeWhite.svg +3 -0
  6. package/dist/assets/images/genericModal/errorModal.svg +3 -0
  7. package/dist/assets/images/genericModal/yellowAlert.svg +12 -0
  8. package/dist/assets/images/modalsSVGs/attributesSent.svg +208 -0
  9. package/dist/assets/images/modalsSVGs/descriptionSent.svg +237 -0
  10. package/dist/assets/images/modalsSVGs/providerSent.svg +445 -0
  11. package/dist/assets/images/modalsSVGs/uploadingImages.svg +148 -0
  12. package/dist/components/atoms/AsignationOption/index.js +9 -5
  13. package/dist/components/atoms/AsignationOption/styles.js +1 -1
  14. package/dist/components/{molecules/SignInLoginCreationApp/SignInLogin.stories.js → atoms/CharCounter/CharCounter.stories.js} +10 -7
  15. package/dist/components/atoms/CharCounter/index.js +22 -0
  16. package/dist/components/{molecules/ApproveRejetPanel → atoms/CharCounter}/styles.js +3 -1
  17. package/dist/components/atoms/CheckBox/index.js +4 -2
  18. package/dist/components/atoms/Commentary/Commentary.stories.js +1 -0
  19. package/dist/components/atoms/Commentary/index.js +23 -0
  20. package/dist/components/atoms/Commentary/styles.js +23 -0
  21. package/dist/components/atoms/GeneralButton/index.js +5 -0
  22. package/dist/components/atoms/GeneralButton/styles.js +4 -2
  23. package/dist/components/atoms/GeneralInput/index.js +72 -24
  24. package/dist/components/atoms/GeneralInput/styles.js +7 -1
  25. package/dist/components/atoms/GenericModal/index.js +4 -2
  26. package/dist/components/atoms/GenericModal/styles.js +1 -1
  27. package/dist/components/atoms/Input/index.js +26 -0
  28. package/dist/components/atoms/Input/style.js +26 -0
  29. package/dist/components/atoms/InputFormatter/Wysiwyg.stories.js +30 -0
  30. package/dist/components/atoms/InputFormatter/index.js +184 -0
  31. package/dist/components/atoms/InputFormatter/styles.js +33 -0
  32. package/dist/components/atoms/LabelToInput/index.js +53 -0
  33. package/dist/components/atoms/LabelToInput/style.js +22 -0
  34. package/dist/components/atoms/Percent/Percent.stories.js +39 -0
  35. package/dist/components/atoms/Percent/index.js +39 -0
  36. package/dist/components/atoms/Percent/styles.js +20 -0
  37. package/dist/components/atoms/PriorityFlag/index.js +1 -1
  38. package/dist/components/atoms/ProductImage/styles.js +1 -1
  39. package/dist/components/atoms/ProgressBar/index.js +2 -2
  40. package/dist/components/atoms/ProgressBar/styles.js +3 -5
  41. package/dist/components/atoms/ScreenHeader/index.js +1 -1
  42. package/dist/components/atoms/ScreenHeader/styles.js +1 -1
  43. package/dist/components/atoms/Select/index.js +39 -0
  44. package/dist/components/atoms/Select/style.js +32 -0
  45. package/dist/components/atoms/StatusTag/index.js +37 -2
  46. package/dist/components/atoms/StatusTag/styles.js +1 -1
  47. package/dist/components/atoms/ValidationPanel/index.js +5 -3
  48. package/dist/components/atoms/VerticalSideMenuMainPage/index.js +15 -10
  49. package/dist/components/atoms/VerticalSideMenuMainPage/styles.js +1 -1
  50. package/dist/components/molecules/AvatarAndValidation/index.js +17 -7
  51. package/dist/components/molecules/AvatarAndValidation/styles.js +1 -1
  52. package/dist/components/molecules/FeaturesBar/index.js +1 -1
  53. package/dist/components/molecules/GalleryElement/index.js +80 -21
  54. package/dist/components/molecules/GalleryElement/styles.js +1 -1
  55. package/dist/components/molecules/GalleryHeader/index.js +28 -6
  56. package/dist/components/molecules/GalleryHeader/styles.js +1 -1
  57. package/dist/components/molecules/ImageSelector/index.js +2 -4
  58. package/dist/components/molecules/ProductNameHeader/index.js +1 -2
  59. package/dist/components/molecules/RetailerSelector/RetailerSelector.stories.js +48 -0
  60. package/dist/components/molecules/RetailerSelector/index.js +74 -0
  61. package/dist/components/{atoms/MenuCommercialRetailers → molecules/RetailerSelector}/styles.js +1 -1
  62. package/dist/components/molecules/StatusAsignationInfo/index.js +46 -28
  63. package/dist/components/molecules/StatusAsignationInfo/styles.js +1 -1
  64. package/dist/components/molecules/TableHeader/index.js +12 -5
  65. package/dist/components/molecules/TableHeader/styles.js +1 -1
  66. package/dist/components/molecules/TagAndInput/index.js +24 -0
  67. package/dist/components/molecules/TextAndGradient/TextAndGradient.stories.js +31 -0
  68. package/dist/components/molecules/TextAndGradient/index.js +36 -0
  69. package/dist/components/molecules/TextAndGradient/styles.js +18 -0
  70. package/dist/components/organisms/FullProductNameHeader/index.js +31 -9
  71. package/dist/components/organisms/FullTabsMenu/index.js +18 -5
  72. package/dist/components/organisms/GlobalModal/index.js +73 -0
  73. package/dist/components/organisms/GlobalModal/styles.js +66 -0
  74. package/dist/components/organisms/ImageDataTable/index.js +90 -14
  75. package/dist/components/organisms/InputGroup/index.js +34 -13
  76. package/dist/components/organisms/InputGroup/styles.js +1 -1
  77. package/dist/components/organisms/ProductImageModal/index.js +13 -10
  78. package/dist/components/organisms/ProductImageModal/styles.js +1 -1
  79. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +135 -0
  80. package/dist/components/pages/ProviderProductEdition/index.js +1979 -0
  81. package/dist/components/pages/ProviderProductEdition/styles.js +23 -0
  82. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +91 -347
  83. package/dist/components/pages/RetailerProductEdition/index.js +1610 -60
  84. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  85. package/dist/global-files/data.js +213 -53
  86. package/dist/global-files/global-styles.css +1 -0
  87. package/dist/global-files/variables.js +1 -0
  88. package/dist/index.js +13 -0
  89. package/package.json +16 -9
  90. package/src/assets/images/generalButton/downloadIcon.svg +3 -0
  91. package/src/assets/images/genericModal/closeWhite.svg +3 -0
  92. package/src/assets/images/genericModal/errorModal.svg +3 -0
  93. package/src/assets/images/genericModal/yellowAlert.svg +12 -0
  94. package/src/assets/images/modalsSVGs/attributesSent.svg +208 -0
  95. package/src/assets/images/modalsSVGs/descriptionSent.svg +237 -0
  96. package/src/assets/images/modalsSVGs/providerSent.svg +445 -0
  97. package/src/assets/images/modalsSVGs/uploadingImages.svg +148 -0
  98. package/src/components/atoms/AsignationOption/index.js +7 -5
  99. package/src/components/atoms/AsignationOption/styles.js +9 -1
  100. package/src/components/atoms/CharCounter/CharCounter.stories.js +11 -0
  101. package/src/components/atoms/CharCounter/index.js +13 -0
  102. package/src/components/atoms/CharCounter/styles.js +10 -0
  103. package/src/components/atoms/CheckBox/index.js +8 -2
  104. package/src/components/atoms/Commentary/Commentary.stories.js +0 -0
  105. package/src/components/atoms/Commentary/index.js +9 -0
  106. package/src/components/atoms/Commentary/styles.js +16 -0
  107. package/src/components/atoms/GeneralButton/index.js +9 -2
  108. package/src/components/atoms/GeneralButton/styles.js +23 -0
  109. package/src/components/atoms/GeneralInput/index.js +71 -22
  110. package/src/components/atoms/GeneralInput/styles.js +11 -1
  111. package/src/components/atoms/GenericModal/index.js +2 -2
  112. package/src/components/atoms/GenericModal/styles.js +10 -2
  113. package/src/components/atoms/Input/index.js +15 -0
  114. package/src/components/atoms/Input/style.js +31 -0
  115. package/src/components/atoms/InputFormatter/Wysiwyg.stories.js +12 -0
  116. package/src/components/atoms/InputFormatter/index.js +144 -0
  117. package/src/components/atoms/InputFormatter/styles.js +40 -0
  118. package/src/components/atoms/LabelToInput/index.js +26 -0
  119. package/src/components/atoms/LabelToInput/style.js +41 -0
  120. package/src/components/atoms/PriorityFlag/index.js +1 -1
  121. package/src/components/atoms/ProductImage/styles.js +1 -1
  122. package/src/components/atoms/ProgressBar/index.js +2 -2
  123. package/src/components/atoms/ProgressBar/styles.js +54 -3
  124. package/src/components/atoms/ScreenHeader/index.js +7 -3
  125. package/src/components/atoms/ScreenHeader/styles.js +9 -2
  126. package/src/components/atoms/Select/index.js +35 -0
  127. package/src/components/atoms/Select/style.js +76 -0
  128. package/src/components/atoms/StatusTag/index.js +30 -2
  129. package/src/components/atoms/StatusTag/styles.js +15 -3
  130. package/src/components/atoms/ValidationPanel/index.js +4 -3
  131. package/src/components/atoms/VerticalSideMenuMainPage/index.js +15 -11
  132. package/src/components/atoms/VerticalSideMenuMainPage/styles.js +8 -7
  133. package/src/components/molecules/AvatarAndValidation/index.js +23 -6
  134. package/src/components/molecules/AvatarAndValidation/styles.js +1 -1
  135. package/src/components/molecules/FeaturesBar/index.js +10 -7
  136. package/src/components/molecules/GalleryElement/index.js +75 -36
  137. package/src/components/molecules/GalleryElement/styles.js +38 -11
  138. package/src/components/molecules/GalleryHeader/index.js +14 -8
  139. package/src/components/molecules/GalleryHeader/styles.js +16 -0
  140. package/src/components/molecules/ImageSelector/index.js +2 -3
  141. package/src/components/molecules/ProductNameHeader/index.js +1 -2
  142. package/src/components/molecules/RetailerSelector/RetailerSelector.stories.js +35 -0
  143. package/src/components/molecules/RetailerSelector/index.js +63 -0
  144. package/src/components/molecules/RetailerSelector/styles.js +18 -0
  145. package/src/components/molecules/StatusAsignationInfo/index.js +64 -39
  146. package/src/components/molecules/StatusAsignationInfo/styles.js +12 -2
  147. package/src/components/molecules/TableHeader/index.js +16 -3
  148. package/src/components/molecules/TableHeader/styles.js +5 -0
  149. package/src/components/molecules/TagAndInput/index.js +24 -0
  150. package/src/components/organisms/FullProductNameHeader/index.js +38 -8
  151. package/src/components/organisms/FullTabsMenu/index.js +15 -3
  152. package/src/components/organisms/GlobalModal/index.js +68 -0
  153. package/src/components/organisms/GlobalModal/styles.js +113 -0
  154. package/src/components/organisms/ImageDataTable/index.js +89 -11
  155. package/src/components/organisms/InputGroup/index.js +46 -11
  156. package/src/components/organisms/InputGroup/styles.js +3 -0
  157. package/src/components/organisms/ProductImageModal/index.js +19 -12
  158. package/src/components/organisms/ProductImageModal/styles.js +3 -0
  159. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +123 -0
  160. package/src/components/pages/ProviderProductEdition/index.js +1493 -0
  161. package/src/components/pages/ProviderProductEdition/styles.js +118 -0
  162. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +91 -343
  163. package/src/components/pages/RetailerProductEdition/index.js +1245 -48
  164. package/src/components/pages/RetailerProductEdition/styles.js +67 -4
  165. package/src/global-files/data.js +158 -57
  166. package/src/global-files/global-styles.css +1 -0
  167. package/src/global-files/variables.js +1 -0
  168. package/src/index.js +1 -0
  169. package/dist/assets/images/editField/showPassword.png +0 -0
  170. package/dist/assets/images/sliderToolTip/infoIcon.svg +0 -4
  171. package/dist/assets/images/sliderToolTip/slide1.svg +0 -5
  172. package/dist/assets/images/sliderToolTip/slide2.svg +0 -9
  173. package/dist/assets/images/sliderToolTip/slide3.svg +0 -9
  174. package/dist/assets/images/sliderToolTip/slide4.svg +0 -9
  175. package/dist/assets/images/sliderToolTip/slide5.svg +0 -40
  176. package/dist/assets/images/verticalSideMenuMainPage/closeMenu.svg +0 -4
  177. package/dist/assets/images/verticalSideMenuMainPage/iconFAQS.svg +0 -12
  178. package/dist/assets/images/verticalSideMenuMainPage/iconGroup.svg +0 -3
  179. package/dist/assets/images/verticalSideMenuMainPage/iconLogo.svg +0 -12
  180. package/dist/assets/images/verticalSideMenuMainPage/iconLogoContentoh.svg +0 -15
  181. package/dist/assets/images/verticalSideMenuMainPage/iconProduct.svg +0 -3
  182. package/dist/assets/images/verticalSideMenuMainPage/iconSpeedometer.svg +0 -12
  183. package/dist/assets/images/verticalSideMenuMainPage/iconTask.svg +0 -10
  184. package/dist/assets/images/verticalSideMenuMainPage/openMenu.svg +0 -4
  185. package/dist/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +0 -36
  186. package/dist/components/atoms/ListCommercialRetailers/index.js +0 -64
  187. package/dist/components/atoms/ListCommercialRetailers/styles.js +0 -20
  188. package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +0 -37
  189. package/dist/components/atoms/MenuCommercialRetailers/index.js +0 -25
  190. package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +0 -28
  191. package/dist/components/atoms/MenuProductImage/index.js +0 -88
  192. package/dist/components/atoms/MenuProductImage/styles.js +0 -20
  193. package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +0 -25
  194. package/dist/components/molecules/ApproveRejetPanel/index.js +0 -49
  195. package/dist/components/molecules/SignInLoginCreationApp/index.js +0 -270
  196. package/dist/components/molecules/SignInLoginCreationApp/styles.js +0 -20
@@ -0,0 +1,12 @@
1
+ import { InputFormatter } from "./index";
2
+
3
+ export default {
4
+ title: "Components/atoms/InputFormatter",
5
+ component: InputFormatter,
6
+ };
7
+
8
+ const Template = (args) => <InputFormatter {...args} />;
9
+
10
+ export const DefaultInputFormatter = Template.bind({});
11
+
12
+ DefaultInputFormatter.args = { text: "hola mundo" };
@@ -0,0 +1,144 @@
1
+ import ReactQuill from "react-quill";
2
+ import "react-quill/dist/quill.snow.css";
3
+ import { useEffect, useState } from "react";
4
+ import { Container } from "./styles";
5
+
6
+ export const InputFormatter = ({
7
+ mainValue = "",
8
+ inputId,
9
+ articleId,
10
+ updatedDescriptions,
11
+ setUpdatedDescriptions,
12
+ addTextAreaToArray,
13
+ name,
14
+ isRequired,
15
+ maxChar,
16
+ }) => {
17
+ const [inputValue, setInputValue] = useState(mainValue);
18
+ const [selection, setSelection] = useState(false);
19
+ const [position, setPosition] = useState({ left: 0, top: 0 });
20
+ const [charsCounter, setCharsCounter] = useState(0);
21
+ const [quillState, setQuillState] = useState({});
22
+ const maxLength = maxChar ? maxChar : 999;
23
+
24
+ const getValue = (value) => {
25
+ let temp = value.replace(/\n/gm, "<br>");
26
+ return temp;
27
+ };
28
+
29
+ //const quillRef = useRef();
30
+ const setQuill = (ref) => {
31
+ if (!ref || ref === null) return;
32
+ if (typeof ref.getEditor !== "function") return;
33
+ setQuillState(ref.getEditor());
34
+ };
35
+
36
+ const valueFormater = (value) => {
37
+ return value.replace(/<\/p><p>/gm, "\n").replace(/<\/?br>|<\/?p>/gm, "");
38
+ };
39
+
40
+ const onChange = (valueInput, delta, user, h) => {
41
+ let value = "";
42
+ try {
43
+ if (h.getLength() - 1 <= maxLength) {
44
+ let unformattedText = valueInput
45
+ .replace(/<li.*?>/gm, " - ")
46
+ .replace(/<\/li>/gm, "\n")
47
+ .replace(/<\/p><p>/gm, "\n")
48
+ .replaceAll(/<\/?(?!\/?strong).*?>/gm, "");
49
+ setInputValue(valueInput);
50
+ value = unformattedText;
51
+ } else {
52
+ quillState.deleteText(maxLength, quillState.getLength());
53
+ setInputValue((val) => (val = quillState.getText()));
54
+ value = quillState.getText();
55
+ }
56
+ } catch (error) {
57
+ console.log(error);
58
+ }
59
+ setCharsCounter(h.getLength() - 1);
60
+ value = valueFormater(value);
61
+
62
+ let idInput = inputId;
63
+ let dataSave = updatedDescriptions.slice();
64
+ if (dataSave.length > 0) {
65
+ if (dataSave.filter((e) => e.attributeId === idInput).length > 0) {
66
+ dataSave.forEach((e) => {
67
+ if (e.attributeId === idInput) {
68
+ e.value = value;
69
+ }
70
+ });
71
+ } else {
72
+ dataSave.push({
73
+ articleId: articleId,
74
+ attributeId: idInput,
75
+ value: value,
76
+ });
77
+ }
78
+ } else {
79
+ dataSave.push({
80
+ articleId: articleId,
81
+ attributeId: idInput,
82
+ value: value,
83
+ });
84
+ }
85
+ setUpdatedDescriptions(dataSave);
86
+ };
87
+
88
+ const getSelection = (range, a, b) => {
89
+ //getBounds(index,length)
90
+ const selected = b.getSelection();
91
+ const bounds = b.getBounds(selected?.index || 0, selected?.length || 0);
92
+ if (a === "user") {
93
+ setPosition({ left: bounds.left, top: bounds.top });
94
+ setSelection(selected?.length > 0);
95
+ }
96
+ };
97
+
98
+ return (
99
+ <Container
100
+ isRequired={
101
+ isRequired &&
102
+ (inputValue.replace(/<.*?>/gm, "").length === 0 || !inputValue)
103
+ }
104
+ selection={selection}
105
+ position={position}
106
+ >
107
+ <ReactQuill
108
+ id={inputId + ""}
109
+ ref={(el) => setQuill(el)}
110
+ value={getValue(inputValue)}
111
+ //disabled={!props.enableInputs}
112
+ modules={{ toolbar: ["bold"] }}
113
+ onKeyPress={(e) => {
114
+ if (charsCounter >= maxLength && e.key !== "Backspace") {
115
+ e.preventDefault();
116
+ }
117
+ }}
118
+ onKeyDown={(e) => {
119
+ let keysArray = [
120
+ "Backspace",
121
+ "Meta",
122
+ "ArrowLeft",
123
+ "ArrowRight",
124
+ "ArrowUp",
125
+ "ArrowDown",
126
+ ];
127
+ if (
128
+ charsCounter >= maxLength &&
129
+ keysArray.every((key) => e.key !== key)
130
+ ) {
131
+ e.preventDefault();
132
+ }
133
+ }}
134
+ onChange={(valueInput, user, range, h) => {
135
+ onChange(valueInput, user, range, h);
136
+ }}
137
+ onChangeSelection={getSelection}
138
+ />
139
+ <p className="description-limit">
140
+ {charsCounter}/{maxLength}
141
+ </p>
142
+ </Container>
143
+ );
144
+ };
@@ -0,0 +1,40 @@
1
+ import styled from "styled-components";
2
+ import { GlobalColors, FontFamily } from "../../../global-files/variables";
3
+
4
+ export const Container = styled.div`
5
+ .quill {
6
+ border: 1px solid
7
+ ${({ focus, isRequired }) =>
8
+ focus ? GlobalColors.magenta_s2 : isRequired ? "red" : GlobalColors.s3};
9
+ position: relative;
10
+ border-radius: 2px;
11
+
12
+ .ql-toolbar {
13
+ background-color: ${GlobalColors.s2};
14
+ position: absolute;
15
+ z-index: 10;
16
+ border: 1px solid ${GlobalColors.s3};
17
+ width: 45px;
18
+ height: 45px;
19
+ border-radius: 4px;
20
+ visibility: ${({ selection }) => (selection ? "visible" : "hidden")};
21
+ top: ${({ position }) => position.top}px;
22
+ left: ${({ position }) => position.left}px;
23
+ }
24
+
25
+ .ql-container {
26
+ border: none;
27
+ font-family: ${FontFamily.AvenirNext};
28
+ color: ${GlobalColors.s4};
29
+ strong {
30
+ font-family: ${FontFamily.Raleway_900};
31
+ }
32
+ }
33
+ }
34
+ .description-limit {
35
+ font-size: 12px;
36
+ font-family: ${FontFamily.AvenirNext};
37
+ color: ${GlobalColors.s4};
38
+ text-align: right;
39
+ }
40
+ `;
@@ -0,0 +1,26 @@
1
+ import React, { useState, useEffect } from "react";
2
+ import { MainContainer } from "./style";
3
+ import Input from "../Input";
4
+
5
+ export default function LabelToInput(props) {
6
+ const [isActive, setIsActive] = useState(false);
7
+ const [defaultValue, setDefaultValue] = useState("");
8
+ useEffect(() => {
9
+ setDefaultValue(props.defaultValue === "" ? "-" : props.defaultValue);
10
+ }, [props.defaultValue]);
11
+ return (
12
+ <MainContainer width={props.width} error={!isActive && props.error}>
13
+ {!isActive ? (
14
+ <p onClick={() => setIsActive(true)}>{defaultValue}</p>
15
+ ) : (
16
+ <Input
17
+ {...props}
18
+ onBlur={() => {
19
+ props.onBlur && props.onBlur();
20
+ setIsActive(false);
21
+ }}
22
+ />
23
+ )}
24
+ </MainContainer>
25
+ );
26
+ }
@@ -0,0 +1,41 @@
1
+ import styled from "styled-components";
2
+ import { GlobalColors, FontFamily } from "../../../global-files/variables";
3
+
4
+ export const MainContainer = styled.div`
5
+ display: flex;
6
+ align-items: center;
7
+ width: fit-content;
8
+ height: 20px;
9
+ box-sizing: border-box;
10
+ border-radius: 2px;
11
+ margin-left: auto;
12
+ white-space: nowrap;
13
+ overflow-x: auto;
14
+ overflow-y: hidden;
15
+
16
+ & > p {
17
+ font-family: ${FontFamily.AvenirNext};
18
+ font-weight: 400;
19
+ font-size: 11px;
20
+ line-height: 19px;
21
+ color: ${GlobalColors.s5};
22
+ background-color: ${GlobalColors.s2};
23
+ padding: 1px 3px;
24
+ border-radius: 3px;
25
+ min-width: 50px;
26
+ height: 21px;
27
+ text-align: center;
28
+ }
29
+ border: ${(props) => props.error && "1px solid red"};
30
+ ::-webkit-scrollbar {
31
+ width: 3px;
32
+ height: 3px;
33
+ }
34
+ ::-webkit-scrollbar-track {
35
+ background: #f1f1f1;
36
+ }
37
+ ::-webkit-scrollbar-thumb {
38
+ background: #d4d1d7;
39
+ border-radius: 3px;
40
+ }
41
+ `;
@@ -6,7 +6,7 @@ import low from "../../../assets/images/flags/lowPriority.svg";
6
6
 
7
7
  export const PriorityFlag = ({ priority }) => {
8
8
  const PriorityFlags = {
9
- ["no priority"]: without,
9
+ ["none"]: without,
10
10
  ["low"]: low,
11
11
  ["medium"]: medium,
12
12
  ["high"]: high,
@@ -4,7 +4,7 @@ export const Container = styled.div`
4
4
  width: fit-content;
5
5
 
6
6
  img {
7
- object-fit: cover;
7
+ object-fit: contain;
8
8
  }
9
9
 
10
10
  &.carousel-image {
@@ -1,8 +1,8 @@
1
1
  import { Container } from "./styles";
2
2
 
3
- export const ProgressBar = ({ percent, backgroundColor }) => {
3
+ export const ProgressBar = ({ percent, progressBarType }) => {
4
4
  return (
5
- <Container backgroundColor={backgroundColor}>
5
+ <Container className={`status-${progressBarType}`}>
6
6
  <p>{percent}%</p>
7
7
  </Container>
8
8
  );
@@ -2,7 +2,7 @@ import styled from "styled-components";
2
2
  import { FontFamily, GlobalColors } from "../../../global-files/variables";
3
3
 
4
4
  export const Container = styled.div`
5
- background-color: ${(props) => GlobalColors[props.backgroundColor]};
5
+ background-color: ${GlobalColors.s3};
6
6
  width: fit-content;
7
7
  height: 27px;
8
8
  padding: 4px;
@@ -11,8 +11,59 @@ export const Container = styled.div`
11
11
  font-weight: 600;
12
12
  font-size: 14px;
13
13
  line-height: 19px;
14
- color: ${(props) =>
15
- props.backgroundColor === "s2" || props.backgroundColor === "s1"
14
+ color: ${(backgroundColor) =>
15
+ backgroundColor === "s2" || backgroundColor === "s1"
16
16
  ? GlobalColors.s4
17
17
  : GlobalColors.white};
18
+
19
+ &.status-As,
20
+ &.status-P {
21
+ background-color: ${GlobalColors.in_progress};
22
+ }
23
+
24
+ &.status-Pr,
25
+ &.status-Rr {
26
+ background-color: ${GlobalColors.reception};
27
+ }
28
+
29
+ &.status-AA,
30
+ &.status-AP,
31
+ &.status-AC,
32
+ &.status-AF {
33
+ background-color: ${GlobalColors.finished};
34
+ }
35
+
36
+ &.status-RA,
37
+ &.status-RF,
38
+ &.status-RP,
39
+ &.status-RC {
40
+ background-color: ${GlobalColors.rejected_status};
41
+ }
42
+
43
+ &.status-Dat,
44
+ &.status-Dsc,
45
+ &.status-Imgs {
46
+ background-color: ${GlobalColors.s4};
47
+ }
48
+
49
+ &.status-Ex {
50
+ background-color: ${GlobalColors.exported};
51
+ }
52
+
53
+ &.status-DDI {
54
+ background-color: ${GlobalColors.original_purpura};
55
+ }
56
+
57
+ &.status-GLD {
58
+ background-color: ${GlobalColors.in_progress};
59
+ }
60
+
61
+ &.status-TAB {
62
+ background-color: ${GlobalColors.deep_gray};
63
+ }
64
+
65
+ &.status-Pt {
66
+ background-color: ${GlobalColors.s2};
67
+ color: ${GlobalColors.s4};
68
+ }
18
69
  `;
@@ -8,12 +8,16 @@ export const ScreenHeader = ({
8
8
  color,
9
9
  headerType,
10
10
  Paragraph,
11
-
12
11
  }) => {
13
12
  return (
14
- <Container fontFamily={fontFamily} color={color} className={headerType} key={`title-${text}`}>
13
+ <Container
14
+ fontFamily={fontFamily}
15
+ color={color}
16
+ className={headerType}
17
+ key={`title-${text}`}
18
+ >
15
19
  {text} {boldText && <span> {boldText}</span>}
16
- {<p>{Paragraph}</p>}
20
+ {Paragraph && <p>{Paragraph}</p>}
17
21
  </Container>
18
22
  );
19
23
  };
@@ -52,6 +52,11 @@ export const Container = styled.h2`
52
52
  font-weight: 400;
53
53
  font-size: 11px;
54
54
  line-height: 18px;
55
+
56
+ &:last-child {
57
+ min-width: 50px;
58
+ text-align: center;
59
+ }
55
60
  }
56
61
 
57
62
  &.gray-table-row {
@@ -63,12 +68,14 @@ export const Container = styled.h2`
63
68
  background-color: ${GlobalColors.s2};
64
69
  padding: 1px 3px;
65
70
  border-radius: 3px;
71
+ min-width: 50px;
72
+ text-align: center;
66
73
  }
67
- &.header-and-paragraph{
74
+ &.header-and-paragraph {
68
75
  font-family: ${FontFamily.Raleway};
69
76
  font-size: 36px;
70
77
  color: ${GlobalColors.s5};
71
- p{
78
+ p {
72
79
  font-family: ${FontFamily.AvenirNext};
73
80
  font-size: 14px;
74
81
  color: ${GlobalColors.s4};
@@ -0,0 +1,35 @@
1
+ import { SelectCustom, Container, BackgroundEnd } from "./style";
2
+
3
+ export default function Select(props) {
4
+ return (
5
+ <Container width={props.width}>
6
+ <SelectCustom
7
+ id={props.id}
8
+ width={props.width}
9
+ onChange={props.onChange}
10
+ defaultValue={props.valueSelected ? props.valueSelected : ""}
11
+ >
12
+ <option value="" disabled>
13
+ {props.placeholder}
14
+ </option>
15
+ {props.options &&
16
+ props.options.map((item, i) => (
17
+ <option
18
+ className={item.required ? "option-required" : ""}
19
+ //className={ ? "option-required" : ""}
20
+ key={"select-" + item.value ? item.value : item + "-" + i}
21
+ value={item.value ? item.value : item}
22
+ // selected={
23
+ // item.value
24
+ // ? item.value == props.valueSelected && "selected"
25
+ // : item === props.valueSelected && "selected"
26
+ // }
27
+ >
28
+ {item.name ? item.name : item} {item?.required ? "*" : ""}
29
+ </option>
30
+ ))}
31
+ </SelectCustom>
32
+ <BackgroundEnd />
33
+ </Container>
34
+ );
35
+ }
@@ -0,0 +1,76 @@
1
+ import styled from "styled-components";
2
+
3
+ export const Container = styled.div`
4
+ position: relative;
5
+ display: flex;
6
+ align-items: center;
7
+ cursor: pointer;
8
+ height: 21px;
9
+ line-height: 3;
10
+ width: ${({ width }) => width || "100%"};
11
+ overflow: hidden;
12
+ border-radius: 0.25em;
13
+ &::after {
14
+ border-left: 1px solid #e33aa9;
15
+ border-top: 1px solid #e33aa9;
16
+ width: 4px;
17
+ content: "";
18
+ height: 4px;
19
+ position: absolute;
20
+ right: 7px;
21
+ -webkit-transform: rotate(-135deg);
22
+ -ms-transform: rotate(-135deg);
23
+ transform: rotate(-135deg);
24
+ top: 35%;
25
+ }
26
+ &::before {
27
+ border-left: 1px solid #e33aa9;
28
+ width: 1px;
29
+ content: "";
30
+ height: 15px;
31
+ right: 15px;
32
+ position: absolute;
33
+ z-index: 2;
34
+ }
35
+ `;
36
+
37
+ export const BackgroundEnd = styled.div`
38
+ position: absolute;
39
+ left: calc(100% - 18px);
40
+ height: 100%;
41
+ width: 18px;
42
+ background-color: #fafafa;
43
+ `;
44
+
45
+ export const SelectCustom = styled.select`
46
+ background: #fafafa;
47
+ -webkit-appearance: none;
48
+ -moz-appearance: none;
49
+ -ms-appearance: none;
50
+ appearance: none;
51
+ outline: 0;
52
+ box-shadow: none;
53
+ border: 0 !important;
54
+ background-image: none;
55
+ width: ${({ width }) => width || "100%"};
56
+ cursor: pointer;
57
+ height: 21px;
58
+ font-family: Avenir Next;
59
+ font-style: normal;
60
+ font-weight: normal;
61
+ font-size: 12px;
62
+ line-height: 21px;
63
+ padding: 0 5px;
64
+ box-sizing: border-box;
65
+ &::-ms-expand {
66
+ display: none;
67
+ }
68
+ option {
69
+ &:disabled {
70
+ color: #d4d1d7;
71
+ }
72
+ &:invalid {
73
+ color: gray;
74
+ }
75
+ }
76
+ `;
@@ -1,9 +1,37 @@
1
1
  import { Container } from "./styles";
2
2
 
3
3
  export const StatusTag = ({ statusType, ovalForm }) => {
4
+ const getShortStatus = (status) => {
5
+ switch (status) {
6
+ case "COMPLETED":
7
+ return "C";
8
+ case "RECEPTION":
9
+ return "Pr";
10
+ case "NULL":
11
+ return "-";
12
+ case "RECEIVED":
13
+ return "Rc";
14
+ case "IN_PROGRESS":
15
+ return "P";
16
+ case "ASSIGNED":
17
+ return "As";
18
+ case "APPROVED":
19
+ return "Ap";
20
+ case "VALIDATING":
21
+ return "V";
22
+ case "PAID_OUT":
23
+ return "Po";
24
+ default:
25
+ return status;
26
+ }
27
+ };
4
28
  return (
5
- <Container className={`status-${statusType} ${ovalForm && "oval-form"}`}>
6
- <p>{statusType}</p>
29
+ <Container
30
+ className={`status-${getShortStatus(statusType)} ${
31
+ ovalForm && "oval-form"
32
+ }`}
33
+ >
34
+ <p>{getShortStatus(statusType)}</p>
7
35
  </Container>
8
36
  );
9
37
  };
@@ -2,7 +2,8 @@ import styled from "styled-components";
2
2
  import { FontFamily, GlobalColors } from "../../../global-files/variables";
3
3
 
4
4
  export const Container = styled.div`
5
- width: 30px;
5
+ width: fit-content;
6
+ padding: 0 10px;
6
7
  height: 20px;
7
8
  background-color: ${GlobalColors.s3};
8
9
  border-radius: 3px;
@@ -16,7 +17,9 @@ export const Container = styled.div`
16
17
  }
17
18
 
18
19
  &.status-As,
19
- &.status-P {
20
+ &.status-P,
21
+ &.status-IN_PROGRESS,
22
+ &.status-QF {
20
23
  background-color: ${GlobalColors.in_progress};
21
24
  }
22
25
 
@@ -26,10 +29,19 @@ export const Container = styled.div`
26
29
  }
27
30
 
28
31
  &.status-AA,
29
- &.status-AP {
32
+ &.status-AP,
33
+ &.status-AC,
34
+ &.status-AF {
30
35
  background-color: ${GlobalColors.finished};
31
36
  }
32
37
 
38
+ &.status-RA,
39
+ &.status-RF,
40
+ &.status-RP,
41
+ &.status-RC {
42
+ background-color: ${GlobalColors.rejected_status};
43
+ }
44
+
33
45
  &.status-Dat,
34
46
  &.status-Dsc,
35
47
  &.status-Imgs {
@@ -7,8 +7,9 @@ export const ValidationPanel = ({
7
7
  id,
8
8
  setOptionClicked,
9
9
  setShowValidationPanel,
10
+ approve,
11
+ reject,
10
12
  }) => {
11
-
12
13
  const optionSelected = (option) => {
13
14
  setOptionClicked(`${option}-button`);
14
15
  setShowValidationPanel(false);
@@ -18,7 +19,7 @@ export const ValidationPanel = ({
18
19
  <Container id={id}>
19
20
  <button
20
21
  onClick={() => {
21
- optionSelected("accept");
22
+ approve && approve();
22
23
  }}
23
24
  className="validation-option"
24
25
  >
@@ -27,7 +28,7 @@ export const ValidationPanel = ({
27
28
  </button>
28
29
  <button
29
30
  onClick={() => {
30
- optionSelected("reject");
31
+ reject && reject();
31
32
  }}
32
33
  className="validation-option"
33
34
  >
@@ -10,7 +10,10 @@ import React, { useState, useEffect, useCallback } from "react";
10
10
 
11
11
  export const VerticalSideMenuMainPage = () => {
12
12
  const [trueBar, setTrueBar] = useState(false);
13
-
13
+ const active = () => {
14
+ console.log(window.location.href);
15
+ //document.getElementById("slidea1").style.border= "1px solid rgb(227, 58, 169)";
16
+ };
14
17
  return (
15
18
  <Container bar={trueBar}>
16
19
  <div className="navbar-top">
@@ -20,20 +23,20 @@ export const VerticalSideMenuMainPage = () => {
20
23
  className="logo"
21
24
  ></img>
22
25
  <div className="option">
23
- <div className="icon">
24
- <img src={iconSpeedometer} alt="Speed Meter"></img>
26
+ <div>
27
+ <img src={iconSpeedometer} alt="Speed Meter" width={"25px"}></img>
25
28
  </div>
26
- <div className="icon">
27
- <img src={iconProduct} alt="Focus Product"></img>
29
+ <div>
30
+ <img src={iconProduct} alt="Focus Product" width={"25px"}></img>
28
31
  </div>
29
- <div className="icon">
30
- <img src={iconGroup} alt="Group"></img>
32
+ <div>
33
+ <img src={iconGroup} alt="Group" width={"25px"}></img>
31
34
  </div>
32
- <div className="icon">
33
- <img src={iconLogo} alt="Logo"></img>
35
+ <div>
36
+ <img src={iconLogo} alt="Logo" width={"25px"}></img>
34
37
  </div>
35
- <div className="icon">
36
- <img src={iconTask} alt="Task"></img>
38
+ <div>
39
+ <img src={iconTask} alt="Task" width={"25px"}></img>
37
40
  </div>
38
41
  </div>
39
42
  </div>
@@ -43,6 +46,7 @@ export const VerticalSideMenuMainPage = () => {
43
46
  alt="Open Menu"
44
47
  onClick={() => {
45
48
  setTrueBar(true);
49
+ active();
46
50
  }}
47
51
  ></img>
48
52
  </div>