contentoh-components-library 21.3.90 → 21.3.92
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/dist/components/atoms/Avatar/index.js +3 -2
- package/dist/components/atoms/CheckBox/index.js +4 -1
- package/dist/components/atoms/CheckBox/styles.js +1 -1
- package/dist/components/atoms/ImageCarousel/ImgeSlider.stories.js +90 -0
- package/dist/components/atoms/ImageCarousel/index.js +123 -0
- package/dist/components/atoms/ImageCarousel/styles.js +18 -0
- package/dist/components/atoms/PercentTag/PercentTag.stories.js +31 -0
- package/dist/components/atoms/PercentTag/index.js +23 -0
- package/dist/components/atoms/PercentTag/styles.js +22 -0
- package/dist/components/atoms/RatingStars/RatingStars.stories.js +30 -0
- package/dist/components/atoms/RatingStars/index.js +53 -0
- package/dist/components/atoms/RatingStars/styles.js +18 -0
- package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +48 -0
- package/dist/components/atoms/RetailerCatalog/index.js +69 -0
- package/dist/components/atoms/RetailerCatalog/styles.js +20 -0
- package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +33 -0
- package/dist/components/atoms/RetailerOption/index.js +62 -0
- package/dist/components/atoms/RetailerOption/styles.js +20 -0
- package/dist/components/atoms/RetailersList/RetailersList.stories.js +45 -0
- package/dist/components/atoms/RetailersList/index.js +44 -0
- package/dist/components/atoms/RetailersList/styles.js +18 -0
- package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +72 -0
- package/dist/components/atoms/UserCatalog/index.js +89 -0
- package/dist/components/atoms/UserCatalog/styles.js +18 -0
- package/dist/components/atoms/UserOption/UserOption.stories.js +40 -0
- package/dist/components/atoms/UserOption/index.js +80 -0
- package/dist/components/atoms/UserOption/styles.js +20 -0
- package/dist/components/atoms/UserSelector/UserSelector.stories.js +40 -0
- package/dist/components/atoms/UserSelector/index.js +91 -0
- package/dist/components/atoms/UserSelector/styles.js +32 -0
- package/dist/components/molecules/GridItem/GridItem.stories.js +123 -0
- package/dist/components/molecules/GridItem/index.js +122 -0
- package/dist/components/molecules/GridItem/styles.js +20 -0
- package/dist/components/molecules/HeaderItem/ColumnItem.js +23 -0
- package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +70 -0
- package/dist/components/molecules/HeaderItem/index.js +42 -0
- package/dist/components/molecules/HeaderItem/styles.js +30 -0
- package/dist/components/molecules/RowItem/ColumnItem.js +23 -0
- package/dist/components/molecules/RowItem/RowItem.stories.js +5242 -0
- package/dist/components/molecules/RowItem/index.js +59 -0
- package/dist/components/molecules/RowItem/styles.js +30 -0
- package/dist/components/organisms/GridProducts/GridProducts.stories.js +5093 -0
- package/dist/components/organisms/GridProducts/index.js +81 -0
- package/dist/components/organisms/GridProducts/styles.js +18 -0
- package/dist/components/organisms/GridProducts/utils.js +139 -0
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -28
- package/dist/components/pages/RetailerProductEdition/index.js +23 -0
- package/dist/index.js +149 -58
- package/package.json +2 -1
- package/src/components/atoms/Avatar/index.js +8 -2
- package/src/components/atoms/CheckBox/index.js +2 -1
- package/src/components/atoms/CheckBox/styles.js +2 -0
- package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +76 -0
- package/src/components/atoms/ImageCarousel/index.js +103 -0
- package/src/components/atoms/ImageCarousel/styles.js +79 -0
- package/src/components/atoms/PercentTag/PercentTag.stories.js +7 -0
- package/src/components/atoms/PercentTag/index.js +9 -0
- package/src/components/atoms/PercentTag/styles.js +69 -0
- package/src/components/atoms/RatingStars/RatingStars.stories.js +10 -0
- package/src/components/atoms/RatingStars/index.js +31 -0
- package/src/components/atoms/RatingStars/styles.js +28 -0
- package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +36 -0
- package/src/components/atoms/RetailerCatalog/index.js +49 -0
- package/src/components/atoms/RetailerCatalog/styles.js +30 -0
- package/src/components/atoms/RetailerOption/RetailerOption.stories.js +15 -0
- package/src/components/atoms/RetailerOption/index.js +53 -0
- package/src/components/atoms/RetailerOption/styles.js +41 -0
- package/src/components/atoms/RetailersList/RetailersList.stories.js +33 -0
- package/src/components/atoms/RetailersList/index.js +20 -0
- package/src/components/atoms/RetailersList/styles.js +19 -0
- package/src/components/atoms/UserCatalog/UserCatalog.stories.js +66 -0
- package/src/components/atoms/UserCatalog/index.js +77 -0
- package/src/components/atoms/UserCatalog/styles.js +24 -0
- package/src/components/atoms/UserOption/UserOption.stories.js +25 -0
- package/src/components/atoms/UserOption/index.js +49 -0
- package/src/components/atoms/UserOption/styles.js +54 -0
- package/src/components/atoms/UserSelector/UserSelector.stories.js +25 -0
- package/src/components/atoms/UserSelector/index.js +70 -0
- package/src/components/atoms/UserSelector/styles.js +55 -0
- package/src/components/molecules/GridItem/GridItem.stories.js +126 -0
- package/src/components/molecules/GridItem/index.js +82 -0
- package/src/components/molecules/GridItem/styles.js +85 -0
- package/src/components/molecules/HeaderItem/ColumnItem.js +9 -0
- package/src/components/molecules/HeaderItem/HeaderItem.stories.js +24 -0
- package/src/components/molecules/HeaderItem/index.js +26 -0
- package/src/components/molecules/HeaderItem/styles.js +25 -0
- package/src/components/molecules/RowItem/ColumnItem.js +9 -0
- package/src/components/molecules/RowItem/RowItem.stories.js +5660 -0
- package/src/components/molecules/RowItem/index.js +45 -0
- package/src/components/molecules/RowItem/styles.js +38 -0
- package/src/components/organisms/GridProducts/GridProducts.stories.js +5474 -0
- package/src/components/organisms/GridProducts/index.js +59 -0
- package/src/components/organisms/GridProducts/styles.js +15 -0
- package/src/components/organisms/GridProducts/utils.js +103 -0
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +39 -21
- package/src/components/pages/RetailerProductEdition/index.js +12 -0
- package/src/index.js +8 -0
- package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { UserCatalog } from ".";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/atoms/UserCatalog",
|
|
5
|
+
component: UserCatalog,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = (args) => <UserCatalog {...args} />;
|
|
9
|
+
export const UserCatalogDefault = Template.bind({});
|
|
10
|
+
UserCatalogDefault.args = {
|
|
11
|
+
datasheet: 54,
|
|
12
|
+
description: 54,
|
|
13
|
+
images: 55,
|
|
14
|
+
auditor: 37,
|
|
15
|
+
auditors: [
|
|
16
|
+
{
|
|
17
|
+
name: "José",
|
|
18
|
+
last_name: "Castañeda",
|
|
19
|
+
id_user: 37,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "Eduardo ",
|
|
23
|
+
last_name: " Reyes",
|
|
24
|
+
id_user: 195,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
textSpecialists: [
|
|
28
|
+
{
|
|
29
|
+
name: "Especialista",
|
|
30
|
+
last_name: "Textos",
|
|
31
|
+
id_user: 36,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "ESPECIALISTA TXTS PRUEBA",
|
|
35
|
+
last_name: "",
|
|
36
|
+
id_user: 54,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "Gerson",
|
|
40
|
+
last_name: "Martínez",
|
|
41
|
+
id_user: 57,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "Angel",
|
|
45
|
+
last_name: "Perea",
|
|
46
|
+
id_user: 232,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
imagesSpecialists: [
|
|
50
|
+
{
|
|
51
|
+
name: "Especialista",
|
|
52
|
+
last_name: "Imágenes",
|
|
53
|
+
id_user: 35,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "ESPECIALISTA ED PRUEBA",
|
|
57
|
+
last_name: "",
|
|
58
|
+
id_user: 55,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "Uriel",
|
|
62
|
+
last_name: "Herrera",
|
|
63
|
+
id_user: 196,
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Container } from "./styles";
|
|
2
|
+
import { Avatar } from "../Avatar";
|
|
3
|
+
import { getProfilePicture } from "../../../global-files/data";
|
|
4
|
+
import { UserOption } from "../UserOption";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { useCloseModal } from "../../../global-files/customHooks";
|
|
7
|
+
import { useEffect } from "react";
|
|
8
|
+
|
|
9
|
+
export const UserCatalog = ({
|
|
10
|
+
datasheet,
|
|
11
|
+
description,
|
|
12
|
+
images,
|
|
13
|
+
auditor,
|
|
14
|
+
auditors = [],
|
|
15
|
+
textSpecialists = [],
|
|
16
|
+
imagesSpecialists = [],
|
|
17
|
+
id = "list-modal",
|
|
18
|
+
}) => {
|
|
19
|
+
const [showList, setShowList] = useCloseModal(id);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Container onClick={() => setShowList(true)} id={id}>
|
|
23
|
+
{datasheet && (
|
|
24
|
+
<Avatar
|
|
25
|
+
image={getProfilePicture(datasheet, 26, 26)}
|
|
26
|
+
altText={"datasheet specialist"}
|
|
27
|
+
imageType={"medium-image"}
|
|
28
|
+
/>
|
|
29
|
+
)}
|
|
30
|
+
{description && (
|
|
31
|
+
<Avatar
|
|
32
|
+
image={getProfilePicture(description, 26, 26)}
|
|
33
|
+
altText={"description specialist"}
|
|
34
|
+
imageType={"medium-image"}
|
|
35
|
+
/>
|
|
36
|
+
)}
|
|
37
|
+
{images && (
|
|
38
|
+
<Avatar
|
|
39
|
+
image={getProfilePicture(images, 26, 26)}
|
|
40
|
+
altText={"images specialist"}
|
|
41
|
+
imageType={"medium-image"}
|
|
42
|
+
/>
|
|
43
|
+
)}
|
|
44
|
+
{auditor && (
|
|
45
|
+
<Avatar
|
|
46
|
+
image={getProfilePicture(auditor, 26, 26)}
|
|
47
|
+
altText={"auditor"}
|
|
48
|
+
imageType={"medium-image"}
|
|
49
|
+
/>
|
|
50
|
+
)}
|
|
51
|
+
{showList && (
|
|
52
|
+
<div className="users-assigned-list">
|
|
53
|
+
<UserOption
|
|
54
|
+
userId={datasheet}
|
|
55
|
+
usersArray={textSpecialists}
|
|
56
|
+
id={id + "-" + datasheet}
|
|
57
|
+
/>
|
|
58
|
+
<UserOption
|
|
59
|
+
userId={description}
|
|
60
|
+
usersArray={textSpecialists}
|
|
61
|
+
id={id + "-" + description}
|
|
62
|
+
/>
|
|
63
|
+
<UserOption
|
|
64
|
+
userId={images}
|
|
65
|
+
usersArray={imagesSpecialists}
|
|
66
|
+
id={id + "-" + images}
|
|
67
|
+
/>
|
|
68
|
+
<UserOption
|
|
69
|
+
userId={auditor}
|
|
70
|
+
usersArray={auditors}
|
|
71
|
+
id={id + "-" + auditor}
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
)}
|
|
75
|
+
</Container>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export const Container = styled.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
position: relative;
|
|
10
|
+
|
|
11
|
+
.users-assigned-list {
|
|
12
|
+
background-color: white;
|
|
13
|
+
padding: 10px;
|
|
14
|
+
box-shadow: 0px 2px 4px #00000040;
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 100%;
|
|
17
|
+
left: 0;
|
|
18
|
+
z-index: 400;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
> * + * {
|
|
22
|
+
margin-left: -10px;
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { UserOption } from ".";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/atoms/UserOption",
|
|
5
|
+
component: UserOption,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = (args) => <UserOption {...args} />;
|
|
9
|
+
export const UserOptionDefault = Template.bind({});
|
|
10
|
+
UserOptionDefault.args = {
|
|
11
|
+
userId: 37,
|
|
12
|
+
index: "datasheet",
|
|
13
|
+
usersArray: [
|
|
14
|
+
{
|
|
15
|
+
name: "José",
|
|
16
|
+
last_name: "Castañeda",
|
|
17
|
+
id_user: 37,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "Eduardo ",
|
|
21
|
+
last_name: " Reyes",
|
|
22
|
+
id_user: 195,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Container } from "./styles";
|
|
2
|
+
import { Avatar } from "../Avatar";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
import { getProfilePicture } from "../../../global-files/data";
|
|
6
|
+
import { servicesCodeIcon } from "../../organisms/OrderDetail/utils/Table/utils";
|
|
7
|
+
import { UserSelector } from "../UserSelector";
|
|
8
|
+
import { useCloseModal } from "../../../global-files/customHooks";
|
|
9
|
+
|
|
10
|
+
export const UserOption = ({ userId, index, usersArray, id }) => {
|
|
11
|
+
const [userAssigned, setUserAssigned] = useState({});
|
|
12
|
+
const [showSelector, setShowSelector] = useCloseModal(id);
|
|
13
|
+
const icons = servicesCodeIcon;
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (usersArray) {
|
|
17
|
+
usersArray.forEach((user) => {
|
|
18
|
+
if (user.id_user === userId) {
|
|
19
|
+
setUserAssigned(user);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}, [userId, usersArray]);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Container onClick={() => setShowSelector(true)}>
|
|
27
|
+
<div className="image-and-name">
|
|
28
|
+
<Avatar
|
|
29
|
+
image={getProfilePicture(userAssigned?.id_user, 26, 26)}
|
|
30
|
+
altText={"datasheet specialist"}
|
|
31
|
+
imageType={"medium-image"}
|
|
32
|
+
/>
|
|
33
|
+
<p>
|
|
34
|
+
{userAssigned?.name} {userAssigned?.last_name}
|
|
35
|
+
</p>
|
|
36
|
+
</div>
|
|
37
|
+
<div className="icon-container">{icons[index]}</div>
|
|
38
|
+
{showSelector && (
|
|
39
|
+
<UserSelector
|
|
40
|
+
id={id}
|
|
41
|
+
searchLabel="Buscar Usuario"
|
|
42
|
+
index={index}
|
|
43
|
+
usersArray={usersArray}
|
|
44
|
+
position="absolute"
|
|
45
|
+
/>
|
|
46
|
+
)}
|
|
47
|
+
</Container>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { FontFamily } from "../../../global-files/variables";
|
|
3
|
+
|
|
4
|
+
export const Container = styled.div`
|
|
5
|
+
border: 1px solid #f0f0f0;
|
|
6
|
+
border-radius: 5px;
|
|
7
|
+
color: #262626;
|
|
8
|
+
font-size: 12px;
|
|
9
|
+
font-family: ${FontFamily.Lato};
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
padding: 5px 10px;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
position: relative;
|
|
16
|
+
background-color: white;
|
|
17
|
+
width: 217px;
|
|
18
|
+
|
|
19
|
+
.image-and-name {
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
|
|
23
|
+
div + p {
|
|
24
|
+
margin-left: 10px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.icon-container {
|
|
29
|
+
position: relative;
|
|
30
|
+
span {
|
|
31
|
+
color: #808080;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
|
|
34
|
+
& + span {
|
|
35
|
+
display: none;
|
|
36
|
+
position: absolute;
|
|
37
|
+
right: 120%;
|
|
38
|
+
top: 50%;
|
|
39
|
+
transform: translateY(-50%);
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:hover {
|
|
44
|
+
& + span {
|
|
45
|
+
display: block;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
& + * {
|
|
52
|
+
margin-top: 5px;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { UserSelector } from ".";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/atoms/UserSelector",
|
|
5
|
+
component: UserSelector,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = (args) => <UserSelector {...args} />;
|
|
9
|
+
export const UserSelectorDefault = Template.bind({});
|
|
10
|
+
UserSelectorDefault.args = {
|
|
11
|
+
searchLabel: "Buscar auditor",
|
|
12
|
+
index: "auditor",
|
|
13
|
+
usersArray: [
|
|
14
|
+
{
|
|
15
|
+
name: "José",
|
|
16
|
+
last_name: "Castañeda",
|
|
17
|
+
id_user: 37,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "Eduardo ",
|
|
21
|
+
last_name: " Reyes",
|
|
22
|
+
id_user: 195,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Container } from "./styles";
|
|
2
|
+
import { faSearch } from "@fortawesome/free-solid-svg-icons";
|
|
3
|
+
import { FontAwesomeIcon as Icon } from "@fortawesome/react-fontawesome";
|
|
4
|
+
import { Avatar } from "../Avatar";
|
|
5
|
+
import { getProfilePicture } from "../../../global-files/data";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
import { useEffect } from "react";
|
|
8
|
+
|
|
9
|
+
export const UserSelector = ({
|
|
10
|
+
searchLabel,
|
|
11
|
+
index,
|
|
12
|
+
usersArray,
|
|
13
|
+
onClick,
|
|
14
|
+
position,
|
|
15
|
+
}) => {
|
|
16
|
+
const [text, setText] = useState([]);
|
|
17
|
+
const [userFiltered, setUsersFiltered] = useState([]);
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (usersArray) setUsersFiltered(usersArray);
|
|
21
|
+
}, [usersArray]);
|
|
22
|
+
|
|
23
|
+
const onChangeText = (e) => {
|
|
24
|
+
setText(e.target.value);
|
|
25
|
+
if (usersArray)
|
|
26
|
+
setUsersFiltered(
|
|
27
|
+
usersArray.filter((user) =>
|
|
28
|
+
(user.name + " " + user.last_name)
|
|
29
|
+
.toLowerCase()
|
|
30
|
+
.includes(e.target.value.toLowerCase())
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Container position={position}>
|
|
37
|
+
<div className="search-cotainer">
|
|
38
|
+
<Icon icon={faSearch} />
|
|
39
|
+
<input
|
|
40
|
+
type="text"
|
|
41
|
+
className="search"
|
|
42
|
+
placeholder={searchLabel}
|
|
43
|
+
value={text}
|
|
44
|
+
onChange={onChangeText}
|
|
45
|
+
autoFocus
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
<div className="selector-container">
|
|
49
|
+
{userFiltered.length ? (
|
|
50
|
+
userFiltered.map((user) => (
|
|
51
|
+
<div key={user.id_user} className="user-item" onClick={onClick}>
|
|
52
|
+
<Avatar
|
|
53
|
+
image={getProfilePicture(user.id_user, 26, 26)}
|
|
54
|
+
altText={"profile image"}
|
|
55
|
+
imageType={"medium-image"}
|
|
56
|
+
/>
|
|
57
|
+
<p>
|
|
58
|
+
{user.name} {user.last_name}
|
|
59
|
+
</p>
|
|
60
|
+
</div>
|
|
61
|
+
))
|
|
62
|
+
) : (
|
|
63
|
+
<div>
|
|
64
|
+
<p>Sin usuarios para asignar</p>
|
|
65
|
+
</div>
|
|
66
|
+
)}
|
|
67
|
+
</div>
|
|
68
|
+
</Container>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { FontFamily } from "../../../global-files/variables";
|
|
3
|
+
|
|
4
|
+
export const Container = styled.div`
|
|
5
|
+
box-shadow: 0px 2px 4px #00000040;
|
|
6
|
+
width: 197px;
|
|
7
|
+
border-radius: 5px;
|
|
8
|
+
position: ${({ position }) => (position ? position : "initial")};
|
|
9
|
+
top: ${({ position }) => (position ? "100%" : "initial")};
|
|
10
|
+
left: ${({ position }) => (position ? "50%" : "initial")};
|
|
11
|
+
transform: ${({ position }) => (position ? "translateX(-50%)" : "initial")};
|
|
12
|
+
z-index: 500;
|
|
13
|
+
background-color: white;
|
|
14
|
+
|
|
15
|
+
.search-cotainer {
|
|
16
|
+
display: flex;
|
|
17
|
+
padding-left: 10px;
|
|
18
|
+
align-items: center;
|
|
19
|
+
border-bottom: 1px solid #f0f0f0;
|
|
20
|
+
|
|
21
|
+
svg {
|
|
22
|
+
& + * {
|
|
23
|
+
margin-left: 10px;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
input {
|
|
28
|
+
border: none;
|
|
29
|
+
width: 100%;
|
|
30
|
+
padding: 10px;
|
|
31
|
+
outline: none;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.selector-container {
|
|
36
|
+
max-height: 184px;
|
|
37
|
+
overflow: auto;
|
|
38
|
+
.user-item {
|
|
39
|
+
display: flex;
|
|
40
|
+
font-family: ${FontFamily.Lato};
|
|
41
|
+
font-size: 12px;
|
|
42
|
+
align-items: center;
|
|
43
|
+
padding: 10px;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
background-color: #f0f0f0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
> * + * {
|
|
51
|
+
margin-left: 10px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { GridItem } from ".";
|
|
2
|
+
|
|
3
|
+
export default { title: "Components/molecules/GridItem", component: GridItem };
|
|
4
|
+
|
|
5
|
+
const Template = (args) => <GridItem {...args} />;
|
|
6
|
+
export const GridItemDefault = Template.bind({});
|
|
7
|
+
GridItemDefault.args = {
|
|
8
|
+
article: {
|
|
9
|
+
services: {
|
|
10
|
+
datasheets: 1,
|
|
11
|
+
descriptions: 1,
|
|
12
|
+
images: 1,
|
|
13
|
+
},
|
|
14
|
+
orderId: 15254,
|
|
15
|
+
status: "Ex",
|
|
16
|
+
datasheet_status: "Ex",
|
|
17
|
+
prio: "none",
|
|
18
|
+
version: 15,
|
|
19
|
+
description_status: "Ex",
|
|
20
|
+
images_status: "Ex",
|
|
21
|
+
statusByRetailer: {
|
|
22
|
+
70: {
|
|
23
|
+
datasheet: "Ex",
|
|
24
|
+
description: "Ex",
|
|
25
|
+
images: "Ex",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
id_article: 38443,
|
|
29
|
+
id_category: "4319",
|
|
30
|
+
name: "Im Polvo Compacto Natural 2",
|
|
31
|
+
upc: "7501611823017",
|
|
32
|
+
timestamp: "2023-03-15T05:54:54.000Z",
|
|
33
|
+
id_user: 133,
|
|
34
|
+
status: "Ex",
|
|
35
|
+
active: 1,
|
|
36
|
+
company_id: 912,
|
|
37
|
+
company_name: "GRUPO BRAHMA",
|
|
38
|
+
country: "México",
|
|
39
|
+
id_order: 15254,
|
|
40
|
+
id_datasheet_especialist: 1841,
|
|
41
|
+
id_datasheet_facilitator: null,
|
|
42
|
+
id_description_especialist: 509,
|
|
43
|
+
id_description_facilitator: null,
|
|
44
|
+
id_images_especialist: 289,
|
|
45
|
+
id_images_facilitator: 160,
|
|
46
|
+
id_auditor: 493,
|
|
47
|
+
id_recepcionist: null,
|
|
48
|
+
category: "Salud y Belleza|Cosméticos|Cosméticos",
|
|
49
|
+
missingAttributes: 0,
|
|
50
|
+
missingDescriptions: 0,
|
|
51
|
+
missingImages: 0,
|
|
52
|
+
retailers: [
|
|
53
|
+
{
|
|
54
|
+
id: 70,
|
|
55
|
+
name: "Bodega Aurrera",
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
country: "México",
|
|
59
|
+
upc: "7501611823017",
|
|
60
|
+
imageArray: [
|
|
61
|
+
{
|
|
62
|
+
id: 35596,
|
|
63
|
+
status: null,
|
|
64
|
+
image_id: 1,
|
|
65
|
+
packing_type: "3",
|
|
66
|
+
image_type: "1",
|
|
67
|
+
article_id: "38443",
|
|
68
|
+
src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMS1kNDQ2ZjIwNy0wYTkzLTQyNzgtYWZjNi01MTY2ZjIyY2EzNDMucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAwLCJoZWlnaHQiOjEwMDAsImZpdCI6ImNvbnRhaW4iLCJiYWNrZ3JvdW5kIjp7InIiOjI1NSwiZyI6MjU1LCJiIjoyNTUsImFscGhhIjoxfX19fQ==",
|
|
69
|
+
timestamp: "2023-05-30T03:01:12.000Z",
|
|
70
|
+
id_version: 15,
|
|
71
|
+
width: null,
|
|
72
|
+
height: null,
|
|
73
|
+
scene_type: null,
|
|
74
|
+
image_shot_type: null,
|
|
75
|
+
last_modified: "2023-06-05T23:49:49.000Z",
|
|
76
|
+
name: "Central (Frente Comercial)",
|
|
77
|
+
version: 15,
|
|
78
|
+
ext: "png",
|
|
79
|
+
uuid: "d446f207-0a93-4278-afc6-5166f22ca343",
|
|
80
|
+
srcDB: "id-38443/15/1-d446f207-0a93-4278-afc6-5166f22ca343.png",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: 35597,
|
|
84
|
+
status: null,
|
|
85
|
+
image_id: 3,
|
|
86
|
+
packing_type: "3",
|
|
87
|
+
image_type: "1",
|
|
88
|
+
article_id: "38443",
|
|
89
|
+
src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMy0yOTZkMzU3ZC00OTUzLTRiMzktYjFjMy04YWZmZDI2NDgwMWIucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAwLCJoZWlnaHQiOjEwMDAsImZpdCI6ImNvbnRhaW4iLCJiYWNrZ3JvdW5kIjp7InIiOjI1NSwiZyI6MjU1LCJiIjoyNTUsImFscGhhIjoxfX19fQ==",
|
|
90
|
+
timestamp: "2023-05-30T03:01:12.000Z",
|
|
91
|
+
id_version: 15,
|
|
92
|
+
width: null,
|
|
93
|
+
height: null,
|
|
94
|
+
scene_type: null,
|
|
95
|
+
image_shot_type: null,
|
|
96
|
+
last_modified: "2023-06-05T23:49:49.000Z",
|
|
97
|
+
name: "Trasera (Back)",
|
|
98
|
+
version: 15,
|
|
99
|
+
ext: "png",
|
|
100
|
+
uuid: "296d357d-4953-4b39-b1c3-8affd264801b",
|
|
101
|
+
srcDB: "id-38443/15/3-296d357d-4953-4b39-b1c3-8affd264801b.png",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: 35598,
|
|
105
|
+
status: null,
|
|
106
|
+
image_id: 16,
|
|
107
|
+
packing_type: "3",
|
|
108
|
+
image_type: "1",
|
|
109
|
+
article_id: "38443",
|
|
110
|
+
src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMTYtOGMzNDIzM2YtZTRiMC00MjU0LWFlYzUtZjEyN2ZiYjhkYmVkLnBuZyIsImVkaXRzIjp7InJlc2l6ZSI6eyJ3aWR0aCI6MTAwMCwiaGVpZ2h0IjoxMDAwLCJmaXQiOiJjb250YWluIiwiYmFja2dyb3VuZCI6eyJyIjoyNTUsImciOjI1NSwiYiI6MjU1LCJhbHBoYSI6MX19fX0=",
|
|
111
|
+
timestamp: "2023-05-30T03:01:12.000Z",
|
|
112
|
+
id_version: 15,
|
|
113
|
+
width: null,
|
|
114
|
+
height: null,
|
|
115
|
+
scene_type: null,
|
|
116
|
+
image_shot_type: null,
|
|
117
|
+
last_modified: "2023-06-05T23:49:49.000Z",
|
|
118
|
+
name: "Detalle / Características 1",
|
|
119
|
+
version: 15,
|
|
120
|
+
ext: "png",
|
|
121
|
+
uuid: "8c34233f-e4b0-4254-aec5-f127fbb8dbed",
|
|
122
|
+
srcDB: "id-38443/15/16-8c34233f-e4b0-4254-aec5-f127fbb8dbed.png",
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Container } from "./styles";
|
|
2
|
+
import { ImageCarousel } from "../../atoms/ImageCarousel";
|
|
3
|
+
import { Status } from "../../atoms/Status";
|
|
4
|
+
import { PercentTag } from "../../atoms/PercentTag";
|
|
5
|
+
import { ButtonV2 } from "../../atoms/ButtonV2";
|
|
6
|
+
import { faStar as starIcon } from "@fortawesome/free-regular-svg-icons";
|
|
7
|
+
import { faCartPlus as cartIcon } from "@fortawesome/free-solid-svg-icons";
|
|
8
|
+
import { RatingStars } from "../../atoms/RatingStars";
|
|
9
|
+
import { CheckBox } from "../../atoms/CheckBox";
|
|
10
|
+
|
|
11
|
+
export const GridItem = ({
|
|
12
|
+
gridElement = {},
|
|
13
|
+
product,
|
|
14
|
+
id,
|
|
15
|
+
isMerchans,
|
|
16
|
+
chkOnChange,
|
|
17
|
+
onGridClick,
|
|
18
|
+
chkChecked,
|
|
19
|
+
}) => {
|
|
20
|
+
const { images = [], info = [], status = [], catalogs = {} } = gridElement;
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Container onClick={() => onGridClick && onGridClick(product)}>
|
|
24
|
+
<div className="chk-container" onClick={(e) => e.stopPropagation()}>
|
|
25
|
+
<CheckBox
|
|
26
|
+
id={id}
|
|
27
|
+
name={id}
|
|
28
|
+
className="chk-absolute"
|
|
29
|
+
onChange={(e) => chkOnChange && chkOnChange(e, product)}
|
|
30
|
+
defaultChecked={chkChecked && chkChecked(product)}
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
<ImageCarousel imageArray={images} />
|
|
34
|
+
<div className="data-body">
|
|
35
|
+
{info?.map((item, i) =>
|
|
36
|
+
i === 0 ? <h3 key={i}>{item.value}</h3> : <p key={i}>{item.value}</p>
|
|
37
|
+
)}
|
|
38
|
+
</div>
|
|
39
|
+
<div className="status-slider">
|
|
40
|
+
{status?.map((item) => (
|
|
41
|
+
<>
|
|
42
|
+
<Status statusType={item.value} />
|
|
43
|
+
<PercentTag percent={item.percent} progressBarType={item.value} />
|
|
44
|
+
</>
|
|
45
|
+
))}
|
|
46
|
+
</div>
|
|
47
|
+
{isMerchans ? (
|
|
48
|
+
<div className="cart-and-raiting">
|
|
49
|
+
<ButtonV2
|
|
50
|
+
borderType="circle"
|
|
51
|
+
type="whiteS2"
|
|
52
|
+
icon={starIcon}
|
|
53
|
+
size={10}
|
|
54
|
+
className="star-button"
|
|
55
|
+
/>
|
|
56
|
+
<ButtonV2
|
|
57
|
+
borderType="circle"
|
|
58
|
+
type="whiteS2"
|
|
59
|
+
icon={cartIcon}
|
|
60
|
+
size={10}
|
|
61
|
+
className="star-button"
|
|
62
|
+
/>
|
|
63
|
+
<ButtonV2
|
|
64
|
+
borderType="circle"
|
|
65
|
+
type="whiteS2"
|
|
66
|
+
icon={cartIcon}
|
|
67
|
+
size={10}
|
|
68
|
+
className="star-button"
|
|
69
|
+
/>
|
|
70
|
+
<RatingStars ratingValue={4} />
|
|
71
|
+
</div>
|
|
72
|
+
) : (
|
|
73
|
+
catalogs && (
|
|
74
|
+
<div className="retailers-and-user">
|
|
75
|
+
<div className="retailers-container">{catalogs.leftSide}</div>
|
|
76
|
+
<div className="users-container">{catalogs.rightSide}</div>
|
|
77
|
+
</div>
|
|
78
|
+
)
|
|
79
|
+
)}
|
|
80
|
+
</Container>
|
|
81
|
+
);
|
|
82
|
+
};
|