contentoh-components-library 21.3.28 → 21.3.30
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 +0 -3
- package/.env.production +3 -2
- package/dist/assets/images/generalButton/closeIcon.svg +2 -2
- package/dist/components/atoms/ProgressBar/index.js +6 -36
- package/dist/components/atoms/ProgressBar/styles.js +3 -11
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +22 -21
- package/dist/components/molecules/CustomSelect/SelectItem.js +1 -10
- package/dist/components/molecules/GalleryElement/index.js +1 -1
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/molecules/ProductNameHeader/index.js +4 -6
- package/dist/components/organisms/Chat/ContainerItems/index.js +13 -2
- package/dist/components/organisms/FullProductNameHeader/index.js +0 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +50 -65
- package/dist/components/pages/ProviderProductEdition/index.js +11 -17
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -73
- package/dist/components/pages/RetailerProductEdition/index.js +14 -19
- package/dist/components/pages/RetailerProductEdition/utils.js +1 -1
- package/dist/global-files/data.js +23 -18
- package/dist/global-files/fonts.css +0 -6
- package/dist/global-files/variables.js +0 -2
- package/dist/index.js +46 -267
- package/package.json +1 -13
- package/src/assets/images/generalButton/closeIcon.svg +2 -2
- package/src/components/atoms/ProgressBar/index.js +5 -40
- package/src/components/atoms/ProgressBar/styles.js +0 -24
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +12 -20
- package/src/components/molecules/CustomSelect/SelectItem.js +0 -7
- package/src/components/molecules/GalleryElement/index.js +1 -1
- package/src/components/molecules/HeaderTop/styles.js +2 -5
- package/src/components/molecules/ProductNameHeader/index.js +2 -7
- package/src/components/organisms/FullProductNameHeader/index.js +0 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +49 -67
- package/src/components/pages/ProviderProductEdition/index.js +9 -16
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -78
- package/src/components/pages/RetailerProductEdition/index.js +20 -18
- package/src/components/pages/RetailerProductEdition/utils.js +1 -2
- package/src/global-files/data.js +23 -18
- package/src/global-files/fonts.css +0 -6
- package/src/global-files/variables.js +0 -2
- package/src/index.js +0 -17
- package/src/assets/images/customSelect/starIcon.svg +0 -14
- package/src/assets/images/defaultImages/Spinner.gif +0 -0
- package/src/assets/images/defaultImages/notFound.svg +0 -124
- package/src/assets/sounds/newMessage.mp3 +0 -0
- package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -47
- package/src/components/atoms/ButtonFileChooser/index.js +0 -68
- package/src/components/atoms/ButtonFileChooser/styles.js +0 -4
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +0 -53
- package/src/components/atoms/ButtonV2/index.js +0 -85
- package/src/components/atoms/ButtonV2/styles.js +0 -217
- package/src/components/atoms/CustomIcon/CustomIcon.stories.js +0 -36
- package/src/components/atoms/CustomIcon/index.js +0 -41
- package/src/components/atoms/CustomIcon/styles.js +0 -85
- package/src/components/atoms/IconFile/IconFile.stories.js +0 -35
- package/src/components/atoms/IconFile/index.js +0 -119
- package/src/components/atoms/IconFile/styles.js +0 -67
- package/src/components/atoms/Image/Image.stories.js +0 -51
- package/src/components/atoms/Image/index.js +0 -55
- package/src/components/atoms/Image/styles.js +0 -34
- package/src/components/atoms/ImageLink/ImageLink.stories.js +0 -43
- package/src/components/atoms/ImageLink/index.js +0 -57
- package/src/components/atoms/ImageLink/styles.js +0 -30
- package/src/components/atoms/ImagePreview/ImagePreview.stories.js +0 -52
- package/src/components/atoms/ImagePreview/index.js +0 -178
- package/src/components/atoms/ImagePreview/styles.js +0 -77
- package/src/components/atoms/InputText/InputText.stories.js +0 -39
- package/src/components/atoms/InputText/index.js +0 -61
- package/src/components/atoms/InputText/styles.js +0 -89
- package/src/components/atoms/NotFound/NotFound.stories.js +0 -19
- package/src/components/atoms/NotFound/index.js +0 -52
- package/src/components/atoms/NotFound/styles.js +0 -55
- package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +0 -26
- package/src/components/atoms/SelectItemV2/index.js +0 -61
- package/src/components/atoms/SelectItemV2/styles.js +0 -90
- package/src/components/atoms/Tooltip/Tooltip.stories.js +0 -51
- package/src/components/atoms/Tooltip/index.js +0 -59
- package/src/components/atoms/Tooltip/styles.js +0 -42
- package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -54
- package/src/components/molecules/ButtonDownloadFile/index.js +0 -109
- package/src/components/molecules/ButtonDownloadFile/styles.js +0 -66
- package/src/components/molecules/Dropdown/Dropdown.stories.js +0 -103
- package/src/components/molecules/Dropdown/index.js +0 -150
- package/src/components/molecules/Dropdown/styles.js +0 -75
- package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -68
- package/src/components/molecules/ImageTooltip/index.js +0 -63
- package/src/components/molecules/ImageTooltip/styles.js +0 -18
- package/src/components/molecules/SelectV2/SelectV2.stories.js +0 -115
- package/src/components/molecules/SelectV2/index.js +0 -357
- package/src/components/molecules/SelectV2/styles.js +0 -105
- package/src/components/molecules/SelectV2/test.js +0 -60
- package/src/components/molecules/SelectV2/test.stories.js +0 -10
- package/src/components/organisms/Chat/Chat.stories.js +0 -149
- package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -65
- package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
- package/src/components/organisms/Chat/ChatLists/index.js +0 -141
- package/src/components/organisms/Chat/ChatLists/styles.js +0 -162
- package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -142
- package/src/components/organisms/Chat/ContainerItems/index.js +0 -513
- package/src/components/organisms/Chat/ContainerItems/styles.js +0 -348
- package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -102
- package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
- package/src/components/organisms/Chat/ContentChat/index.js +0 -922
- package/src/components/organisms/Chat/ContentChat/styles.js +0 -41
- package/src/components/organisms/Chat/Footer/Footer.stories.js +0 -22
- package/src/components/organisms/Chat/Footer/index.js +0 -661
- package/src/components/organisms/Chat/Footer/styles.js +0 -286
- package/src/components/organisms/Chat/Header/Header.stories.js +0 -66
- package/src/components/organisms/Chat/Header/index.js +0 -93
- package/src/components/organisms/Chat/Header/styles.js +0 -49
- package/src/components/organisms/Chat/index.js +0 -238
- package/src/components/organisms/Chat/styles.js +0 -42
- package/src/components/organisms/Modal/Modal.stories.js +0 -55
- package/src/components/organisms/Modal/index.js +0 -97
- package/src/components/organisms/Modal/styles.js +0 -103
- package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +0 -16
- package/src/components/organisms/RangeCalendar/index.js +0 -121
- package/src/components/organisms/RangeCalendar/styles.js +0 -883
- package/src/global-files/handle_http.js +0 -225
- package/src/global-files/handle_userTech.js +0 -7
- package/src/global-files/utils.js +0 -330
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { ButtonV2 } from "../../atoms/ButtonV2";
|
|
2
|
-
import { Dropdown } from "./index";
|
|
3
|
-
import {
|
|
4
|
-
faHeart as Icon1,
|
|
5
|
-
faHouse as Icon2,
|
|
6
|
-
faUser as Icon3,
|
|
7
|
-
} from "@fortawesome/free-solid-svg-icons";
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
title: "Components/molecules/Dropdown",
|
|
11
|
-
component: Dropdown,
|
|
12
|
-
argTypes: {
|
|
13
|
-
positionDropdown: {
|
|
14
|
-
options: [
|
|
15
|
-
undefined,
|
|
16
|
-
"topStart",
|
|
17
|
-
"topEnd",
|
|
18
|
-
"topCenter",
|
|
19
|
-
"rightStart",
|
|
20
|
-
"rightEnd",
|
|
21
|
-
"rightCenter",
|
|
22
|
-
"bottomStart",
|
|
23
|
-
"bottomEnd",
|
|
24
|
-
"bottomCenter",
|
|
25
|
-
"leftStart",
|
|
26
|
-
"leftEnd",
|
|
27
|
-
"leftCenter",
|
|
28
|
-
],
|
|
29
|
-
control: { type: "select" },
|
|
30
|
-
},
|
|
31
|
-
triggerType: {
|
|
32
|
-
options: [undefined, "hover", "click"],
|
|
33
|
-
control: { type: "select" },
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const Template = (args) => <Dropdown {...args} />;
|
|
39
|
-
|
|
40
|
-
export const DropdownTest = Template.bind({});
|
|
41
|
-
DropdownTest.args = {
|
|
42
|
-
items: [
|
|
43
|
-
{
|
|
44
|
-
label: "Palomitas de maiz",
|
|
45
|
-
//icon: Icon1,
|
|
46
|
-
disabled: true,
|
|
47
|
-
onClick: (event) => {
|
|
48
|
-
console.log("Palomitaz de maiz");
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
label: "Sabritas",
|
|
53
|
-
//icon: Icon2,
|
|
54
|
-
onClick: (event) => {
|
|
55
|
-
console.log("Sabritas");
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
label: "sabritas Doritos",
|
|
60
|
-
isLoading: true,
|
|
61
|
-
onClick: (event) => {
|
|
62
|
-
console.log("Sabritas Doritos");
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
label:
|
|
67
|
-
"Este es un texto muy largo que deberia llegar al limite establecido para el width",
|
|
68
|
-
//icon: Icon2,
|
|
69
|
-
onClick: (event) => {
|
|
70
|
-
console.log("texto largo de prueba");
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
label: "galletas",
|
|
75
|
-
icon: undefined,
|
|
76
|
-
onClick: (event) => {
|
|
77
|
-
console.log("galletas");
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
label: "jugo de uva",
|
|
82
|
-
//icon: Icon3,
|
|
83
|
-
onClick: (event) => {
|
|
84
|
-
console.log("jugo de uva");
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
triggerType: "click",
|
|
89
|
-
maxWidthDropdown: "200px",
|
|
90
|
-
maxHeightDropdown: "200px",
|
|
91
|
-
className: "dropdownPrueba",
|
|
92
|
-
classNameDropdown: "dropdownMenuPrueba",
|
|
93
|
-
positionDropdown: undefined,
|
|
94
|
-
children: (
|
|
95
|
-
<ButtonV2
|
|
96
|
-
className="buttonTrigger"
|
|
97
|
-
type={"white"}
|
|
98
|
-
size={14}
|
|
99
|
-
borderType={"oval"}
|
|
100
|
-
label={"boton trigger"}
|
|
101
|
-
/>
|
|
102
|
-
),
|
|
103
|
-
};
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from "react";
|
|
2
|
-
import {
|
|
3
|
-
ClickAwayListener,
|
|
4
|
-
Fade,
|
|
5
|
-
Grow,
|
|
6
|
-
Popper,
|
|
7
|
-
Tooltip as TooltipMUI,
|
|
8
|
-
Zoom,
|
|
9
|
-
} from "@mui/material";
|
|
10
|
-
import { Container } from "./styles";
|
|
11
|
-
import React from "react";
|
|
12
|
-
import { ButtonV2 } from "../../atoms/ButtonV2";
|
|
13
|
-
import { faCircle as IconDefault } from "@fortawesome/free-solid-svg-icons";
|
|
14
|
-
import { isArrayEmpty, isStringEmpty } from "../../../global-files/utils";
|
|
15
|
-
|
|
16
|
-
/* Este es un menu de opciones tipo select donde cada item
|
|
17
|
-
es un boton con su propio onClick */
|
|
18
|
-
export const Dropdown = (props) => {
|
|
19
|
-
const {
|
|
20
|
-
items /* [
|
|
21
|
-
{
|
|
22
|
-
label: string
|
|
23
|
-
icon: FontAwesomeIcon
|
|
24
|
-
disabled: boolean
|
|
25
|
-
isLoading: boolean
|
|
26
|
-
onClick: (event) => {}
|
|
27
|
-
} ,
|
|
28
|
-
...
|
|
29
|
-
] */,
|
|
30
|
-
triggerType, // (string) "hover" | "click"
|
|
31
|
-
children, // componente hijo activador del dropdown
|
|
32
|
-
maxWidthDropdown, // string
|
|
33
|
-
maxHeightDropdown, // string
|
|
34
|
-
className, // (string) clase del container select
|
|
35
|
-
classNameDropdown, // (string) clase del contenedor tooltip
|
|
36
|
-
positionDropdown, // (string) posicion del contenedor tooltip (values en object positions)
|
|
37
|
-
} = props;
|
|
38
|
-
const positions = {
|
|
39
|
-
topStart: "top-start",
|
|
40
|
-
topEnd: "top-end",
|
|
41
|
-
topCenter: "top",
|
|
42
|
-
|
|
43
|
-
rightStart: "right-start",
|
|
44
|
-
rightEnd: "right-end",
|
|
45
|
-
rightCenter: "right",
|
|
46
|
-
|
|
47
|
-
bottomStart: "bottom-start",
|
|
48
|
-
bottomEnd: "bottom-end",
|
|
49
|
-
bottomCenter: "bottom",
|
|
50
|
-
|
|
51
|
-
leftStart: "left-start",
|
|
52
|
-
leftEnd: "left-end",
|
|
53
|
-
leftCenter: "left",
|
|
54
|
-
};
|
|
55
|
-
const [showDropdown, setShowDropdown] = useState(false);
|
|
56
|
-
|
|
57
|
-
const renderItems = () => {
|
|
58
|
-
const customItems = [];
|
|
59
|
-
if (!isArrayEmpty(items)) {
|
|
60
|
-
const useIconDefault = items.some((item) => {
|
|
61
|
-
return item.icon ? true : false;
|
|
62
|
-
});
|
|
63
|
-
items.forEach((item, index) => {
|
|
64
|
-
customItems.push(
|
|
65
|
-
<ButtonV2
|
|
66
|
-
key={"item-" + index}
|
|
67
|
-
className={
|
|
68
|
-
"dropdownItem" +
|
|
69
|
-
(useIconDefault ? (item.icon ? "" : " iconDefault") : "")
|
|
70
|
-
}
|
|
71
|
-
type={"whiteS3"}
|
|
72
|
-
borderType={undefined}
|
|
73
|
-
size={12}
|
|
74
|
-
disabled={item.disabled}
|
|
75
|
-
isLoading={item.isLoading}
|
|
76
|
-
label={isStringEmpty(item.label) ? undefined : item.label}
|
|
77
|
-
icon={useIconDefault ? item.icon ?? IconDefault : undefined}
|
|
78
|
-
onClick={(event) => {
|
|
79
|
-
event.stopPropagation();
|
|
80
|
-
setTimeout(() => {
|
|
81
|
-
setShowDropdown(false);
|
|
82
|
-
item.onClick && item.onClick(event);
|
|
83
|
-
}, 200);
|
|
84
|
-
}}
|
|
85
|
-
/>
|
|
86
|
-
);
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
return customItems;
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
return (
|
|
93
|
-
<ClickAwayListener
|
|
94
|
-
onClickAway={(event) => {
|
|
95
|
-
if (triggerType !== "hover") setShowDropdown(false);
|
|
96
|
-
}}
|
|
97
|
-
>
|
|
98
|
-
<Container
|
|
99
|
-
className={!isStringEmpty(className) ? className : ""}
|
|
100
|
-
maxWidthDropdown={maxWidthDropdown}
|
|
101
|
-
maxHeightDropdown={maxHeightDropdown}
|
|
102
|
-
onMouseEnter={(event) => {
|
|
103
|
-
if (triggerType === "hover") {
|
|
104
|
-
setShowDropdown(true);
|
|
105
|
-
}
|
|
106
|
-
}}
|
|
107
|
-
onMouseLeave={(event) => {
|
|
108
|
-
if (triggerType === "hover") {
|
|
109
|
-
setShowDropdown(false);
|
|
110
|
-
}
|
|
111
|
-
}}
|
|
112
|
-
>
|
|
113
|
-
<TooltipMUI
|
|
114
|
-
placement={positions[positionDropdown] ?? positions.bottomStart}
|
|
115
|
-
open={showDropdown}
|
|
116
|
-
arrow={false}
|
|
117
|
-
componentsProps={{
|
|
118
|
-
tooltip: {
|
|
119
|
-
className:
|
|
120
|
-
"dropdownMenu" +
|
|
121
|
-
(isStringEmpty(classNameDropdown)
|
|
122
|
-
? ""
|
|
123
|
-
: " " + classNameDropdown),
|
|
124
|
-
},
|
|
125
|
-
popper: { disablePortal: true },
|
|
126
|
-
transition: { timeout: 300 },
|
|
127
|
-
}}
|
|
128
|
-
TransitionComponent={Fade}
|
|
129
|
-
enterDelay={100}
|
|
130
|
-
followCursor={false}
|
|
131
|
-
disableFocusListener
|
|
132
|
-
disableTouchListener
|
|
133
|
-
disableHoverListener
|
|
134
|
-
title={<>{renderItems()}</>}
|
|
135
|
-
>
|
|
136
|
-
<div
|
|
137
|
-
className="containerIntern"
|
|
138
|
-
onClick={(event) => {
|
|
139
|
-
if (triggerType !== "hover") {
|
|
140
|
-
setShowDropdown(!showDropdown);
|
|
141
|
-
}
|
|
142
|
-
}}
|
|
143
|
-
>
|
|
144
|
-
{children}
|
|
145
|
-
</div>
|
|
146
|
-
</TooltipMUI>
|
|
147
|
-
</Container>
|
|
148
|
-
</ClickAwayListener>
|
|
149
|
-
);
|
|
150
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { FontFamily } from "../../../global-files/variables";
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
|
|
4
|
-
export const Container = styled.div`
|
|
5
|
-
width: fit-content;
|
|
6
|
-
|
|
7
|
-
.containerIntern {
|
|
8
|
-
width: inherit;
|
|
9
|
-
border: inherit;
|
|
10
|
-
border-radius: inherit;
|
|
11
|
-
|
|
12
|
-
> * {
|
|
13
|
-
width: inherit;
|
|
14
|
-
border: inherit;
|
|
15
|
-
border-radius: inherit;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
> .MuiTooltip-popper {
|
|
20
|
-
background-color: transparent;
|
|
21
|
-
|
|
22
|
-
.dropdownMenu {
|
|
23
|
-
--background: white;
|
|
24
|
-
box-shadow: 0px 0px 10px 1px gray;
|
|
25
|
-
background-color: var(--background);
|
|
26
|
-
padding: 0px 0px;
|
|
27
|
-
border-radius: 7px;
|
|
28
|
-
display: flex;
|
|
29
|
-
flex-direction: column;
|
|
30
|
-
gap: 0px;
|
|
31
|
-
overflow: auto;
|
|
32
|
-
max-width: ${({ maxWidthDropdown }) =>
|
|
33
|
-
maxWidthDropdown ? maxWidthDropdown : "400px"};
|
|
34
|
-
max-height: ${({ maxHeightDropdown }) =>
|
|
35
|
-
maxHeightDropdown ? maxHeightDropdown : "80vh"};
|
|
36
|
-
|
|
37
|
-
.dropdownItem {
|
|
38
|
-
width: 100%;
|
|
39
|
-
border-radius: 0px;
|
|
40
|
-
border: none;
|
|
41
|
-
|
|
42
|
-
.button {
|
|
43
|
-
justify-content: flex-start;
|
|
44
|
-
border: inherit;
|
|
45
|
-
text-align: left;
|
|
46
|
-
font-family: ${FontFamily.RobotoRegular};
|
|
47
|
-
padding: 10px;
|
|
48
|
-
gap: 11px;
|
|
49
|
-
|
|
50
|
-
.icon {
|
|
51
|
-
font-size: calc(var(--size) + 1px);
|
|
52
|
-
opacity: 0.75;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&.iconDefault .button .icon {
|
|
57
|
-
opacity: 0;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&[data-popper-placement*="bottom"] .dropdownMenu {
|
|
63
|
-
margin-top: 10px;
|
|
64
|
-
}
|
|
65
|
-
&[data-popper-placement*="top"] .dropdownMenu {
|
|
66
|
-
margin-bottom: 10px;
|
|
67
|
-
}
|
|
68
|
-
&[data-popper-placement*="left"] .dropdownMenu {
|
|
69
|
-
margin-right: 10px;
|
|
70
|
-
}
|
|
71
|
-
&[data-popper-placement*="right"] .dropdownMenu {
|
|
72
|
-
margin-left: 10px;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
`;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { ImageTooltip } from "./index";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "Components/molecules/ImageTooltip",
|
|
5
|
-
component: ImageTooltip,
|
|
6
|
-
argTypes: {
|
|
7
|
-
position: {
|
|
8
|
-
options: [
|
|
9
|
-
undefined,
|
|
10
|
-
"topStart",
|
|
11
|
-
"topEnd",
|
|
12
|
-
"topCenter",
|
|
13
|
-
"rightStart",
|
|
14
|
-
"rightEnd",
|
|
15
|
-
"rightCenter",
|
|
16
|
-
"bottomStart",
|
|
17
|
-
"bottomEnd",
|
|
18
|
-
"bottomCenter",
|
|
19
|
-
"leftStart",
|
|
20
|
-
"leftEnd",
|
|
21
|
-
"leftCenter",
|
|
22
|
-
],
|
|
23
|
-
control: { type: "select" },
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const Template = (args) => <ImageTooltip {...args} />;
|
|
29
|
-
|
|
30
|
-
const keyS3_test =
|
|
31
|
-
"84300/1/chat/playa-213f791b-d890-48e1-be19-28bf5a95d517.jpeg";
|
|
32
|
-
const srcTest = `https://content-management-images.s3.amazonaws.com/${keyS3_test}`;
|
|
33
|
-
export const ImageTooltipTest = Template.bind({});
|
|
34
|
-
ImageTooltipTest.args = {
|
|
35
|
-
width: "200px",
|
|
36
|
-
sizeLoading: "50",
|
|
37
|
-
colorLoading: "#bbbbbb",
|
|
38
|
-
src: "bn",
|
|
39
|
-
componentDefault: <label>test error</label>,
|
|
40
|
-
componentTooltip: <label> mensaje del tooltip test </label>,
|
|
41
|
-
position: undefined,
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const keyS3_OK =
|
|
45
|
-
"84300/1/chat/f6579ed5-16e5-48d8-ace5-6be8e8e68f53-38896acf-9179-4686-9088-9784df624ab8.png";
|
|
46
|
-
const srcOK = `https://content-management-images.s3.amazonaws.com/${keyS3_OK}`;
|
|
47
|
-
export const ImageTooltipOK = Template.bind({});
|
|
48
|
-
ImageTooltipOK.args = {
|
|
49
|
-
width: "250px",
|
|
50
|
-
sizeLoading: "40",
|
|
51
|
-
src: srcOK,
|
|
52
|
-
componentDefault: <label> img no cargada </label>,
|
|
53
|
-
componentTooltip: <label> mensaje del tooltip OK </label>,
|
|
54
|
-
position: undefined,
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const keyS3_ERROR =
|
|
58
|
-
"84300/1/chat/21dba1da-3c60-42c4-97bd-033664808256-fb19ff57-b91c-4ef2-ba2a-d857b55fb33b.svg";
|
|
59
|
-
const srcERROR = `https://content-management-images.s3.amazonaws.com/${keyS3_ERROR}`;
|
|
60
|
-
export const ImageTooltipERROR = Template.bind({});
|
|
61
|
-
ImageTooltipERROR.args = {
|
|
62
|
-
width: "300px",
|
|
63
|
-
sizeLoading: "60",
|
|
64
|
-
src: srcERROR,
|
|
65
|
-
componentDefault: <label> ERROR al cargar </label>,
|
|
66
|
-
componentTooltip: <label> mensaje del tooltip ERROR </label>,
|
|
67
|
-
position: undefined,
|
|
68
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Container, ContainerLoading, Img } from "./styles";
|
|
2
|
-
import { FontAwesomeIcon as Icon } from "@fortawesome/react-fontawesome";
|
|
3
|
-
import { faSpinner as iconLoading } from "@fortawesome/free-solid-svg-icons";
|
|
4
|
-
import { useState, useEffect } from "react";
|
|
5
|
-
import { Tooltip } from "../../atoms/Tooltip";
|
|
6
|
-
|
|
7
|
-
export const ImageTooltip = (props) => {
|
|
8
|
-
const {
|
|
9
|
-
className, // string
|
|
10
|
-
width, // string
|
|
11
|
-
sizeLoading, // number
|
|
12
|
-
colorLoading, // string
|
|
13
|
-
classNameLoading, // string
|
|
14
|
-
src, // imagen a cargar (string)
|
|
15
|
-
componentDefault, // componente a mostrar en caso de que no cargue src (JSX)
|
|
16
|
-
classNameImg, // string
|
|
17
|
-
classNameTooltip,
|
|
18
|
-
componentTooltip,
|
|
19
|
-
position, // (string) posicion del contenedor tooltip (values en object positions)
|
|
20
|
-
} = props;
|
|
21
|
-
const [imgLoad, setImgLoad] = useState();
|
|
22
|
-
const [loading, setLoading] = useState(false);
|
|
23
|
-
|
|
24
|
-
/* solo para hacer pruebas en modo dev
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
setTimeout(() => {
|
|
27
|
-
setLoading(false);
|
|
28
|
-
}, 5000);
|
|
29
|
-
}, []);
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<Tooltip
|
|
34
|
-
position={position ?? "topCenter"}
|
|
35
|
-
addArrow={false}
|
|
36
|
-
transitionType={"zoom"}
|
|
37
|
-
followCursor={false}
|
|
38
|
-
className={className}
|
|
39
|
-
classNameTooltip={classNameTooltip}
|
|
40
|
-
componentTooltip={imgLoad !== undefined && !loading && componentTooltip}
|
|
41
|
-
>
|
|
42
|
-
{src && (imgLoad === undefined || loading) && (
|
|
43
|
-
<ContainerLoading
|
|
44
|
-
className={classNameLoading}
|
|
45
|
-
sizeLoading={sizeLoading}
|
|
46
|
-
colorLoading={colorLoading}
|
|
47
|
-
>
|
|
48
|
-
<Icon pulse icon={iconLoading} />
|
|
49
|
-
</ContainerLoading>
|
|
50
|
-
)}
|
|
51
|
-
|
|
52
|
-
{(!src || (imgLoad === false && !loading)) && componentDefault}
|
|
53
|
-
|
|
54
|
-
<Img
|
|
55
|
-
className={classNameImg}
|
|
56
|
-
src={src}
|
|
57
|
-
onLoad={(event) => setImgLoad(true)}
|
|
58
|
-
onError={(event) => setImgLoad(false)}
|
|
59
|
-
show={imgLoad === true && !loading}
|
|
60
|
-
/>
|
|
61
|
-
</Tooltip>
|
|
62
|
-
);
|
|
63
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { GlobalColors, FontFamily } from "../../../global-files/variables";
|
|
3
|
-
|
|
4
|
-
export const ContainerLoading = styled.div`
|
|
5
|
-
width: 100%;
|
|
6
|
-
display: grid;
|
|
7
|
-
place-items: center;
|
|
8
|
-
min-width: min-content;
|
|
9
|
-
font-size: ${({ sizeLoading }) => (sizeLoading ? sizeLoading : "30")}px;
|
|
10
|
-
color: ${({ colorLoading }) => (colorLoading ? colorLoading : "#9e2674")};
|
|
11
|
-
padding: 5px;
|
|
12
|
-
`;
|
|
13
|
-
|
|
14
|
-
export const Img = styled.img`
|
|
15
|
-
display: ${({ show }) => (show ? "grid" : "none")};
|
|
16
|
-
width: 100%;
|
|
17
|
-
object-fit: contain;
|
|
18
|
-
`;
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { SelectV2 } from "./index";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "Components/molecules/SelectV2",
|
|
5
|
-
component: SelectV2,
|
|
6
|
-
argTypes: {
|
|
7
|
-
positionDropdown: {
|
|
8
|
-
options: [
|
|
9
|
-
undefined,
|
|
10
|
-
"topStart",
|
|
11
|
-
"topEnd",
|
|
12
|
-
"topCenter",
|
|
13
|
-
"rightStart",
|
|
14
|
-
"rightEnd",
|
|
15
|
-
"rightCenter",
|
|
16
|
-
"bottomStart",
|
|
17
|
-
"bottomEnd",
|
|
18
|
-
"bottomCenter",
|
|
19
|
-
"leftStart",
|
|
20
|
-
"leftEnd",
|
|
21
|
-
"leftCenter",
|
|
22
|
-
],
|
|
23
|
-
control: { type: "select" },
|
|
24
|
-
},
|
|
25
|
-
triggerType: {
|
|
26
|
-
options: [undefined, "hover", "click"],
|
|
27
|
-
control: { type: "select" },
|
|
28
|
-
},
|
|
29
|
-
typeSelectItems: {
|
|
30
|
-
options: [undefined, "checkbox", "marginCheckbox", "labelOnly"],
|
|
31
|
-
control: { type: "select" },
|
|
32
|
-
},
|
|
33
|
-
borderType: {
|
|
34
|
-
options: [undefined, "rectangle", "oval"],
|
|
35
|
-
control: { type: "select" },
|
|
36
|
-
},
|
|
37
|
-
alignmentItemsOverflow: {
|
|
38
|
-
options: [undefined, "columns", "rows"],
|
|
39
|
-
control: { type: "select" },
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const Template = (args) => <SelectV2 {...args} />;
|
|
45
|
-
|
|
46
|
-
export const SelectV2Test = Template.bind({});
|
|
47
|
-
SelectV2Test.args = {
|
|
48
|
-
items: [
|
|
49
|
-
{
|
|
50
|
-
label: "Palomitas de maiz",
|
|
51
|
-
value: 1,
|
|
52
|
-
selected: false,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
label: "Sabritas",
|
|
56
|
-
value: 2,
|
|
57
|
-
selected: true,
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
label: "sabritas Doritos",
|
|
61
|
-
value: 3,
|
|
62
|
-
selected: false,
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
label:
|
|
66
|
-
"Este es un texto muy largo que deberia llegar al limite establecido para el width",
|
|
67
|
-
value: 4,
|
|
68
|
-
selected: true,
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
label: "galletas",
|
|
72
|
-
value: 5,
|
|
73
|
-
selected: false,
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
label: "jugo de uva",
|
|
77
|
-
value: 6,
|
|
78
|
-
selected: false,
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
triggerType: "hover",
|
|
82
|
-
selectButton: {
|
|
83
|
-
className: "btnSelectPrueba",
|
|
84
|
-
type: "whiteS3",
|
|
85
|
-
transparent: undefined,
|
|
86
|
-
disabled: false,
|
|
87
|
-
label: "select de prueba",
|
|
88
|
-
size: 12,
|
|
89
|
-
borderType: "oval",
|
|
90
|
-
iconPosition: "left",
|
|
91
|
-
},
|
|
92
|
-
defaultItem: {
|
|
93
|
-
label: "Ningun filtro",
|
|
94
|
-
itemType: undefined,
|
|
95
|
-
showLabelInSelect: true,
|
|
96
|
-
},
|
|
97
|
-
inputSearch: {
|
|
98
|
-
className: "inputBusqueda",
|
|
99
|
-
defaultText: "hola",
|
|
100
|
-
},
|
|
101
|
-
typeSelectItems: undefined,
|
|
102
|
-
borderType: undefined,
|
|
103
|
-
maxWidthSelect: "150px",
|
|
104
|
-
maxWidthDropdown: "300px",
|
|
105
|
-
maxHeightDropdown: "300px",
|
|
106
|
-
maxWidthItems: "100px",
|
|
107
|
-
alignmentItemsOverflow: undefined,
|
|
108
|
-
multiple: true,
|
|
109
|
-
classNameSelect: "selectPrueba",
|
|
110
|
-
classNameDropdown: "dropdownSelectPrueba",
|
|
111
|
-
positionDropdown: undefined,
|
|
112
|
-
onChange: (selectedItems) => {
|
|
113
|
-
console.log("selectedItems:", selectedItems);
|
|
114
|
-
},
|
|
115
|
-
};
|