contentoh-components-library 21.2.65 → 21.2.66

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 (71) hide show
  1. package/.env.development +4 -1
  2. package/dist/assets/images/chatPopup/Spinner.gif +0 -0
  3. package/dist/assets/images/chatPopup/close.svg +3 -0
  4. package/dist/assets/images/chatPopup/defaultImage.png +0 -0
  5. package/dist/assets/images/chatPopup/defaultProfile.png +0 -0
  6. package/dist/assets/images/chatPopup/doc.svg +1 -0
  7. package/dist/assets/images/chatPopup/document.svg +1 -0
  8. package/dist/assets/images/chatPopup/iconChat.svg +19 -0
  9. package/dist/assets/images/chatPopup/iconPlus.svg +3 -0
  10. package/dist/assets/images/chatPopup/pdf.svg +75 -0
  11. package/dist/assets/images/chatPopup/remove.svg +4 -0
  12. package/dist/assets/images/chatPopup/send.svg +3 -0
  13. package/dist/assets/images/chatPopup/svgIcon.svg +109 -0
  14. package/dist/assets/images/chatPopup/upload_file.svg +3 -0
  15. package/dist/assets/images/chatPopup/xls.svg +53 -0
  16. package/dist/components/atoms/ChatPopUp/ChatPopUp.stories.js +28 -0
  17. package/dist/components/atoms/ChatPopUp/index.js +841 -0
  18. package/dist/components/atoms/ChatPopUp/styles.js +27 -0
  19. package/dist/components/atoms/ChatPopUp/utils/handlersChat.js +182 -0
  20. package/dist/components/atoms/CustomSelectItem/CustomSelectItem.stories.js +323 -0
  21. package/dist/components/atoms/CustomSelectItem/index.js +174 -0
  22. package/dist/components/atoms/CustomSelectItem/styles.js +20 -0
  23. package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
  24. package/dist/components/atoms/StatusTag/index.js +58 -0
  25. package/dist/components/atoms/StatusTag/styles.js +20 -0
  26. package/dist/components/atoms/Tooltip/Tooltip.stories.js +36 -0
  27. package/dist/components/atoms/Tooltip/index.js +55 -0
  28. package/dist/components/atoms/Tooltip/styles.js +18 -0
  29. package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +21 -22
  30. package/dist/components/molecules/CustomSelect/SelectItem.js +10 -1
  31. package/dist/components/molecules/CustomSelect/index.js +35 -14
  32. package/dist/components/molecules/CustomSelect/styles.js +1 -1
  33. package/dist/components/molecules/HeaderTop/index.js +10 -5
  34. package/dist/components/molecules/HeaderTop/styles.js +1 -1
  35. package/dist/components/pages/Dashboard/dashboardUtils.js +25 -32
  36. package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
  37. package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
  38. package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
  39. package/package.json +6 -1
  40. package/src/assets/images/chatPopup/Spinner.gif +0 -0
  41. package/src/assets/images/chatPopup/close.svg +3 -0
  42. package/src/assets/images/chatPopup/defaultImage.png +0 -0
  43. package/src/assets/images/chatPopup/defaultProfile.png +0 -0
  44. package/src/assets/images/chatPopup/doc.svg +1 -0
  45. package/src/assets/images/chatPopup/document.svg +1 -0
  46. package/src/assets/images/chatPopup/iconChat.svg +19 -0
  47. package/src/assets/images/chatPopup/iconPlus.svg +3 -0
  48. package/src/assets/images/chatPopup/pdf.svg +75 -0
  49. package/src/assets/images/chatPopup/remove.svg +4 -0
  50. package/src/assets/images/chatPopup/send.svg +3 -0
  51. package/src/assets/images/chatPopup/svgIcon.svg +109 -0
  52. package/src/assets/images/chatPopup/upload_file.svg +3 -0
  53. package/src/assets/images/chatPopup/xls.svg +53 -0
  54. package/src/assets/images/customSelect/starIcon.svg +14 -0
  55. package/src/components/atoms/ChatPopUp/ChatPopUp.stories.js +11 -0
  56. package/src/components/atoms/ChatPopUp/index.js +541 -0
  57. package/src/components/atoms/ChatPopUp/styles.js +278 -0
  58. package/src/components/atoms/ChatPopUp/utils/handlersChat.js +104 -0
  59. package/src/components/atoms/CustomSelectItem/CustomSelectItem.stories.js +410 -0
  60. package/src/components/atoms/CustomSelectItem/index.js +144 -0
  61. package/src/components/atoms/CustomSelectItem/styles.js +32 -0
  62. package/src/components/atoms/Tooltip/Tooltip.stories.js +15 -0
  63. package/src/components/atoms/Tooltip/index.js +35 -0
  64. package/src/components/atoms/Tooltip/styles.js +5 -0
  65. package/src/components/molecules/CustomSelect/CustomSelect.stories.js +19 -11
  66. package/src/components/molecules/CustomSelect/SelectItem.js +7 -0
  67. package/src/components/molecules/CustomSelect/index.js +8 -3
  68. package/src/components/molecules/CustomSelect/styles.js +0 -2
  69. package/src/components/molecules/HeaderTop/index.js +10 -6
  70. package/src/components/molecules/HeaderTop/styles.js +4 -0
  71. package/src/components/pages/Dashboard/dashboardUtils.js +18 -22
@@ -4,7 +4,7 @@ import searchIcon from "../../../assets/images/customSelect/searchIcon.png";
4
4
  import { useCloseModal } from "../../../global-files/customHooks";
5
5
  import { SelecItem } from "./SelectItem";
6
6
  import { Calendar } from "../../organisms/Calendar";
7
- import { formatDate } from "../../pages/Dashboard/dashboardUtils";
7
+ import { CustomSelectItem } from "../../atoms/CustomSelectItem";
8
8
 
9
9
  export const CustomSelect = ({
10
10
  options,
@@ -13,6 +13,7 @@ export const CustomSelect = ({
13
13
  selectLabel = "",
14
14
  customSelectId = "defaultSelectId",
15
15
  defaultOption,
16
+ parameterArray,
16
17
  setParameterArray,
17
18
  onClickItem,
18
19
  icon,
@@ -84,7 +85,7 @@ export const CustomSelect = ({
84
85
  setFilters(filteredArray);
85
86
  }, [text]);
86
87
 
87
- useEffect(() => {
88
+ useEffect(async () => {
88
89
  let newFiltersString = selectLabel;
89
90
  let counter = 0;
90
91
  const filtersArray = Object.keys(activeFilters);
@@ -164,14 +165,18 @@ export const CustomSelect = ({
164
165
  <p>{option.name}</p>
165
166
  </div>
166
167
  ) : (
167
- <SelecItem
168
+ <CustomSelectItem
169
+ className={"main-option"}
168
170
  key={customSelectId + option.id}
169
171
  option={option}
170
172
  customSelectId={customSelectId}
171
173
  setParameterArray={setParameterArray}
172
174
  activeFilters={activeFilters}
175
+ globalFilters={activeFilters}
176
+ parameterArray={parameterArray}
173
177
  setActiveFilters={setActiveFilters}
174
178
  onClickItem={onClickItem}
179
+ route={option.name}
175
180
  />
176
181
  )
177
182
  )}
@@ -11,8 +11,6 @@ export const Container = styled.div`
11
11
  font-size: 13px;
12
12
  display: flex;
13
13
  padding: ${(props) => (props.selectLabel !== "" ? "10px 15px" : "5px 5px")};
14
- //padding: 10px 15px;
15
- //padding: 5px 5px;
16
14
  justify-content: space-between;
17
15
  border-radius: 50px;
18
16
  background-color: ${({ filterActive }) =>
@@ -2,6 +2,7 @@ import { Container } from "./styles";
2
2
  import { ScreenHeader } from "../../atoms/ScreenHeader/index";
3
3
  import { Button } from "../../atoms/GeneralButton/index";
4
4
  import { useEffect, useRef } from "react";
5
+ import { ChatPopUp } from "../../atoms/ChatPopUp/index";
5
6
 
6
7
  export const HeaderTop = ({ setHeaderTop }) => {
7
8
  const headerTop = useRef();
@@ -13,12 +14,15 @@ export const HeaderTop = ({ setHeaderTop }) => {
13
14
  return (
14
15
  <Container ref={headerTop}>
15
16
  <ScreenHeader text="Edición de producto" />
16
- <Button
17
- buttonType="close-button"
18
- onClick={() => {
19
- window.location.href = `/products`;
20
- }}
21
- />
17
+ <div className="buttons-top">
18
+ {/* <ChatPopUp /> */}
19
+ <Button
20
+ buttonType="close-button"
21
+ onClick={() => {
22
+ window.location.href = `/products`;
23
+ }}
24
+ />
25
+ </div>
22
26
  </Container>
23
27
  );
24
28
  };
@@ -3,4 +3,8 @@ import styled from "styled-components";
3
3
  export const Container = styled.div`
4
4
  display: flex;
5
5
  justify-content: space-between;
6
+ .buttons-top {
7
+ display: flex;
8
+ align-items: center;
9
+ }
6
10
  `;
@@ -39,28 +39,8 @@ export const getCategories = async (user, company) => {
39
39
  const response = await axios.get(
40
40
  `${process.env.REACT_APP_CATEGORY_ENDPOINT}${query}`
41
41
  );
42
- const categories = JSON.parse(response.data.body)?.data;
43
- const categoriesKeys = Object.keys(categories || {});
44
- const subCategories = categoriesKeys?.map(
45
- (key) => categories[key].sub_category
46
- );
47
- const finalArray = [];
48
- let index = 0;
49
- subCategories?.forEach((element) => {
50
- element &&
51
- Object.keys(element || {}).forEach((key) => {
52
- const subCategory = element[key]?.sub_category || {};
53
- const subOptions = [];
54
- Object.keys(subCategory)?.forEach((subKey) => {
55
- subOptions.push({
56
- id: subCategory[subKey].id_category,
57
- name: subKey,
58
- });
59
- });
60
- finalArray.push({ id: index++, name: key, subOptions });
61
- });
62
- });
63
- finalArray.sort((a, b) => a.name.localeCompare(b.name));
42
+ const categories = JSON.parse(response.data.body)?.data || {};
43
+ const finalArray = getCategoriesRecursive(categories);
64
44
  return finalArray;
65
45
  };
66
46
 
@@ -71,3 +51,19 @@ export const formatDate = (date) => {
71
51
  const day = newDate.getDate();
72
52
  return `${year}/${month}/${day}`;
73
53
  };
54
+
55
+ const getCategoriesRecursive = (object) => {
56
+ const keys = Object.keys(object);
57
+ return keys.map((key, index) => {
58
+ const { sub_category } = object[key];
59
+ if (sub_category) {
60
+ return {
61
+ id: index,
62
+ name: key,
63
+ subOptions: getCategoriesRecursive(sub_category),
64
+ };
65
+ } else {
66
+ return { id: object[key].id_category, name: key };
67
+ }
68
+ });
69
+ };