contentoh-components-library 21.2.97 → 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 (111) hide show
  1. package/.env.development +0 -3
  2. package/dist/assets/fonts/{Roboto → roboto}/LICENSE.txt +0 -0
  3. package/dist/assets/fonts/{Roboto → roboto}/Roboto-Black.ttf +0 -0
  4. package/dist/assets/fonts/{Roboto → roboto}/Roboto-BlackItalic.ttf +0 -0
  5. package/dist/assets/fonts/{Roboto → roboto}/Roboto-Bold.ttf +0 -0
  6. package/dist/assets/fonts/{Roboto → roboto}/Roboto-BoldItalic.ttf +0 -0
  7. package/dist/assets/fonts/{Roboto → roboto}/Roboto-Italic.ttf +0 -0
  8. package/dist/assets/fonts/{Roboto → roboto}/Roboto-Light.ttf +0 -0
  9. package/dist/assets/fonts/{Roboto → roboto}/Roboto-LightItalic.ttf +0 -0
  10. package/dist/assets/fonts/{Roboto → roboto}/Roboto-Medium.ttf +0 -0
  11. package/dist/assets/fonts/{Roboto → roboto}/Roboto-MediumItalic.ttf +0 -0
  12. package/dist/assets/fonts/{Roboto → roboto}/Roboto-Regular.ttf +0 -0
  13. package/dist/assets/fonts/{Roboto → roboto}/Roboto-Thin.ttf +0 -0
  14. package/dist/assets/fonts/{Roboto → roboto}/Roboto-ThinItalic.ttf +0 -0
  15. package/dist/components/atoms/CheckBox/index.js +5 -2
  16. package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +22 -21
  17. package/dist/components/molecules/CustomSelect/SelectItem.js +1 -10
  18. package/dist/components/molecules/HeaderTop/index.js +5 -10
  19. package/dist/components/molecules/HeaderTop/styles.js +1 -1
  20. package/dist/components/organisms/OrderDetail/OrderDetail.stories.js +3 -2
  21. package/dist/components/organisms/OrderDetail/index.js +9 -3
  22. package/dist/components/organisms/OrderDetail/styles.js +1 -1
  23. package/dist/components/organisms/OrderDetail/utils/Table/index.js +2 -1
  24. package/dist/global-files/fonts.css +0 -12
  25. package/dist/global-files/variables.js +0 -2
  26. package/dist/index.js +46 -241
  27. package/package.json +1 -12
  28. package/src/components/atoms/CheckBox/index.js +9 -1
  29. package/src/components/molecules/CustomSelect/CustomSelect.stories.js +12 -20
  30. package/src/components/molecules/CustomSelect/SelectItem.js +0 -7
  31. package/src/components/molecules/HeaderTop/index.js +6 -11
  32. package/src/components/molecules/HeaderTop/styles.js +0 -4
  33. package/src/components/organisms/OrderDetail/OrderDetail.stories.js +2 -1
  34. package/src/components/organisms/OrderDetail/index.js +4 -1
  35. package/src/components/organisms/OrderDetail/styles.js +1 -0
  36. package/src/components/organisms/OrderDetail/utils/Table/index.js +1 -0
  37. package/src/global-files/fonts.css +0 -12
  38. package/src/global-files/variables.js +0 -2
  39. package/src/index.js +0 -15
  40. package/src/assets/images/customSelect/starIcon.svg +0 -14
  41. package/src/assets/images/defaultImages/Spinner.gif +0 -0
  42. package/src/assets/images/defaultImages/notFound.svg +0 -124
  43. package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -47
  44. package/src/components/atoms/ButtonFileChooser/index.js +0 -69
  45. package/src/components/atoms/ButtonFileChooser/styles.js +0 -4
  46. package/src/components/atoms/ButtonV2/ButtonV2.stories.js +0 -51
  47. package/src/components/atoms/ButtonV2/index.js +0 -79
  48. package/src/components/atoms/ButtonV2/styles.js +0 -195
  49. package/src/components/atoms/CustomIcon/CustomIcon.stories.js +0 -36
  50. package/src/components/atoms/CustomIcon/index.js +0 -41
  51. package/src/components/atoms/CustomIcon/styles.js +0 -85
  52. package/src/components/atoms/IconFile/IconFile.stories.js +0 -35
  53. package/src/components/atoms/IconFile/index.js +0 -119
  54. package/src/components/atoms/IconFile/styles.js +0 -67
  55. package/src/components/atoms/Image/Image.stories.js +0 -51
  56. package/src/components/atoms/Image/index.js +0 -55
  57. package/src/components/atoms/Image/styles.js +0 -34
  58. package/src/components/atoms/ImageLink/ImageLink.stories.js +0 -43
  59. package/src/components/atoms/ImageLink/index.js +0 -57
  60. package/src/components/atoms/ImageLink/styles.js +0 -30
  61. package/src/components/atoms/ImagePreview/ImagePreview.stories.js +0 -52
  62. package/src/components/atoms/ImagePreview/index.js +0 -191
  63. package/src/components/atoms/ImagePreview/styles.js +0 -77
  64. package/src/components/atoms/InputText/InputText.stories.js +0 -39
  65. package/src/components/atoms/InputText/index.js +0 -61
  66. package/src/components/atoms/InputText/styles.js +0 -89
  67. package/src/components/atoms/NotFound/NotFound.stories.js +0 -19
  68. package/src/components/atoms/NotFound/index.js +0 -52
  69. package/src/components/atoms/NotFound/styles.js +0 -55
  70. package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +0 -26
  71. package/src/components/atoms/SelectItemV2/index.js +0 -45
  72. package/src/components/atoms/SelectItemV2/styles.js +0 -55
  73. package/src/components/atoms/Tooltip/Tooltip.stories.js +0 -51
  74. package/src/components/atoms/Tooltip/index.js +0 -59
  75. package/src/components/atoms/Tooltip/styles.js +0 -42
  76. package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -54
  77. package/src/components/molecules/ButtonDownloadFile/index.js +0 -111
  78. package/src/components/molecules/ButtonDownloadFile/styles.js +0 -66
  79. package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -46
  80. package/src/components/molecules/ImageTooltip/index.js +0 -62
  81. package/src/components/molecules/ImageTooltip/styles.js +0 -18
  82. package/src/components/molecules/SelectV2/SelectV2.stories.js +0 -114
  83. package/src/components/molecules/SelectV2/index.js +0 -332
  84. package/src/components/molecules/SelectV2/styles.js +0 -100
  85. package/src/components/organisms/Chat/Chat.stories.js +0 -199
  86. package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -65
  87. package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
  88. package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
  89. package/src/components/organisms/Chat/ChatLists/index.js +0 -141
  90. package/src/components/organisms/Chat/ChatLists/styles.js +0 -162
  91. package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -142
  92. package/src/components/organisms/Chat/ContainerItems/index.js +0 -549
  93. package/src/components/organisms/Chat/ContainerItems/styles.js +0 -328
  94. package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -102
  95. package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
  96. package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
  97. package/src/components/organisms/Chat/ContentChat/index.js +0 -900
  98. package/src/components/organisms/Chat/ContentChat/styles.js +0 -41
  99. package/src/components/organisms/Chat/Footer/Footer.stories.js +0 -22
  100. package/src/components/organisms/Chat/Footer/index.js +0 -669
  101. package/src/components/organisms/Chat/Footer/styles.js +0 -286
  102. package/src/components/organisms/Chat/Header/Header.stories.js +0 -66
  103. package/src/components/organisms/Chat/Header/index.js +0 -94
  104. package/src/components/organisms/Chat/Header/styles.js +0 -49
  105. package/src/components/organisms/Chat/index.js +0 -294
  106. package/src/components/organisms/Chat/styles.js +0 -42
  107. package/src/components/organisms/Modal/Modal.stories.js +0 -55
  108. package/src/components/organisms/Modal/index.js +0 -97
  109. package/src/components/organisms/Modal/styles.js +0 -103
  110. package/src/global-files/handle_http.js +0 -231
  111. package/src/global-files/utils.js +0 -300
@@ -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
- };
@@ -1,100 +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
- max-width: ${({ maxWidthSelect }) =>
7
- maxWidthSelect ? maxWidthSelect : "unset"};
8
- //border: 1px solid red;
9
- border-radius: ${({ borderType }) => {
10
- return borderType?.toLowerCase() === "rectangle"
11
- ? "6px"
12
- : borderType?.toLowerCase() === "oval"
13
- ? "17px"
14
- : "0px"; // default none
15
- }};
16
- `;
17
-
18
- export const ContainerSelect = styled.div`
19
- width: 100%;
20
- border-radius: inherit;
21
-
22
- .buttonSelect {
23
- width: 100%;
24
- border-radius: inherit;
25
-
26
- .button {
27
- padding: 10px 16px;
28
- gap: 10px;
29
- .icon {
30
- font-size: 13px;
31
- }
32
- }
33
- }
34
-
35
- + .MuiTooltip-popper {
36
- background-color: transparent;
37
-
38
- .dropdownSelect {
39
- --background: white;
40
- box-shadow: 0px 0px 10px 1px gray;
41
- background-color: var(--background);
42
- padding: 6px 0px;
43
- border-radius: 7px;
44
- display: flex;
45
- flex-direction: column;
46
- gap: 0px;
47
- max-width: ${({ maxWidthDropdown }) =>
48
- maxWidthDropdown ? maxWidthDropdown : "400px"};
49
- max-height: ${({ maxHeightDropdown }) =>
50
- maxHeightDropdown ? maxHeightDropdown : "80vh"};
51
-
52
- .container-inputSearch {
53
- width: 100%;
54
- display: flex;
55
- flex-direction: row;
56
- flex-wrap: nowrap;
57
- align-items: center;
58
- gap: 0px;
59
- padding: 0px 10px 8px 10px;
60
- border-bottom: 1px solid #f0f0f0;
61
-
62
- .inputSearch {
63
- padding-left: 8px;
64
- flex-grow: 2;
65
- }
66
- }
67
-
68
- .selectItemV2 {
69
- width: 100%;
70
- }
71
-
72
- .container-items {
73
- flex-grow: 2;
74
- display: flex;
75
- flex-direction: column;
76
- flex-wrap: ${({ alignmentItemsOverflow }) =>
77
- alignmentItemsOverflow === "columns" ? "wrap" : "nowrap"};
78
- overflow: auto;
79
-
80
- .selectItemV2 {
81
- width: ${({ maxWidthItems }) =>
82
- maxWidthItems ? maxWidthItems : "100%"};
83
- }
84
- }
85
- }
86
-
87
- &[data-popper-placement*="bottom"] .dropdownSelect {
88
- margin-top: 10px;
89
- }
90
- &[data-popper-placement*="top"] .dropdownSelect {
91
- margin-bottom: 10px;
92
- }
93
- &[data-popper-placement*="left"] .dropdownSelect {
94
- margin-right: 10px;
95
- }
96
- &[data-popper-placement*="right"] .dropdownSelect {
97
- margin-left: 10px;
98
- }
99
- }
100
- `;