sccoreui 6.3.80 → 6.3.82
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.
|
@@ -13,13 +13,15 @@ const ListBoxDropdown = (props) => {
|
|
|
13
13
|
const boxRef = (0, react_1.useRef)();
|
|
14
14
|
const { selectAll,
|
|
15
15
|
// onSelectAll,
|
|
16
|
-
onChange, footeTemplate, headerTemplate, labelIcon, labelIconPos, label, labelIconSize, listItems, filter, multiple, filterPlaceholder, optionLabel, listClassName, menuClassName, listBoxParentClassName, listBoxclassName, optionTemplate, values, link, className,
|
|
16
|
+
onChange, footeTemplate, headerTemplate, labelIcon, labelIconPos, label, labelIconSize, listItems, filter, multiple, filterPlaceholder, optionLabel, listClassName, menuClassName, listBoxParentClassName, listBoxclassName, optionTemplate, values, link, className,
|
|
17
|
+
// scrollElementId,
|
|
18
|
+
optionsMenuRef = boxRef,
|
|
17
19
|
// buttonClassName,
|
|
18
20
|
showChips, chipTemplate, chipClassName, chipsParentClassName, showRemoveIcon, removeIconSize, removeIconClassName, onRemoveItem, isDraggable, onDranghandle, onShow, onHide, onFocus, confirmationOption, selectedOptionNone, type, emptyFilterMessage, emptyMessage, } = props;
|
|
19
21
|
const [selectedItems, setSelectedItems] = (0, react_1.useState)([]);
|
|
20
22
|
// const [inpValue, setInpValue] = useState<any>();
|
|
21
23
|
// const [checked, setChecked] = useState<boolean>(false);
|
|
22
|
-
const [buttonPosition, setButtonPosition] =
|
|
24
|
+
// const [buttonPosition, setButtonPosition] = useState<number | null>(null);
|
|
23
25
|
const buttonRef = (0, react_1.useRef)(null);
|
|
24
26
|
const onSelectOption = (e) => {
|
|
25
27
|
if (confirmationOption === true)
|
|
@@ -32,17 +34,15 @@ const ListBoxDropdown = (props) => {
|
|
|
32
34
|
(0, react_1.useEffect)(() => {
|
|
33
35
|
setSelectedItems(values);
|
|
34
36
|
}, [values]);
|
|
35
|
-
const handleScroll = (e) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
}, []);
|
|
37
|
+
// const handleScroll = (e: any) => {
|
|
38
|
+
// if (optionsMenuRef?.current) optionsMenuRef.current.hide(e);
|
|
39
|
+
// };
|
|
40
|
+
// useEffect(() => {
|
|
41
|
+
// if (scrollElementId) {
|
|
42
|
+
// let elm = document.getElementById(`${scrollElementId}`);
|
|
43
|
+
// if (elm) elm.addEventListener("scroll", handleScroll);
|
|
44
|
+
// }
|
|
45
|
+
// }, []);
|
|
46
46
|
const handleDragStart = (e, index) => {
|
|
47
47
|
e.dataTransfer.setData("text/plain", index);
|
|
48
48
|
};
|
|
@@ -80,28 +80,26 @@ const ListBoxDropdown = (props) => {
|
|
|
80
80
|
// optionsMenuRef?.current.hide(e)
|
|
81
81
|
// }
|
|
82
82
|
// }
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
};
|
|
101
|
-
}, [buttonPosition]);
|
|
83
|
+
// useEffect(() => {
|
|
84
|
+
// const handleScroll = (e) => {
|
|
85
|
+
// if (buttonRef?.current) {
|
|
86
|
+
// const newPosition = buttonRef?.current?.getBoundingClientRect().top;
|
|
87
|
+
// // Hide overlay if the button position changes from the top
|
|
88
|
+
// if (buttonPosition !== null && newPosition !== buttonPosition) {
|
|
89
|
+
// if (optionsMenuRef?.current) optionsMenuRef.current.hide(e);
|
|
90
|
+
// }
|
|
91
|
+
// // Update the button position
|
|
92
|
+
// setButtonPosition(newPosition);
|
|
93
|
+
// }
|
|
94
|
+
// };
|
|
95
|
+
// window.addEventListener("scroll", handleScroll);
|
|
96
|
+
// return () => {
|
|
97
|
+
// window.removeEventListener("scroll", handleScroll);
|
|
98
|
+
// };
|
|
99
|
+
// }, [buttonPosition]);
|
|
102
100
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `${className}` }, { children: [(0, jsx_runtime_1.jsx)(menu_1.Menu, { onShow: (e) => onShow && onShow(e), onHide: (e) => onHide && onHide(e), onFocus: (e) => onFocus && onFocus(e), popup: true, ref: optionsMenuRef,
|
|
103
101
|
// onMouseLeave={onMouseLeaveMenu}
|
|
104
|
-
id: "popup_menu_bottom", className: menuClassName ? menuClassName : "", model: [
|
|
102
|
+
id: "popup_menu_bottom", className: menuClassName ? menuClassName : "", appendTo: "self", model: [
|
|
105
103
|
{
|
|
106
104
|
template: () => ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: listBoxParentClassName
|
|
107
105
|
? listBoxParentClassName +
|