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.
- package/.env.development +4 -1
- package/dist/assets/images/chatPopup/Spinner.gif +0 -0
- package/dist/assets/images/chatPopup/close.svg +3 -0
- package/dist/assets/images/chatPopup/defaultImage.png +0 -0
- package/dist/assets/images/chatPopup/defaultProfile.png +0 -0
- package/dist/assets/images/chatPopup/doc.svg +1 -0
- package/dist/assets/images/chatPopup/document.svg +1 -0
- package/dist/assets/images/chatPopup/iconChat.svg +19 -0
- package/dist/assets/images/chatPopup/iconPlus.svg +3 -0
- package/dist/assets/images/chatPopup/pdf.svg +75 -0
- package/dist/assets/images/chatPopup/remove.svg +4 -0
- package/dist/assets/images/chatPopup/send.svg +3 -0
- package/dist/assets/images/chatPopup/svgIcon.svg +109 -0
- package/dist/assets/images/chatPopup/upload_file.svg +3 -0
- package/dist/assets/images/chatPopup/xls.svg +53 -0
- package/dist/components/atoms/ChatPopUp/ChatPopUp.stories.js +28 -0
- package/dist/components/atoms/ChatPopUp/index.js +841 -0
- package/dist/components/atoms/ChatPopUp/styles.js +27 -0
- package/dist/components/atoms/ChatPopUp/utils/handlersChat.js +182 -0
- package/dist/components/atoms/CustomSelectItem/CustomSelectItem.stories.js +323 -0
- package/dist/components/atoms/CustomSelectItem/index.js +174 -0
- package/dist/components/atoms/CustomSelectItem/styles.js +20 -0
- package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
- package/dist/components/atoms/StatusTag/index.js +58 -0
- package/dist/components/atoms/StatusTag/styles.js +20 -0
- package/dist/components/atoms/Tooltip/Tooltip.stories.js +36 -0
- package/dist/components/atoms/Tooltip/index.js +55 -0
- package/dist/components/atoms/Tooltip/styles.js +18 -0
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +21 -22
- package/dist/components/molecules/CustomSelect/SelectItem.js +10 -1
- package/dist/components/molecules/CustomSelect/index.js +35 -14
- package/dist/components/molecules/CustomSelect/styles.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +10 -5
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/pages/Dashboard/dashboardUtils.js +25 -32
- package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
- package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
- package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
- package/package.json +6 -1
- package/src/assets/images/chatPopup/Spinner.gif +0 -0
- package/src/assets/images/chatPopup/close.svg +3 -0
- package/src/assets/images/chatPopup/defaultImage.png +0 -0
- package/src/assets/images/chatPopup/defaultProfile.png +0 -0
- package/src/assets/images/chatPopup/doc.svg +1 -0
- package/src/assets/images/chatPopup/document.svg +1 -0
- package/src/assets/images/chatPopup/iconChat.svg +19 -0
- package/src/assets/images/chatPopup/iconPlus.svg +3 -0
- package/src/assets/images/chatPopup/pdf.svg +75 -0
- package/src/assets/images/chatPopup/remove.svg +4 -0
- package/src/assets/images/chatPopup/send.svg +3 -0
- package/src/assets/images/chatPopup/svgIcon.svg +109 -0
- package/src/assets/images/chatPopup/upload_file.svg +3 -0
- package/src/assets/images/chatPopup/xls.svg +53 -0
- package/src/assets/images/customSelect/starIcon.svg +14 -0
- package/src/components/atoms/ChatPopUp/ChatPopUp.stories.js +11 -0
- package/src/components/atoms/ChatPopUp/index.js +541 -0
- package/src/components/atoms/ChatPopUp/styles.js +278 -0
- package/src/components/atoms/ChatPopUp/utils/handlersChat.js +104 -0
- package/src/components/atoms/CustomSelectItem/CustomSelectItem.stories.js +410 -0
- package/src/components/atoms/CustomSelectItem/index.js +144 -0
- package/src/components/atoms/CustomSelectItem/styles.js +32 -0
- package/src/components/atoms/Tooltip/Tooltip.stories.js +15 -0
- package/src/components/atoms/Tooltip/index.js +35 -0
- package/src/components/atoms/Tooltip/styles.js +5 -0
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +19 -11
- package/src/components/molecules/CustomSelect/SelectItem.js +7 -0
- package/src/components/molecules/CustomSelect/index.js +8 -3
- package/src/components/molecules/CustomSelect/styles.js +0 -2
- package/src/components/molecules/HeaderTop/index.js +10 -6
- package/src/components/molecules/HeaderTop/styles.js +4 -0
- 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 {
|
|
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
|
-
<
|
|
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
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
};
|
|
@@ -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
|
|
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
|
+
};
|