contentoh-components-library 21.0.60 → 21.0.63

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 (246) hide show
  1. package/.env.development +18 -5
  2. package/.env.production +16 -3
  3. package/CHANGELOG.md +31 -33
  4. package/dist/assets/images/generalButton/downloadIcon.svg +3 -0
  5. package/dist/assets/images/modalsSVGs/attributesSent.svg +208 -0
  6. package/dist/assets/images/modalsSVGs/descriptionSent.svg +237 -0
  7. package/dist/assets/images/modalsSVGs/providerSent.svg +445 -0
  8. package/dist/assets/images/modalsSVGs/uploadingImages.svg +148 -0
  9. package/dist/components/atoms/AsignationOption/index.js +9 -5
  10. package/dist/components/atoms/AsignationOption/styles.js +1 -1
  11. package/dist/components/{molecules/SignInLogin/SignInLogin.stories.js → atoms/CharCounter/CharCounter.stories.js} +10 -7
  12. package/dist/components/atoms/CharCounter/index.js +22 -0
  13. package/dist/components/{molecules/LogoLoading → atoms/CharCounter}/styles.js +3 -1
  14. package/dist/components/atoms/CheckBox/index.js +4 -2
  15. package/dist/components/atoms/Commentary/Commentary.stories.js +1 -0
  16. package/dist/components/atoms/Commentary/index.js +23 -0
  17. package/dist/components/{organisms/ChangePassword → atoms/Commentary}/styles.js +6 -1
  18. package/dist/components/atoms/GeneralButton/index.js +5 -0
  19. package/dist/components/atoms/GeneralButton/styles.js +4 -2
  20. package/dist/components/atoms/GeneralInput/index.js +72 -25
  21. package/dist/components/atoms/GeneralInput/styles.js +7 -1
  22. package/dist/components/atoms/GenericModal/index.js +4 -2
  23. package/dist/components/atoms/GenericModal/styles.js +1 -1
  24. package/dist/components/atoms/GradientPanel/styles.js +1 -1
  25. package/dist/components/atoms/Input/index.js +26 -0
  26. package/dist/components/atoms/Input/style.js +26 -0
  27. package/dist/components/{organisms/ChangePassword/ChangePassword.stories.js → atoms/InputFormatter/Wysiwyg.stories.js} +9 -7
  28. package/dist/components/atoms/InputFormatter/index.js +184 -0
  29. package/dist/components/atoms/InputFormatter/styles.js +33 -0
  30. package/dist/components/atoms/LabelToInput/index.js +53 -0
  31. package/dist/components/atoms/LabelToInput/style.js +22 -0
  32. package/dist/components/atoms/Loading/index.js +0 -1
  33. package/dist/components/atoms/LogoImage/index.js +0 -1
  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 +4 -3
  48. package/dist/components/molecules/AvatarAndValidation/index.js +17 -7
  49. package/dist/components/molecules/AvatarAndValidation/styles.js +1 -1
  50. package/dist/components/molecules/CarouselImagesLogin/index.js +42 -40
  51. package/dist/components/molecules/FeaturesBar/index.js +1 -1
  52. package/dist/components/molecules/GalleryElement/index.js +80 -21
  53. package/dist/components/molecules/GalleryElement/styles.js +1 -1
  54. package/dist/components/molecules/GalleryHeader/index.js +28 -6
  55. package/dist/components/molecules/GalleryHeader/styles.js +1 -1
  56. package/dist/components/molecules/ImageSelector/index.js +2 -4
  57. package/dist/components/molecules/LoginPasswordStrength/index.js +6 -6
  58. package/dist/components/molecules/LoginPasswordStrength/styles.js +1 -1
  59. package/dist/components/molecules/ProductNameHeader/index.js +1 -2
  60. package/dist/components/molecules/RetailerSelector/RetailerSelector.stories.js +48 -0
  61. package/dist/components/molecules/RetailerSelector/index.js +74 -0
  62. package/dist/components/{atoms/MenuCommercialRetailers → molecules/RetailerSelector}/styles.js +1 -1
  63. package/dist/components/molecules/StatusAsignationInfo/index.js +46 -25
  64. package/dist/components/molecules/StatusAsignationInfo/styles.js +1 -1
  65. package/dist/components/molecules/TableHeader/index.js +12 -5
  66. package/dist/components/molecules/TableHeader/styles.js +1 -1
  67. package/dist/components/molecules/TagAndInput/index.js +24 -2
  68. package/dist/components/molecules/TextAndGradient/TextAndGradient.stories.js +31 -0
  69. package/dist/components/molecules/TextAndGradient/index.js +36 -0
  70. package/dist/components/molecules/TextAndGradient/styles.js +18 -0
  71. package/dist/components/organisms/FullProductNameHeader/index.js +32 -8
  72. package/dist/components/organisms/FullTabsMenu/index.js +18 -5
  73. package/dist/components/organisms/ImageDataTable/index.js +90 -14
  74. package/dist/components/organisms/InputGroup/index.js +34 -13
  75. package/dist/components/organisms/InputGroup/styles.js +1 -1
  76. package/dist/components/organisms/ProductImageModal/index.js +15 -11
  77. package/dist/components/organisms/ProductImageModal/styles.js +1 -1
  78. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +91 -347
  79. package/dist/components/pages/RetailerProductEdition/index.js +1608 -60
  80. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  81. package/dist/global-files/data.js +212 -53
  82. package/dist/global-files/global-styles.css +1 -0
  83. package/dist/global-files/variables.js +1 -0
  84. package/dist/index.js +30 -277
  85. package/package.json +12 -14
  86. package/src/assets/images/generalButton/downloadIcon.svg +3 -0
  87. package/src/assets/images/modalsSVGs/attributesSent.svg +208 -0
  88. package/src/assets/images/modalsSVGs/descriptionSent.svg +237 -0
  89. package/src/assets/images/modalsSVGs/providerSent.svg +445 -0
  90. package/src/assets/images/modalsSVGs/uploadingImages.svg +148 -0
  91. package/src/components/atoms/AsignationOption/index.js +7 -5
  92. package/src/components/atoms/AsignationOption/styles.js +9 -1
  93. package/src/components/atoms/CharCounter/CharCounter.stories.js +11 -0
  94. package/src/components/atoms/CharCounter/index.js +13 -0
  95. package/src/components/atoms/CharCounter/styles.js +10 -0
  96. package/src/components/atoms/CheckBox/index.js +8 -2
  97. package/src/components/atoms/Commentary/Commentary.stories.js +0 -0
  98. package/src/components/atoms/Commentary/index.js +9 -0
  99. package/src/components/atoms/Commentary/styles.js +16 -0
  100. package/src/components/atoms/GeneralButton/index.js +9 -2
  101. package/src/components/atoms/GeneralButton/styles.js +23 -0
  102. package/src/components/atoms/GeneralInput/index.js +71 -23
  103. package/src/components/atoms/GeneralInput/styles.js +11 -1
  104. package/src/components/atoms/GenericModal/index.js +2 -2
  105. package/src/components/atoms/GenericModal/styles.js +10 -2
  106. package/src/components/atoms/GradientPanel/styles.js +0 -1
  107. package/src/components/atoms/Input/index.js +15 -0
  108. package/src/components/atoms/Input/style.js +31 -0
  109. package/src/components/atoms/InputFormatter/Wysiwyg.stories.js +12 -0
  110. package/src/components/atoms/InputFormatter/index.js +144 -0
  111. package/src/components/atoms/InputFormatter/styles.js +40 -0
  112. package/src/components/atoms/LabelToInput/index.js +26 -0
  113. package/src/components/atoms/LabelToInput/style.js +41 -0
  114. package/src/components/atoms/Loading/index.js +2 -3
  115. package/src/components/atoms/LogoImage/index.js +1 -1
  116. package/src/components/atoms/PriorityFlag/index.js +1 -1
  117. package/src/components/atoms/ProductImage/styles.js +1 -1
  118. package/src/components/atoms/ProgressBar/index.js +2 -2
  119. package/src/components/atoms/ProgressBar/styles.js +54 -3
  120. package/src/components/atoms/ScreenHeader/index.js +7 -3
  121. package/src/components/atoms/ScreenHeader/styles.js +9 -2
  122. package/src/components/atoms/Select/index.js +35 -0
  123. package/src/components/atoms/Select/style.js +76 -0
  124. package/src/components/atoms/StatusTag/index.js +30 -2
  125. package/src/components/atoms/StatusTag/styles.js +15 -3
  126. package/src/components/atoms/ValidationPanel/index.js +3 -3
  127. package/src/components/molecules/AvatarAndValidation/index.js +24 -6
  128. package/src/components/molecules/AvatarAndValidation/styles.js +1 -1
  129. package/src/components/molecules/CarouselImagesLogin/index.js +37 -34
  130. package/src/components/molecules/FeaturesBar/index.js +10 -7
  131. package/src/components/molecules/GalleryElement/index.js +75 -36
  132. package/src/components/molecules/GalleryElement/styles.js +38 -11
  133. package/src/components/molecules/GalleryHeader/index.js +14 -8
  134. package/src/components/molecules/GalleryHeader/styles.js +16 -0
  135. package/src/components/molecules/ImageSelector/index.js +2 -3
  136. package/src/components/molecules/LoginPasswordStrength/index.js +3 -8
  137. package/src/components/molecules/LoginPasswordStrength/styles.js +0 -3
  138. package/src/components/molecules/ProductNameHeader/index.js +1 -2
  139. package/src/components/molecules/RetailerSelector/RetailerSelector.stories.js +35 -0
  140. package/src/components/molecules/RetailerSelector/index.js +63 -0
  141. package/src/components/molecules/RetailerSelector/styles.js +18 -0
  142. package/src/components/molecules/StatusAsignationInfo/index.js +62 -38
  143. package/src/components/molecules/StatusAsignationInfo/styles.js +12 -2
  144. package/src/components/molecules/TableHeader/index.js +16 -3
  145. package/src/components/molecules/TableHeader/styles.js +5 -0
  146. package/src/components/molecules/TagAndInput/index.js +24 -2
  147. package/src/components/organisms/FullProductNameHeader/index.js +28 -7
  148. package/src/components/organisms/FullTabsMenu/index.js +15 -3
  149. package/src/components/organisms/ImageDataTable/index.js +89 -11
  150. package/src/components/organisms/InputGroup/index.js +46 -11
  151. package/src/components/organisms/InputGroup/styles.js +3 -0
  152. package/src/components/organisms/ProductImageModal/index.js +20 -12
  153. package/src/components/organisms/ProductImageModal/styles.js +3 -0
  154. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +91 -343
  155. package/src/components/pages/RetailerProductEdition/index.js +1238 -48
  156. package/src/components/pages/RetailerProductEdition/styles.js +67 -4
  157. package/src/global-files/data.js +156 -57
  158. package/src/global-files/global-styles.css +1 -0
  159. package/src/global-files/variables.js +1 -0
  160. package/src/index.js +1 -20
  161. package/dist/assets/images/carouselImagesLogin/login2.svg +0 -117
  162. package/dist/assets/images/carouselImagesLogin/login3.svg +0 -147
  163. package/dist/assets/images/carouselImagesLogin/loginImage.svg +0 -301
  164. package/dist/assets/images/sliderToolTip/infoIcon.svg +0 -4
  165. package/dist/assets/images/sliderToolTip/slide1.svg +0 -5
  166. package/dist/assets/images/sliderToolTip/slide2.svg +0 -9
  167. package/dist/assets/images/sliderToolTip/slide3.svg +0 -9
  168. package/dist/assets/images/sliderToolTip/slide4.svg +0 -9
  169. package/dist/assets/images/sliderToolTip/slide5.svg +0 -40
  170. package/dist/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +0 -36
  171. package/dist/components/atoms/ListCommercialRetailers/index.js +0 -64
  172. package/dist/components/atoms/ListCommercialRetailers/styles.js +0 -20
  173. package/dist/components/atoms/Loading/Loading.stories.js +0 -28
  174. package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +0 -37
  175. package/dist/components/atoms/MenuCommercialRetailers/index.js +0 -25
  176. package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +0 -28
  177. package/dist/components/atoms/MenuProductImage/index.js +0 -88
  178. package/dist/components/atoms/MenuProductImage/styles.js +0 -20
  179. package/dist/components/atoms/SliderToolTip/SliderToolTip.stories.js +0 -47
  180. package/dist/components/atoms/SliderToolTip/index.js +0 -200
  181. package/dist/components/atoms/SliderToolTip/styles.js +0 -24
  182. package/dist/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +0 -22
  183. package/dist/components/atoms/VerticalSideMenuMainPage/index.js +0 -49
  184. package/dist/components/atoms/VerticalSideMenuMainPage/styles.js +0 -18
  185. package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +0 -25
  186. package/dist/components/molecules/ApproveRejetPanel/index.js +0 -49
  187. package/dist/components/molecules/ApproveRejetPanel/styles.js +0 -18
  188. package/dist/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +0 -28
  189. package/dist/components/molecules/EmailResetPasswordLogin/index.js +0 -153
  190. package/dist/components/molecules/EmailResetPasswordLogin/styles.js +0 -20
  191. package/dist/components/molecules/LogoLoading/Loading.stories.js +0 -28
  192. package/dist/components/molecules/LogoLoading/index.js +0 -22
  193. package/dist/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +0 -28
  194. package/dist/components/molecules/RegistrationFirstStep/index.js +0 -308
  195. package/dist/components/molecules/RegistrationFirstStep/styles.js +0 -20
  196. package/dist/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +0 -28
  197. package/dist/components/molecules/RegistrationSecondStep/index.js +0 -169
  198. package/dist/components/molecules/RegistrationSecondStep/styles.js +0 -20
  199. package/dist/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +0 -28
  200. package/dist/components/molecules/RegistrationThirdStep/index.js +0 -155
  201. package/dist/components/molecules/RegistrationThirdStep/styles.js +0 -20
  202. package/dist/components/molecules/SignInLogin/index.js +0 -295
  203. package/dist/components/molecules/SignInLogin/styles.js +0 -20
  204. package/dist/components/molecules/SignInLoginCreationApp/SignInLogin.stories.js +0 -28
  205. package/dist/components/molecules/SignInLoginCreationApp/index.js +0 -270
  206. package/dist/components/molecules/SignInLoginCreationApp/styles.js +0 -20
  207. package/dist/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +0 -28
  208. package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +0 -210
  209. package/dist/components/molecules/VerificationCodeResetPasswordLogin/styles.js +0 -20
  210. package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +0 -69
  211. package/dist/components/organisms/ChangePassword/index.js +0 -123
  212. package/src/assets/images/sliderToolTip/infoIcon.svg +0 -4
  213. package/src/assets/images/sliderToolTip/slide1.svg +0 -5
  214. package/src/assets/images/sliderToolTip/slide2.svg +0 -9
  215. package/src/assets/images/sliderToolTip/slide3.svg +0 -9
  216. package/src/assets/images/sliderToolTip/slide4.svg +0 -9
  217. package/src/assets/images/sliderToolTip/slide5.svg +0 -40
  218. package/src/components/atoms/Loading/Loading.stories.js +0 -10
  219. package/src/components/atoms/SliderToolTip/SliderToolTip.stories.js +0 -23
  220. package/src/components/atoms/SliderToolTip/index.js +0 -182
  221. package/src/components/atoms/SliderToolTip/styles.js +0 -168
  222. package/src/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +0 -11
  223. package/src/components/molecules/EmailResetPasswordLogin/index.js +0 -85
  224. package/src/components/molecules/EmailResetPasswordLogin/styles.js +0 -23
  225. package/src/components/molecules/LogoLoading/Loading.stories.js +0 -10
  226. package/src/components/molecules/LogoLoading/index.js +0 -12
  227. package/src/components/molecules/LogoLoading/styles.js +0 -16
  228. package/src/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +0 -11
  229. package/src/components/molecules/RegistrationFirstStep/index.js +0 -227
  230. package/src/components/molecules/RegistrationFirstStep/styles.js +0 -87
  231. package/src/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +0 -11
  232. package/src/components/molecules/RegistrationSecondStep/index.js +0 -130
  233. package/src/components/molecules/RegistrationSecondStep/styles.js +0 -59
  234. package/src/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +0 -11
  235. package/src/components/molecules/RegistrationThirdStep/index.js +0 -130
  236. package/src/components/molecules/RegistrationThirdStep/styles.js +0 -44
  237. package/src/components/molecules/SignInLogin/SignInLogin.stories.js +0 -11
  238. package/src/components/molecules/SignInLogin/index.js +0 -210
  239. package/src/components/molecules/SignInLogin/styles.js +0 -79
  240. package/src/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +0 -11
  241. package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +0 -170
  242. package/src/components/molecules/VerificationCodeResetPasswordLogin/styles.js +0 -51
  243. package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +0 -54
  244. package/src/components/organisms/ChangePassword/ChangePassword.stories.js +0 -11
  245. package/src/components/organisms/ChangePassword/index.js +0 -76
  246. package/src/components/organisms/ChangePassword/styles.js +0 -13
@@ -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
+ `;
@@ -1,8 +1,7 @@
1
- import { Container,Loader } from "./styles";
2
-
1
+ import { Container, Loader } from "./styles";
3
2
  export const Loading = () => {
4
3
  return (
5
- <Container className="loading">
4
+ <Container>
6
5
  <Loader>
7
6
  <span className="first"></span>
8
7
  <span className="second"></span>
@@ -3,7 +3,7 @@ import logoLogin from "../../../assets/images/logo/logoLogin.svg";
3
3
 
4
4
  export const LogoImage = () => {
5
5
  return (
6
- <Container key={`logo`} className="logo">
6
+ <Container key={`logo`}>
7
7
  <img src={logoLogin} alt={"logo"} />
8
8
  </Container>
9
9
  );
@@ -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,8 @@ export const ValidationPanel = ({
7
7
  id,
8
8
  setOptionClicked,
9
9
  setShowValidationPanel,
10
+ sendToFacilitator,
10
11
  }) => {
11
-
12
12
  const optionSelected = (option) => {
13
13
  setOptionClicked(`${option}-button`);
14
14
  setShowValidationPanel(false);
@@ -18,7 +18,7 @@ export const ValidationPanel = ({
18
18
  <Container id={id}>
19
19
  <button
20
20
  onClick={() => {
21
- optionSelected("accept");
21
+ sendToFacilitator("A");
22
22
  }}
23
23
  className="validation-option"
24
24
  >
@@ -27,7 +27,7 @@ export const ValidationPanel = ({
27
27
  </button>
28
28
  <button
29
29
  onClick={() => {
30
- optionSelected("reject");
30
+ sendToFacilitator("R");
31
31
  }}
32
32
  className="validation-option"
33
33
  >