contentoh-components-library 21.2.98 → 21.2.99

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 (88) hide show
  1. package/.env.development +0 -3
  2. package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +22 -21
  3. package/dist/components/molecules/CustomSelect/SelectItem.js +1 -10
  4. package/dist/components/molecules/HeaderTop/index.js +5 -10
  5. package/dist/components/molecules/HeaderTop/styles.js +1 -1
  6. package/dist/global-files/fonts.css +0 -12
  7. package/dist/global-files/variables.js +0 -2
  8. package/dist/index.js +46 -241
  9. package/package.json +1 -12
  10. package/src/components/molecules/CustomSelect/CustomSelect.stories.js +12 -20
  11. package/src/components/molecules/CustomSelect/SelectItem.js +0 -7
  12. package/src/components/molecules/HeaderTop/index.js +6 -11
  13. package/src/components/molecules/HeaderTop/styles.js +0 -4
  14. package/src/global-files/fonts.css +0 -12
  15. package/src/global-files/variables.js +0 -2
  16. package/src/index.js +0 -15
  17. package/src/assets/images/customSelect/starIcon.svg +0 -14
  18. package/src/assets/images/defaultImages/Spinner.gif +0 -0
  19. package/src/assets/images/defaultImages/notFound.svg +0 -124
  20. package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -47
  21. package/src/components/atoms/ButtonFileChooser/index.js +0 -69
  22. package/src/components/atoms/ButtonFileChooser/styles.js +0 -4
  23. package/src/components/atoms/ButtonV2/ButtonV2.stories.js +0 -51
  24. package/src/components/atoms/ButtonV2/index.js +0 -79
  25. package/src/components/atoms/ButtonV2/styles.js +0 -195
  26. package/src/components/atoms/CustomIcon/CustomIcon.stories.js +0 -36
  27. package/src/components/atoms/CustomIcon/index.js +0 -41
  28. package/src/components/atoms/CustomIcon/styles.js +0 -85
  29. package/src/components/atoms/IconFile/IconFile.stories.js +0 -35
  30. package/src/components/atoms/IconFile/index.js +0 -119
  31. package/src/components/atoms/IconFile/styles.js +0 -67
  32. package/src/components/atoms/Image/Image.stories.js +0 -51
  33. package/src/components/atoms/Image/index.js +0 -55
  34. package/src/components/atoms/Image/styles.js +0 -34
  35. package/src/components/atoms/ImageLink/ImageLink.stories.js +0 -43
  36. package/src/components/atoms/ImageLink/index.js +0 -57
  37. package/src/components/atoms/ImageLink/styles.js +0 -30
  38. package/src/components/atoms/ImagePreview/ImagePreview.stories.js +0 -52
  39. package/src/components/atoms/ImagePreview/index.js +0 -191
  40. package/src/components/atoms/ImagePreview/styles.js +0 -77
  41. package/src/components/atoms/InputText/InputText.stories.js +0 -39
  42. package/src/components/atoms/InputText/index.js +0 -61
  43. package/src/components/atoms/InputText/styles.js +0 -89
  44. package/src/components/atoms/NotFound/NotFound.stories.js +0 -19
  45. package/src/components/atoms/NotFound/index.js +0 -52
  46. package/src/components/atoms/NotFound/styles.js +0 -55
  47. package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +0 -26
  48. package/src/components/atoms/SelectItemV2/index.js +0 -45
  49. package/src/components/atoms/SelectItemV2/styles.js +0 -55
  50. package/src/components/atoms/Tooltip/Tooltip.stories.js +0 -51
  51. package/src/components/atoms/Tooltip/index.js +0 -59
  52. package/src/components/atoms/Tooltip/styles.js +0 -42
  53. package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -54
  54. package/src/components/molecules/ButtonDownloadFile/index.js +0 -111
  55. package/src/components/molecules/ButtonDownloadFile/styles.js +0 -66
  56. package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -46
  57. package/src/components/molecules/ImageTooltip/index.js +0 -62
  58. package/src/components/molecules/ImageTooltip/styles.js +0 -18
  59. package/src/components/molecules/SelectV2/SelectV2.stories.js +0 -114
  60. package/src/components/molecules/SelectV2/index.js +0 -332
  61. package/src/components/molecules/SelectV2/styles.js +0 -100
  62. package/src/components/organisms/Chat/Chat.stories.js +0 -199
  63. package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -65
  64. package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
  65. package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
  66. package/src/components/organisms/Chat/ChatLists/index.js +0 -141
  67. package/src/components/organisms/Chat/ChatLists/styles.js +0 -162
  68. package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -142
  69. package/src/components/organisms/Chat/ContainerItems/index.js +0 -549
  70. package/src/components/organisms/Chat/ContainerItems/styles.js +0 -328
  71. package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -102
  72. package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
  73. package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
  74. package/src/components/organisms/Chat/ContentChat/index.js +0 -900
  75. package/src/components/organisms/Chat/ContentChat/styles.js +0 -41
  76. package/src/components/organisms/Chat/Footer/Footer.stories.js +0 -22
  77. package/src/components/organisms/Chat/Footer/index.js +0 -669
  78. package/src/components/organisms/Chat/Footer/styles.js +0 -286
  79. package/src/components/organisms/Chat/Header/Header.stories.js +0 -66
  80. package/src/components/organisms/Chat/Header/index.js +0 -94
  81. package/src/components/organisms/Chat/Header/styles.js +0 -49
  82. package/src/components/organisms/Chat/index.js +0 -294
  83. package/src/components/organisms/Chat/styles.js +0 -42
  84. package/src/components/organisms/Modal/Modal.stories.js +0 -55
  85. package/src/components/organisms/Modal/index.js +0 -97
  86. package/src/components/organisms/Modal/styles.js +0 -103
  87. package/src/global-files/handle_http.js +0 -231
  88. package/src/global-files/utils.js +0 -300
@@ -1,66 +0,0 @@
1
- import styled from "styled-components";
2
- import { GlobalColors, FontFamily } from "../../../global-files/variables";
3
-
4
- export const Container = styled.div`
5
- width: fit-content;
6
- height: fit-content;
7
- min-width: min-content;
8
- min-height: min-content;
9
- overflow: hidden;
10
- display: grid;
11
- place-items: center;
12
- border-radius: ${({ borderType }) => {
13
- return borderType?.toLowerCase() === "rectangle"
14
- ? "10%"
15
- : borderType?.toLowerCase() === "circle"
16
- ? "50%"
17
- : "none";
18
- }};
19
-
20
- .buttonDownload {
21
- width: 100%;
22
- height: 100%;
23
- .button {
24
- // tipos de botones fill
25
- &.fill {
26
- &.white:hover {
27
- background-color: white;
28
- }
29
- &.whiteS2:hover {
30
- background-color: white;
31
- }
32
- &.pink:hover {
33
- background-color: #e33aa9;
34
- }
35
- &.gray:hover {
36
- background-color: #e8e5e5;
37
- }
38
- &.purple:hover {
39
- background-color: #f7f7fc;
40
- }
41
- }
42
-
43
- // tipos de botones transparent
44
- &.transparent {
45
- &.white:hover {
46
- color: white;
47
- }
48
- &.pink:hover {
49
- color: #e33aa9;
50
- }
51
- &.gray:hover {
52
- .icon,
53
- .iconLoading {
54
- color: #7b7979;
55
- }
56
- }
57
- &.purple:hover {
58
- color: #8a6caa;
59
- }
60
- &.black:hover {
61
- color: #262626;
62
- }
63
- }
64
- }
65
- }
66
- `;
@@ -1,46 +0,0 @@
1
- import { ImageTooltip } from "./index";
2
-
3
- export default {
4
- title: "Components/molecules/ImageTooltip",
5
- component: ImageTooltip,
6
- argTypes: {},
7
- };
8
-
9
- const Template = (args) => <ImageTooltip {...args} />;
10
-
11
- const keyS3_test =
12
- "84300/1/chat/playa-213f791b-d890-48e1-be19-28bf5a95d517.jpeg";
13
- const srcTest = `https://content-management-images.s3.amazonaws.com/${keyS3_test}`;
14
- export const ImageTooltipTest = Template.bind({});
15
- ImageTooltipTest.args = {
16
- width: "200px",
17
- sizeLoading: "50",
18
- colorLoading: "#bbbbbb",
19
- src: "bn",
20
- componentDefault: <label> test error </label>,
21
- componentTooltip: <label> mensaje del tooltip test </label>,
22
- };
23
-
24
- const keyS3_OK =
25
- "84300/1/chat/f6579ed5-16e5-48d8-ace5-6be8e8e68f53-38896acf-9179-4686-9088-9784df624ab8.png";
26
- const srcOK = `https://content-management-images.s3.amazonaws.com/${keyS3_OK}`;
27
- export const ImageTooltipOK = Template.bind({});
28
- ImageTooltipOK.args = {
29
- width: "250px",
30
- sizeLoading: "40",
31
- src: srcOK,
32
- componentDefault: <label> img no cargada </label>,
33
- componentTooltip: <label> mensaje del tooltip OK </label>,
34
- };
35
-
36
- const keyS3_ERROR =
37
- "84300/1/chat/21dba1da-3c60-42c4-97bd-033664808256-fb19ff57-b91c-4ef2-ba2a-d857b55fb33b.svg";
38
- const srcERROR = `https://content-management-images.s3.amazonaws.com/${keyS3_ERROR}`;
39
- export const ImageTooltipERROR = Template.bind({});
40
- ImageTooltipERROR.args = {
41
- width: "300px",
42
- sizeLoading: "60",
43
- src: srcERROR,
44
- componentDefault: <label> ERROR al cargar </label>,
45
- componentTooltip: <label> mensaje del tooltip ERROR </label>,
46
- };
@@ -1,62 +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
- } = props;
20
- const [imgLoad, setImgLoad] = useState();
21
- const [loading, setLoading] = useState(false);
22
-
23
- /* solo para hacer pruebas en modo dev
24
- useEffect(() => {
25
- setTimeout(() => {
26
- setLoading(false);
27
- }, 5000);
28
- }, []);
29
- */
30
-
31
- return (
32
- <Tooltip
33
- position={"topCenter"}
34
- addArrow={false}
35
- transitionType={"zoom"}
36
- followCursor={false}
37
- className={className}
38
- classNameTooltip={classNameTooltip}
39
- componentTooltip={imgLoad !== undefined && !loading && componentTooltip}
40
- >
41
- {src && (imgLoad === undefined || loading) && (
42
- <ContainerLoading
43
- className={classNameLoading}
44
- sizeLoading={sizeLoading}
45
- colorLoading={colorLoading}
46
- >
47
- <Icon pulse icon={iconLoading} />
48
- </ContainerLoading>
49
- )}
50
-
51
- {(!src || (imgLoad === false && !loading)) && componentDefault}
52
-
53
- <Img
54
- className={classNameImg}
55
- src={src}
56
- onLoad={(event) => setImgLoad(true)}
57
- onError={(event) => setImgLoad(false)}
58
- show={imgLoad === true && !loading}
59
- />
60
- </Tooltip>
61
- );
62
- };
@@ -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,114 +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
- },
91
- defaultItem: {
92
- label: "Ningun filtro",
93
- itemType: undefined,
94
- showLabelInSelect: true,
95
- },
96
- inputSearch: {
97
- className: "inputBusqueda",
98
- defaultText: "hola",
99
- },
100
- typeSelectItems: undefined,
101
- borderType: undefined,
102
- maxWidthSelect: "150px",
103
- maxWidthDropdown: "300px",
104
- maxHeightDropdown: "300px",
105
- maxWidthItems: "100px",
106
- alignmentItemsOverflow: undefined,
107
- multiple: true,
108
- classNameSelect: "selectPrueba",
109
- classNameDropdown: "dropdownSelectPrueba",
110
- positionDropdown: undefined,
111
- onChange: (selectedItems) => {
112
- console.log("selectedItems:", selectedItems);
113
- },
114
- };
@@ -1,332 +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, ContainerSelect } from "./styles";
11
- import React from "react";
12
- import { ButtonV2 } from "../../atoms/ButtonV2";
13
- import {
14
- faCaretDown as IconDownArrow,
15
- faSearch as IconSearch,
16
- } from "@fortawesome/free-solid-svg-icons";
17
- import { isArrayEmpty, isStringEmpty } from "../../../global-files/utils";
18
- import { SelectItemV2 } from "../../atoms/SelectItemV2";
19
- import { InputText } from "../../atoms/InputText";
20
-
21
- export const SelectV2 = (props) => {
22
- const {
23
- items /* [
24
- {
25
- label: string,
26
- value: string | number,
27
- selected: (boolean) true -> item seleccionado al inicio
28
- } ,
29
- ...
30
- ] */,
31
- triggerType, // (string) "hover" | "click"
32
- selectButton /* {
33
- className: string,
34
- type: (string) tipos validos de ButtonV2,
35
- transparent: boolean,
36
- disabled: boolean,
37
- label: string ,
38
- size: number ,
39
- } */,
40
- defaultItem /* {
41
- label: string,
42
- itemType: (string) "checkbox" | "marginCheckbox" | "labelOnly"
43
- showLabelInSelect: boolean, cuando esta seleccionado ver label en el btnSelect??
44
- } */,
45
- inputSearch /* {
46
- className: string,
47
- defaultText: string ,
48
- } */,
49
- maxWidthSelect, // string
50
- maxWidthDropdown, // string
51
- maxHeightDropdown, // string
52
- maxWidthItems, // string
53
- alignmentItemsOverflow, // (string) "columns" | "rows" -> por default "rows"
54
- typeSelectItems, // (string) "checkbox" | "marginCheckbox" | "labelOnly"
55
- multiple, // (boolean) se permite multiple seleccion??
56
- borderType, // (string) "rectangle" | "oval" -> por default oval
57
- classNameSelect, // (string) clase del container select
58
- classNameDropdown, // (string) clase del contenedor tooltip
59
- positionDropdown, // (string) posicion del contenedor tooltip (values en object positions)
60
- onChange, // (selectedItems: []) = {} array con los values de los items seleccionados
61
- } = props;
62
- const positions = {
63
- topStart: "top-start",
64
- topEnd: "top-end",
65
- topCenter: "top",
66
-
67
- rightStart: "right-start",
68
- rightEnd: "right-end",
69
- rightCenter: "right",
70
-
71
- bottomStart: "bottom-start",
72
- bottomEnd: "bottom-end",
73
- bottomCenter: "bottom",
74
-
75
- leftStart: "left-start",
76
- leftEnd: "left-end",
77
- leftCenter: "left",
78
- };
79
- const [selectedItems, setSelectedItems] = useState(); // { .. }
80
- const [customItems, setCustomItems] = useState([]);
81
- const [showDropdown, setShowDropdown] = useState(false);
82
- const [labelSelect, setLabelSelect] = useState("Sin titulo");
83
- const [textInputSearch, setTextInputSearch] = useState("");
84
-
85
- const refInputTextSearch = useRef();
86
-
87
- // cada que cambie la lista de items
88
- useEffect(() => {
89
- if (isArrayEmpty(items)) {
90
- setSelectedItems({});
91
- return;
92
- }
93
- // items iniciales seleccionados
94
- let initialSelectedItems = {};
95
- items.forEach((item) => {
96
- if (item.selected) {
97
- if (multiple) initialSelectedItems[item.value] = item.value;
98
- else initialSelectedItems = { [item.value]: item.value };
99
- }
100
- });
101
- setSelectedItems(initialSelectedItems);
102
- }, [items]);
103
-
104
- // cada que cambien los items seleccionados
105
- useEffect(() => {
106
- if (!selectedItems) return;
107
- renderItems();
108
- renderLabelSelect();
109
- onChange && onChange(Object.values(selectedItems));
110
- }, [selectedItems]);
111
-
112
- // evento click de cada item de la lista
113
- const onClickItem = (isSelected, value) => {
114
- let selectedItemsCopy = { ...selectedItems };
115
- if (isSelected) {
116
- multiple
117
- ? (selectedItemsCopy[value] = value)
118
- : (selectedItemsCopy = { [value]: value });
119
- } else delete selectedItemsCopy[value];
120
- setSelectedItems(selectedItemsCopy);
121
- };
122
-
123
- const onClickSearch = () => {
124
- setTextInputSearch(textInputSearch.trim());
125
- refInputTextSearch?.current && refInputTextSearch.current.blur();
126
- renderItems(textInputSearch.trim());
127
- };
128
-
129
- const renderLabelSelect = () => {
130
- if (!selectedItems) return;
131
- const selectedItemsCopy = Object.values(selectedItems);
132
- if (selectedItemsCopy.length > 1) {
133
- setLabelSelect("Personalizado");
134
- } else if (selectedItemsCopy.length === 1) {
135
- let labelItem = undefined;
136
- for (const item of items) {
137
- if (item.value == selectedItemsCopy[0]) {
138
- labelItem = item.label;
139
- break;
140
- }
141
- }
142
- !isStringEmpty(labelItem)
143
- ? setLabelSelect(labelItem)
144
- : setLabelSelect("Sin titulo");
145
- } else {
146
- if (
147
- !isStringEmpty(defaultItem?.label) &&
148
- defaultItem?.showLabelInSelect
149
- ) {
150
- setLabelSelect(defaultItem.label);
151
- } else if (!isStringEmpty(selectButton?.label)) {
152
- setLabelSelect(selectButton.label);
153
- } else {
154
- setLabelSelect("Sin titulo");
155
- }
156
- }
157
- };
158
-
159
- const renderItems = (textSearch = "") => {
160
- if (isArrayEmpty(items)) setCustomItems([]);
161
- setCustomItems(
162
- items.map((item, index) => {
163
- if (
164
- !isStringEmpty(textSearch) &&
165
- !item.label
166
- .trim()
167
- .toLowerCase()
168
- .includes(textSearch.trim().toLowerCase())
169
- ) {
170
- return null;
171
- }
172
- return (
173
- <SelectItemV2
174
- key={classNameSelect + "_item" + index}
175
- label={item.label}
176
- value={item.value}
177
- checkbox={
178
- typeSelectItems === "checkbox"
179
- ? true
180
- : typeSelectItems === "marginCheckbox"
181
- ? false
182
- : undefined
183
- }
184
- selected={selectedItems && selectedItems[item.value] ? true : false}
185
- onClick={onClickItem}
186
- />
187
- );
188
- })
189
- );
190
- };
191
-
192
- return (
193
- <ClickAwayListener
194
- onClickAway={(event) => {
195
- if (triggerType !== "hover") setShowDropdown(false);
196
- }}
197
- >
198
- <Container
199
- className={!isStringEmpty(classNameSelect) ? classNameSelect : ""}
200
- borderType={borderType}
201
- maxWidthSelect={maxWidthSelect}
202
- maxWidthDropdown={maxWidthDropdown}
203
- maxHeightDropdown={maxHeightDropdown}
204
- alignmentItemsOverflow={alignmentItemsOverflow}
205
- maxWidthItems={maxWidthItems}
206
- >
207
- <TooltipMUI
208
- {...props}
209
- placement={positions[positionDropdown] ?? positions.bottomCenter}
210
- open={triggerType !== "hover" ? showDropdown : undefined}
211
- arrow={false}
212
- componentsProps={{
213
- tooltip: {
214
- className:
215
- "dropdownSelect" +
216
- (isStringEmpty(classNameDropdown)
217
- ? ""
218
- : " " + classNameDropdown),
219
- },
220
- popper: { disablePortal: true },
221
- transition: { timeout: 300 },
222
- }}
223
- TransitionComponent={Fade}
224
- enterDelay={100}
225
- followCursor={false}
226
- disableFocusListener
227
- disableTouchListener
228
- disableHoverListener={triggerType !== "hover"}
229
- title={
230
- <>
231
- {/* input search */}
232
- {inputSearch && (
233
- <div
234
- className={
235
- "container-inputSearch" +
236
- (!isStringEmpty(inputSearch?.className)
237
- ? " " + inputSearch.className
238
- : "")
239
- }
240
- >
241
- <ButtonV2
242
- className="buttonSearch"
243
- type={"gray"}
244
- transparent
245
- size={14}
246
- icon={IconSearch}
247
- onClick={(event) => {
248
- if (
249
- isStringEmpty(textInputSearch) &&
250
- refInputTextSearch?.current
251
- ) {
252
- setTextInputSearch("");
253
- refInputTextSearch.current.focus();
254
- } else {
255
- onClickSearch();
256
- }
257
- }}
258
- />
259
-
260
- <InputText
261
- className="inputSearch"
262
- type="black"
263
- transparent
264
- size={12}
265
- placeHolder={
266
- isStringEmpty(inputSearch?.defaultText)
267
- ? "Texto a buscar"
268
- : inputSearch.defaultText
269
- }
270
- text={textInputSearch}
271
- onChangeText={(newValue) => setTextInputSearch(newValue)}
272
- onEnter={(event) => onClickSearch()}
273
- refInputText={refInputTextSearch}
274
- />
275
- </div>
276
- )}
277
-
278
- {/* item por default */}
279
- {defaultItem && (
280
- <SelectItemV2
281
- label={defaultItem.label}
282
- value={null}
283
- checkbox={
284
- defaultItem.itemType === "checkbox"
285
- ? true
286
- : defaultItem.itemType === "marginCheckbox"
287
- ? false
288
- : undefined
289
- }
290
- selected={
291
- selectedItems && Object.keys(selectedItems).length
292
- ? false
293
- : true
294
- }
295
- onClick={(isSelected, value) => {
296
- selectedItems &&
297
- Object.keys(selectedItems).length &&
298
- setSelectedItems({});
299
- }}
300
- />
301
- )}
302
-
303
- {/* lista de items */}
304
- <div className="container-items">{customItems}</div>
305
- </>
306
- }
307
- >
308
- <ContainerSelect className={"container-buttonSelect"}>
309
- <ButtonV2
310
- className={
311
- "buttonSelect" +
312
- (!isStringEmpty(selectButton?.className)
313
- ? " " + selectButton.className
314
- : "")
315
- }
316
- disabled={selectButton?.disabled}
317
- type={selectButton?.type}
318
- transparent={selectButton?.transparent}
319
- label={labelSelect}
320
- size={selectButton?.size}
321
- icon={IconDownArrow}
322
- iconPosition="end"
323
- onClick={(event) => {
324
- if (triggerType !== "hover") setShowDropdown((prev) => !prev);
325
- }}
326
- />
327
- </ContainerSelect>
328
- </TooltipMUI>
329
- </Container>
330
- </ClickAwayListener>
331
- );
332
- };