pixelize-design-library 1.1.25 → 1.1.26
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/ButtonGroupIcon/ButtonGoupIconProps.d.ts +1 -1
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +3 -3
- package/dist/Components/SelectSearch/SelectSearch.d.ts +1 -1
- package/dist/Components/SelectSearch/SelectSearch.js +6 -6
- package/dist/Components/SelectSearch/SelectSearchProps.d.ts +1 -0
- package/package.json +1 -1
|
@@ -38,10 +38,10 @@ function ButtonGroupIcon(_a) {
|
|
|
38
38
|
onRightIconClick();
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
var handleMenuClick = function (option) { return function () {
|
|
41
|
+
var handleMenuClick = function (e, option) { return function () {
|
|
42
42
|
setIsDropdownOpen(false);
|
|
43
43
|
if (onDropdownOptionClick) {
|
|
44
|
-
onDropdownOptionClick(option);
|
|
44
|
+
onDropdownOptionClick(e, option);
|
|
45
45
|
}
|
|
46
46
|
}; };
|
|
47
47
|
return (react_1.default.createElement(react_2.ButtonGroup, { size: size, isAttached: true, variant: variant, onClick: onButtongroupClick, colorScheme: color, style: buttonGroupStyle },
|
|
@@ -65,7 +65,7 @@ function ButtonGroupIcon(_a) {
|
|
|
65
65
|
},
|
|
66
66
|
} }),
|
|
67
67
|
react_1.default.createElement(react_2.Portal, null,
|
|
68
|
-
react_1.default.createElement(react_2.MenuList, { style: menulistStyle }, dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map(function (option, index) { return (react_1.default.createElement(react_2.MenuItem, { key: index, onClick: handleMenuClick(option), style: menuItemStyle }, option.label)); }))))) : rightIcon && (react_1.default.createElement(react_2.IconButton, { "aria-label": "Right icon button", icon: rightIcon, onClick: onRightIconClick, onBlur: onBlurRightIcon, style: buttonGroupRightIconStyle, sx: {
|
|
68
|
+
react_1.default.createElement(react_2.MenuList, { style: menulistStyle }, dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map(function (option, index) { return (react_1.default.createElement(react_2.MenuItem, { key: index, onClick: function (e) { return handleMenuClick(e, option); }, style: menuItemStyle }, option.label)); }))))) : rightIcon && (react_1.default.createElement(react_2.IconButton, { "aria-label": "Right icon button", icon: rightIcon, onClick: onRightIconClick, onBlur: onBlurRightIcon, style: buttonGroupRightIconStyle, sx: {
|
|
69
69
|
backgroundColor: theme.colors.primary[500],
|
|
70
70
|
"&:hover": {
|
|
71
71
|
backgroundColor: theme.colors.primary[400],
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SelectSearchProps } from "./SelectSearchProps";
|
|
3
|
-
export default function SelectSearch({ options, initialSelectedOption, onOptionSelect, inputOnchange, id, name, label, inputStyle, dropdownStyle, isOptionLoading, loadingText, boxStyle, placeholder, searchQuery, isInformation, informationMessage, rightIcon, rightElementStyle, isMultipleSelect, onOptionMultiSelect, }: Readonly<SelectSearchProps>): React.JSX.Element;
|
|
3
|
+
export default function SelectSearch({ options, initialSelectedOption, onOptionSelect, inputOnchange, id, name, label, inputStyle, dropdownStyle, isOptionLoading, loadingText, boxStyle, placeholder, searchQuery, isInformation, informationMessage, rightIcon, rightElementStyle, isMultipleSelect, isRequired, onOptionMultiSelect, }: Readonly<SelectSearchProps>): React.JSX.Element;
|
|
@@ -495,12 +495,12 @@ var react_2 = require("@chakra-ui/react");
|
|
|
495
495
|
var FormLabel_1 = require("../Common/FormLabel");
|
|
496
496
|
var useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
497
497
|
function SelectSearch(_a) {
|
|
498
|
-
var options = _a.options, _b = _a.initialSelectedOption, initialSelectedOption = _b === void 0 ? null : _b, onOptionSelect = _a.onOptionSelect, inputOnchange = _a.inputOnchange, id = _a.id, name = _a.name, label = _a.label, inputStyle = _a.inputStyle, dropdownStyle = _a.dropdownStyle, isOptionLoading = _a.isOptionLoading, _c = _a.loadingText, loadingText = _c === void 0 ? "loading" : _c, boxStyle = _a.boxStyle, _d = _a.placeholder, placeholder = _d === void 0 ? "Select Option" : _d, _e = _a.searchQuery, searchQuery = _e === void 0 ? "" : _e, _f = _a.isInformation, isInformation = _f === void 0 ? false : _f, informationMessage = _a.informationMessage, rightIcon = _a.rightIcon, rightElementStyle = _a.rightElementStyle, isMultipleSelect = _a.isMultipleSelect, onOptionMultiSelect = _a.onOptionMultiSelect;
|
|
498
|
+
var options = _a.options, _b = _a.initialSelectedOption, initialSelectedOption = _b === void 0 ? null : _b, onOptionSelect = _a.onOptionSelect, inputOnchange = _a.inputOnchange, id = _a.id, name = _a.name, label = _a.label, inputStyle = _a.inputStyle, dropdownStyle = _a.dropdownStyle, isOptionLoading = _a.isOptionLoading, _c = _a.loadingText, loadingText = _c === void 0 ? "loading" : _c, boxStyle = _a.boxStyle, _d = _a.placeholder, placeholder = _d === void 0 ? "Select Option" : _d, _e = _a.searchQuery, searchQuery = _e === void 0 ? "" : _e, _f = _a.isInformation, isInformation = _f === void 0 ? false : _f, informationMessage = _a.informationMessage, rightIcon = _a.rightIcon, rightElementStyle = _a.rightElementStyle, isMultipleSelect = _a.isMultipleSelect, _g = _a.isRequired, isRequired = _g === void 0 ? false : _g, onOptionMultiSelect = _a.onOptionMultiSelect;
|
|
499
499
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
500
|
-
var
|
|
501
|
-
var
|
|
502
|
-
var
|
|
503
|
-
var
|
|
500
|
+
var _h = (0, react_1.useState)([]), selectedOptions = _h[0], setSelectedOptions = _h[1];
|
|
501
|
+
var _j = (0, react_1.useState)(""), inputValue = _j[0], setInputValue = _j[1];
|
|
502
|
+
var _k = (0, react_1.useState)(false), isOpen = _k[0], setIsOpen = _k[1];
|
|
503
|
+
var _l = (0, react_1.useState)("below"), position = _l[0], setPosition = _l[1];
|
|
504
504
|
var inputRef = (0, react_1.useRef)(null);
|
|
505
505
|
var dropdownRef = (0, react_1.useRef)(null);
|
|
506
506
|
var filteredOptions = (0, react_1.useMemo)(function () {
|
|
@@ -597,7 +597,7 @@ function SelectSearch(_a) {
|
|
|
597
597
|
return (react_1.default.createElement(react_2.Text, { px: 4, py: 2, color: "gray.500" }, "No options found"));
|
|
598
598
|
}, [filteredOptions, isOptionLoading, loadingText, handleOptionClick]);
|
|
599
599
|
return (react_1.default.createElement(react_2.Box, { display: "flex", flexDirection: "column", position: "relative", sx: boxStyle },
|
|
600
|
-
label && (react_1.default.createElement(FormLabel_1.TextLabel, { label: label, id: id, isRequired:
|
|
600
|
+
label && (react_1.default.createElement(FormLabel_1.TextLabel, { label: label, id: id, isRequired: isRequired, isInformation: isInformation, informationMessage: informationMessage })),
|
|
601
601
|
isMultipleSelect && selectedOptions.length > 0 && (react_1.default.createElement(react_2.HStack, { spacing: 2, mb: 2 }, selectedOptions.map(function (option) { return (react_1.default.createElement(react_2.Tag, { size: "md", key: option.id, borderRadius: "full", variant: "solid", sx: { backgroundColor: theme.colors.primary[500] } },
|
|
602
602
|
react_1.default.createElement(react_2.TagLabel, { width: "50px" }, option.label),
|
|
603
603
|
react_1.default.createElement(react_2.TagCloseButton, { onClick: function () { return handleRemoveOption(option); } }))); }))),
|