pixelize-design-library 1.1.30 → 1.1.31
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 -0
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.d.ts +1 -1
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +4 -4
- package/dist/Components/DatePicker/DatePicker.js +1 -1
- package/dist/Components/NoteTextArea/NoteTextArea.d.ts +1 -1
- package/dist/Components/NoteTextArea/NoteTextArea.js +37 -13
- package/dist/Components/NoteTextArea/NoteTextAreaProps.d.ts +1 -0
- package/dist/Components/SelectSearch/SelectSearch.d.ts +1 -1
- package/dist/Components/SelectSearch/SelectSearch.js +10 -8
- package/dist/Components/SelectSearch/SelectSearchProps.d.ts +1 -1
- package/dist/Components/Switch/Switch.js +1 -1
- package/package.json +1 -1
|
@@ -2,4 +2,4 @@ import React from "react";
|
|
|
2
2
|
import { ButtonGroupIconProps } from "./ButtonGoupIconProps";
|
|
3
3
|
export default function ButtonGroupIcon({ leftIcon, rightIcon, onLeftIconClick, onRightIconClick, buttonText, onButtonClick, onButtongroupClick, size, variant, color, buttonGroupStyle, buttonGroupLeftIconStyle, buttonGroupRightIconStyle, buttonStyle, onBlurLeftIcon, onBlurRightIcon, dropdownOptions, // New prop for dropdown options
|
|
4
4
|
onDropdownOptionClick, // New prop to handle option clicks
|
|
5
|
-
rightIconDropdown, menulistStyle, menuItemStyle }: ButtonGroupIconProps): React.JSX.Element;
|
|
5
|
+
rightIconDropdown, menulistStyle, menuItemStyle, isLoading, }: ButtonGroupIconProps): React.JSX.Element;
|
|
@@ -29,7 +29,7 @@ var useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
|
29
29
|
function ButtonGroupIcon(_a) {
|
|
30
30
|
var leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, onLeftIconClick = _a.onLeftIconClick, onRightIconClick = _a.onRightIconClick, buttonText = _a.buttonText, onButtonClick = _a.onButtonClick, onButtongroupClick = _a.onButtongroupClick, size = _a.size, variant = _a.variant, color = _a.color, buttonGroupStyle = _a.buttonGroupStyle, buttonGroupLeftIconStyle = _a.buttonGroupLeftIconStyle, buttonGroupRightIconStyle = _a.buttonGroupRightIconStyle, buttonStyle = _a.buttonStyle, onBlurLeftIcon = _a.onBlurLeftIcon, onBlurRightIcon = _a.onBlurRightIcon, dropdownOptions = _a.dropdownOptions, // New prop for dropdown options
|
|
31
31
|
onDropdownOptionClick = _a.onDropdownOptionClick, // New prop to handle option clicks
|
|
32
|
-
rightIconDropdown = _a.rightIconDropdown, menulistStyle = _a.menulistStyle, menuItemStyle = _a.menuItemStyle;
|
|
32
|
+
rightIconDropdown = _a.rightIconDropdown, menulistStyle = _a.menulistStyle, menuItemStyle = _a.menuItemStyle, isLoading = _a.isLoading;
|
|
33
33
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
34
34
|
var _b = (0, react_1.useState)(false), isDropdownOpen = _b[0], setIsDropdownOpen = _b[1];
|
|
35
35
|
var handleRightIconClick = function () {
|
|
@@ -52,7 +52,7 @@ function ButtonGroupIcon(_a) {
|
|
|
52
52
|
backgroundColor: theme.colors.primary[400],
|
|
53
53
|
},
|
|
54
54
|
} })),
|
|
55
|
-
react_1.default.createElement(react_2.Button, { onClick: onButtonClick, style: buttonStyle, sx: {
|
|
55
|
+
react_1.default.createElement(react_2.Button, { onClick: onButtonClick, style: buttonStyle, isLoading: isLoading, sx: {
|
|
56
56
|
backgroundColor: theme.colors.primary[500],
|
|
57
57
|
"&:hover": {
|
|
58
58
|
backgroundColor: theme.colors.primary[400],
|
|
@@ -68,11 +68,11 @@ function ButtonGroupIcon(_a) {
|
|
|
68
68
|
react_1.default.createElement(react_2.Portal, null,
|
|
69
69
|
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 (event) { return handleMenuClick(event, option); }, style: menuItemStyle }, option === null || option === void 0 ? void 0 :
|
|
70
70
|
option.image,
|
|
71
|
-
option.label)); }))))) : rightIcon && (react_1.default.createElement(react_2.IconButton, { "aria-label": "Right icon button", icon: rightIcon, onClick: onRightIconClick, onBlur: onBlurRightIcon, style: buttonGroupRightIconStyle, sx: {
|
|
71
|
+
option.label)); }))))) : (rightIcon && (react_1.default.createElement(react_2.IconButton, { "aria-label": "Right icon button", icon: rightIcon, onClick: onRightIconClick, onBlur: onBlurRightIcon, style: buttonGroupRightIconStyle, sx: {
|
|
72
72
|
backgroundColor: theme.colors.primary[500],
|
|
73
73
|
"&:hover": {
|
|
74
74
|
backgroundColor: theme.colors.primary[400],
|
|
75
75
|
},
|
|
76
|
-
} }))));
|
|
76
|
+
} })))));
|
|
77
77
|
}
|
|
78
78
|
exports.default = ButtonGroupIcon;
|
|
@@ -16,7 +16,7 @@ var FormLabel_1 = require("../Common/FormLabel");
|
|
|
16
16
|
var ErrorMessage_1 = __importDefault(require("../Common/ErrorMessage"));
|
|
17
17
|
var HelperText_1 = __importDefault(require("../Common/HelperText"));
|
|
18
18
|
var useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
19
|
-
var DatePickerContainer = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-radius: 5px;\n font-family: Arial, sans-serif;\n font-size: 16px;\n color: #333;\n .react-datepicker-wrapper {\n width: 100%;\n }\n .react-datepicker__input-container input {\n width: 100%;\n padding: 8px;\n border: none;\n border-radius: 5px;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);\n }\n .react-datepicker__input-container input:focus {\n outline: none;\n box-shadow: 0 0 5px rgb(49 130 206);\n }\n .react-datepicker__day--selected {\n background-color: ", " !important;\n color: white !important;\n }\n .react-datepicker__day--keyboard-selected {\n background-color: #66bb6a !important;\n color: white !important;\n }\n"], ["\n border-radius: 5px;\n font-family: Arial, sans-serif;\n font-size: 16px;\n color: #333;\n .react-datepicker-wrapper {\n width: 100%;\n }\n .react-datepicker__input-container input {\n width: 100%;\n padding: 8px;\n border: none;\n border-radius: 5px;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);\n }\n .react-datepicker__input-container input:focus {\n outline: none;\n box-shadow: 0 0 5px rgb(49 130 206);\n }\n .react-datepicker__day--selected {\n background-color: ", " !important;\n color: white !important;\n }\n .react-datepicker__day--keyboard-selected {\n background-color: #66bb6a !important;\n color: white !important;\n }\n"])), function (props) { return props.theme.colors.primary[500]; });
|
|
19
|
+
var DatePickerContainer = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-radius: 5px;\n font-family: Arial, sans-serif;\n font-size: 16px;\n color: #333;\n .react-datepicker-wrapper {\n width: 100%;\n }\n .react-datepicker__input-container input {\n width: 100%;\n padding: 8px;\n border: none;\n border-radius: 5px;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);\n font-size: 14px;\n }\n .react-datepicker__input-container input:focus {\n outline: none;\n box-shadow: 0 0 5px rgb(49 130 206);\n }\n .react-datepicker__day--selected {\n background-color: ", " !important;\n color: white !important;\n }\n .react-datepicker__day--keyboard-selected {\n background-color: #66bb6a !important;\n color: white !important;\n }\n"], ["\n border-radius: 5px;\n font-family: Arial, sans-serif;\n font-size: 16px;\n color: #333;\n .react-datepicker-wrapper {\n width: 100%;\n }\n .react-datepicker__input-container input {\n width: 100%;\n padding: 8px;\n border: none;\n border-radius: 5px;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);\n font-size: 14px;\n }\n .react-datepicker__input-container input:focus {\n outline: none;\n box-shadow: 0 0 5px rgb(49 130 206);\n }\n .react-datepicker__day--selected {\n background-color: ", " !important;\n color: white !important;\n }\n .react-datepicker__day--keyboard-selected {\n background-color: #66bb6a !important;\n color: white !important;\n }\n"])), function (props) { return props.theme.colors.primary[500]; });
|
|
20
20
|
// const Label = styled.label`
|
|
21
21
|
// display: block;
|
|
22
22
|
// margin-bottom: 5px;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { NoteTextAreaProps } from "./NoteTextAreaProps";
|
|
3
|
-
export default function NoteTextArea({ width, handleSubmit, handleCancel, value, title, file, isEditable, saveButtonLoading, maxFileSize, maxFilesSizeError, }: NoteTextAreaProps): React.JSX.Element;
|
|
3
|
+
export default function NoteTextArea({ width, handleSubmit, handleCancel, value, title, file, isEditable, saveButtonLoading, maxFileSize, maxFilesSizeError, maxNoteWordCount, }: NoteTextAreaProps): React.JSX.Element;
|
|
@@ -70,16 +70,22 @@ var FileUploadLabel = styled_1.default.label(templateObject_6 || (templateObject
|
|
|
70
70
|
var AddTitleButton = styled_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: #616e88;\n cursor: pointer;\n fontsize: 0.8rem;\n"], ["\n color: #616e88;\n cursor: pointer;\n fontsize: 0.8rem;\n"])));
|
|
71
71
|
var Button = styled_1.default.button(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n border: none;\n padding: 3px 15px;\n text-align: center;\n text-decoration: none;\n background: ", ";\n color: ", ";\n font-size: 1rem;\n margin-right: 5px;\n border-radius: 5px;\n opacity: ", ";\n cursor: ", ";\n pointer-events: ", ";\n"], ["\n border: none;\n padding: 3px 15px;\n text-align: center;\n text-decoration: none;\n background: ", ";\n color: ", ";\n font-size: 1rem;\n margin-right: 5px;\n border-radius: 5px;\n opacity: ", ";\n cursor: ", ";\n pointer-events: ", ";\n"])), function (_a) {
|
|
72
72
|
var isSaveButton = _a.isSaveButton, noteValue = _a.noteValue, isLoading = _a.isLoading, theme = _a.theme;
|
|
73
|
-
return isSaveButton
|
|
73
|
+
return isSaveButton
|
|
74
|
+
? noteValue && !isLoading
|
|
75
|
+
? theme.colors.primary[500]
|
|
76
|
+
: theme.colors.primary[500]
|
|
77
|
+
: "white";
|
|
74
78
|
}, function (_a) {
|
|
75
79
|
var isSaveButton = _a.isSaveButton, isLoading = _a.isLoading;
|
|
76
80
|
return isSaveButton && !isLoading ? "white" : "white";
|
|
77
81
|
}, function (_a) {
|
|
78
|
-
var isSaveButton = _a.isSaveButton, noteValue = _a.noteValue, isLoading = _a.isLoading;
|
|
79
|
-
return isSaveButton && (!noteValue || isLoading) ? "0.5" : "1";
|
|
82
|
+
var isSaveButton = _a.isSaveButton, noteValue = _a.noteValue, isLoading = _a.isLoading, disabled = _a.disabled;
|
|
83
|
+
return isSaveButton && (!noteValue || isLoading || disabled) ? "0.5" : "1";
|
|
80
84
|
}, function (_a) {
|
|
81
|
-
var isSaveButton = _a.isSaveButton, noteValue = _a.noteValue, isLoading = _a.isLoading;
|
|
82
|
-
return isSaveButton && (!noteValue || isLoading
|
|
85
|
+
var isSaveButton = _a.isSaveButton, noteValue = _a.noteValue, isLoading = _a.isLoading, disabled = _a.disabled;
|
|
86
|
+
return isSaveButton && (!noteValue || isLoading || disabled)
|
|
87
|
+
? "initial"
|
|
88
|
+
: "pointer";
|
|
83
89
|
}, function (_a) {
|
|
84
90
|
var isLoading = _a.isLoading;
|
|
85
91
|
return (isLoading ? "none" : "auto");
|
|
@@ -88,16 +94,28 @@ var CancelButton = styled_1.default.button(templateObject_9 || (templateObject_9
|
|
|
88
94
|
var FileViewer = styled_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 300px;\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 300px;\n"])));
|
|
89
95
|
var FileEdit = (0, styled_1.default)(fi_1.FiX)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n cursor: pointer;\n color: #ff0000;\n"], ["\n cursor: pointer;\n color: #ff0000;\n"])));
|
|
90
96
|
var ErrorText = styled_1.default.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n color: #ff0000;\n font-size: 0.8rem;\n margin-top: 8px;\n"], ["\n color: #ff0000;\n font-size: 0.8rem;\n margin-top: 8px;\n"])));
|
|
97
|
+
var countWords = function (text) {
|
|
98
|
+
return text.trim().split(/\s+/).length;
|
|
99
|
+
};
|
|
91
100
|
function NoteTextArea(_a) {
|
|
92
|
-
var _b = _a.width, width = _b === void 0 ? "100%" : _b, handleSubmit = _a.handleSubmit, handleCancel = _a.handleCancel, value = _a.value, title = _a.title, file = _a.file, _c = _a.isEditable, isEditable = _c === void 0 ? false : _c, saveButtonLoading = _a.saveButtonLoading, _d = _a.maxFileSize, maxFileSize = _d === void 0 ? 1 * 1024 * 1024 : _d, _e = _a.maxFilesSizeError, maxFilesSizeError = _e === void 0 ? "Some files are too large. Maximum allowed size is" : _e;
|
|
101
|
+
var _b = _a.width, width = _b === void 0 ? "100%" : _b, handleSubmit = _a.handleSubmit, handleCancel = _a.handleCancel, value = _a.value, title = _a.title, file = _a.file, _c = _a.isEditable, isEditable = _c === void 0 ? false : _c, saveButtonLoading = _a.saveButtonLoading, _d = _a.maxFileSize, maxFileSize = _d === void 0 ? 1 * 1024 * 1024 : _d, _e = _a.maxFilesSizeError, maxFilesSizeError = _e === void 0 ? "Some files are too large. Maximum allowed size is" : _e, _f = _a.maxNoteWordCount, maxNoteWordCount = _f === void 0 ? 15 : _f;
|
|
93
102
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
94
103
|
var noteAreaRef = (0, react_1.useRef)(null);
|
|
95
|
-
var
|
|
96
|
-
var
|
|
97
|
-
var
|
|
98
|
-
var
|
|
99
|
-
var
|
|
100
|
-
var
|
|
104
|
+
var _g = (0, react_1.useState)(false), isActive = _g[0], setIsActive = _g[1];
|
|
105
|
+
var _h = (0, react_1.useState)(""), noteValue = _h[0], setNoteValue = _h[1];
|
|
106
|
+
var _j = (0, react_1.useState)(""), titleValue = _j[0], setTitleValue = _j[1];
|
|
107
|
+
var _k = (0, react_1.useState)(false), titleShow = _k[0], setTitleShow = _k[1];
|
|
108
|
+
var _l = (0, react_1.useState)([]), files = _l[0], setFiles = _l[1];
|
|
109
|
+
var _m = (0, react_1.useState)(""), fileError = _m[0], setFileError = _m[1];
|
|
110
|
+
var _o = (0, react_1.useState)(false), isSaveDisabled = _o[0], setIsSaveDisabled = _o[1];
|
|
111
|
+
(0, react_1.useEffect)(function () {
|
|
112
|
+
var titleWordCount = countWords(titleValue);
|
|
113
|
+
setIsSaveDisabled(titleWordCount > maxNoteWordCount);
|
|
114
|
+
}, [titleValue, maxNoteWordCount]);
|
|
115
|
+
(0, react_1.useEffect)(function () {
|
|
116
|
+
var noteWordCount = countWords(noteValue);
|
|
117
|
+
setIsSaveDisabled(noteWordCount > maxNoteWordCount);
|
|
118
|
+
}, [noteValue, maxNoteWordCount]);
|
|
101
119
|
(0, react_1.useEffect)(function () {
|
|
102
120
|
if (isEditable) {
|
|
103
121
|
setIsActive(true);
|
|
@@ -228,13 +246,19 @@ function NoteTextArea(_a) {
|
|
|
228
246
|
react_1.default.createElement(AddTitleButton, { onClick: handleSetTitle }, "Add a Title"))),
|
|
229
247
|
react_1.default.createElement("div", { style: { marginLeft: "auto" } },
|
|
230
248
|
react_1.default.createElement(CancelButton, { onClick: handleCloseTextArea }, "Cancel"),
|
|
231
|
-
react_1.default.createElement(Button, { isSaveButton: true, noteValue: noteValue, disabled: !noteValue
|
|
249
|
+
react_1.default.createElement(Button, { isSaveButton: true, noteValue: noteValue, isLoading: saveButtonLoading, disabled: !noteValue || isSaveDisabled, theme: theme, onClick: function () {
|
|
232
250
|
handleSubmit(noteValue, titleValue, files);
|
|
233
251
|
// handleCloseTextArea();
|
|
234
252
|
} },
|
|
235
253
|
saveButtonLoading && (react_1.default.createElement("span", { style: { marginRight: "6px" } },
|
|
236
254
|
react_1.default.createElement(react_2.Spinner, { thickness: "2px", speed: "0.75s", emptyColor: "gray.200", color: "blue.500", size: "xs" }))),
|
|
237
255
|
"Save"))),
|
|
256
|
+
react_1.default.createElement("div", { style: { display: "flex", gap: "10px" } },
|
|
257
|
+
react_1.default.createElement("div", null, "Note:"),
|
|
258
|
+
react_1.default.createElement("div", null,
|
|
259
|
+
"You can add up to ",
|
|
260
|
+
maxNoteWordCount,
|
|
261
|
+
" words only")),
|
|
238
262
|
fileError && react_1.default.createElement(ErrorText, null, fileError),
|
|
239
263
|
" ",
|
|
240
264
|
files.length > 0 && (react_1.default.createElement("div", null, files.map(function (item, index) { return (react_1.default.createElement(FileViewer, { key: index },
|
|
@@ -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,
|
|
3
|
+
export default function SelectSearch({ options, initialSelectedOption, onOptionSelect, inputOnchange, id, name, label, dropdownStyle, inputStyle, isOptionLoading, loadingText, boxStyle, placeholder, searchQuery, isInformation, informationMessage, rightIcon, rightElementStyle, isMultipleSelect, isRequired, onOptionMultiSelect, }: Readonly<SelectSearchProps>): React.JSX.Element;
|
|
@@ -313,17 +313,17 @@ var RenderOptions = function (_a) {
|
|
|
313
313
|
return (react_1.default.createElement(react_2.Text, { px: 4, py: 2, color: "gray.500" }, "No options found"));
|
|
314
314
|
};
|
|
315
315
|
function SelectSearch(_a) {
|
|
316
|
-
var options = _a.options, initialSelectedOption = _a.initialSelectedOption, onOptionSelect = _a.onOptionSelect, inputOnchange = _a.inputOnchange, id = _a.id, name = _a.name, label = _a.label,
|
|
316
|
+
var options = _a.options, initialSelectedOption = _a.initialSelectedOption, onOptionSelect = _a.onOptionSelect, inputOnchange = _a.inputOnchange, id = _a.id, name = _a.name, label = _a.label, dropdownStyle = _a.dropdownStyle, inputStyle = _a.inputStyle, isOptionLoading = _a.isOptionLoading, _b = _a.loadingText, loadingText = _b === void 0 ? "loading" : _b, boxStyle = _a.boxStyle, _c = _a.placeholder, placeholder = _c === void 0 ? "Select Option" : _c, _d = _a.searchQuery, searchQuery = _d === void 0 ? null : _d, _e = _a.isInformation, isInformation = _e === void 0 ? false : _e, informationMessage = _a.informationMessage, rightIcon = _a.rightIcon, rightElementStyle = _a.rightElementStyle, _f = _a.isMultipleSelect, isMultipleSelect = _f === void 0 ? false : _f, _g = _a.isRequired, isRequired = _g === void 0 ? false : _g, onOptionMultiSelect = _a.onOptionMultiSelect;
|
|
317
317
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
318
|
-
var
|
|
319
|
-
var
|
|
320
|
-
var
|
|
321
|
-
var
|
|
318
|
+
var _h = (0, react_1.useState)(initialSelectedOption ? [initialSelectedOption] : []), selectedOptions = _h[0], setSelectedOptions = _h[1];
|
|
319
|
+
var _j = (0, react_1.useState)(searchQuery), inputValue = _j[0], setInputValue = _j[1];
|
|
320
|
+
var _k = (0, react_1.useState)(false), isOpen = _k[0], setIsOpen = _k[1];
|
|
321
|
+
var _l = (0, react_1.useState)("below"), position = _l[0], setPosition = _l[1];
|
|
322
322
|
var inputRef = (0, react_1.useRef)(null);
|
|
323
323
|
var dropdownRef = (0, react_1.useRef)(null);
|
|
324
324
|
var filteredOptions = (0, react_1.useMemo)(function () {
|
|
325
325
|
return options.filter(function (option) {
|
|
326
|
-
return option.label.toLowerCase().includes(inputValue.toLowerCase());
|
|
326
|
+
return option.label.toLowerCase().includes((inputValue !== null && inputValue !== void 0 ? inputValue : "").toLowerCase());
|
|
327
327
|
});
|
|
328
328
|
}, [options, inputValue]);
|
|
329
329
|
// const handleOptionClick = useCallback(
|
|
@@ -390,7 +390,9 @@ function SelectSearch(_a) {
|
|
|
390
390
|
};
|
|
391
391
|
var handleKeyDown = function (e) {
|
|
392
392
|
if (e.key === "Enter") {
|
|
393
|
-
var matchingOption = options.find(function (option) {
|
|
393
|
+
var matchingOption = options.find(function (option) {
|
|
394
|
+
return option.label.toLowerCase() === (inputValue !== null && inputValue !== void 0 ? inputValue : "").toLowerCase();
|
|
395
|
+
});
|
|
394
396
|
if (matchingOption) {
|
|
395
397
|
handleOptionClick(matchingOption);
|
|
396
398
|
}
|
|
@@ -437,7 +439,7 @@ function SelectSearch(_a) {
|
|
|
437
439
|
react_1.default.createElement(react_2.TagLabel, { width: "50px" }, option.label),
|
|
438
440
|
react_1.default.createElement(react_2.TagCloseButton, { onClick: function () { return handleRemoveOption(option); } }))); }))),
|
|
439
441
|
react_1.default.createElement(react_2.InputGroup, null,
|
|
440
|
-
react_1.default.createElement(react_2.Input, { ref: inputRef, variant: "flushed", value: inputValue, onClick: function () { return setIsOpen(true); }, onChange: function (e) { return handleInputChange(e.target.value); }, placeholder: placeholder, onKeyDown: handleKeyDown, id: id, name: name, cursor: "pointer", borderColor: "gray.300", _hover: { borderColor: "blue.500" }, _focus: { borderColor: "blue.500" }, style: __assign(__assign({}, inputStyle), { backgroundColor: theme.colors.backgroundColor.main, fontWeight: 800, color: theme.colors.gray[700], padding: "0 0.5rem", fontSize: 15, letterSpacing: 0.7 }) }),
|
|
442
|
+
react_1.default.createElement(react_2.Input, { ref: inputRef, variant: "flushed", value: inputValue ? inputValue : "", onClick: function () { return setIsOpen(true); }, onChange: function (e) { return handleInputChange(e.target.value); }, placeholder: placeholder, onKeyDown: handleKeyDown, id: id, name: name, cursor: "pointer", borderColor: "gray.300", _hover: { borderColor: "blue.500" }, _focus: { borderColor: "blue.500" }, style: __assign(__assign({}, inputStyle), { backgroundColor: theme.colors.backgroundColor.main, fontWeight: 800, color: theme.colors.gray[700], padding: "0 0.5rem", fontSize: 15, letterSpacing: 0.7 }) }),
|
|
441
443
|
rightIcon && (react_1.default.createElement(react_2.InputRightElement, { pointerEvents: "none", children: rightIcon, style: __assign({}, rightElementStyle) }))),
|
|
442
444
|
isOpen && (react_1.default.createElement(react_2.Box, { ref: dropdownRef, position: "absolute", top: position === "below" ? "100%" : "auto", bottom: position === "above" ? "100%" : "auto", left: 0, right: 0, border: "1px solid", borderColor: "gray.300", borderRadius: "md", bg: "white", maxHeight: "150px", overflowY: "auto", zIndex: 10 },
|
|
443
445
|
react_1.default.createElement(RenderOptions, { isOptionLoading: isOptionLoading, filteredOptions: filteredOptions, loadingText: loadingText, handleOptionClick: handleOptionClick })))));
|
|
@@ -15,7 +15,7 @@ export type SelectSearchProps = {
|
|
|
15
15
|
isOptionLoading?: boolean;
|
|
16
16
|
loadingText?: string;
|
|
17
17
|
placeholder?: string;
|
|
18
|
-
searchQuery: string;
|
|
18
|
+
searchQuery: string | null;
|
|
19
19
|
isInformation?: boolean;
|
|
20
20
|
informationMessage?: string;
|
|
21
21
|
rightIcon?: React.ReactNode;
|
|
@@ -19,7 +19,7 @@ var Highlight = styled_1.default.div(templateObject_2 || (templateObject_2 = __m
|
|
|
19
19
|
var SwitchList = styled_1.default.ul(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n list-style-type: none;\n margin: 0;\n padding: 1px;\n height: 100%;\n z-index: 1;\n"], ["\n display: flex;\n list-style-type: none;\n margin: 0;\n padding: 1px;\n height: 100%;\n z-index: 1;\n"])));
|
|
20
20
|
var SwitchOption = styled_1.default.li(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n width: 110px;\n height: 100%;\n color: black;\n transition: color 0.3s ease;\n font-weight: 400;\n padding: 2px;\n ", "\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n width: 110px;\n height: 100%;\n color: black;\n transition: color 0.3s ease;\n font-weight: 400;\n padding: 2px;\n ", "\n"])), function (_a) {
|
|
21
21
|
var isActive = _a.isActive;
|
|
22
|
-
return isActive && (0, react_2.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-weight:
|
|
22
|
+
return isActive && (0, react_2.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-weight: 700;\n background-color: transparent;\n z-index: 1;\n "], ["\n font-weight: 700;\n background-color: transparent;\n z-index: 1;\n "])));
|
|
23
23
|
});
|
|
24
24
|
var SwitchContainerHeader = styled_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background-color: white;\n height: auto;\n padding: 3px 3px 3px 3px;\n width: 200px;\n border-radius: 20px;\n border: 1px solid #e2e7ee;\n"], ["\n background-color: white;\n height: auto;\n padding: 3px 3px 3px 3px;\n width: 200px;\n border-radius: 20px;\n border: 1px solid #e2e7ee;\n"])));
|
|
25
25
|
function Switch(_a) {
|