pixelize-design-library 2.0.17 → 2.0.18
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.
|
@@ -61,7 +61,9 @@ var SearchSelect = function (_a) {
|
|
|
61
61
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
62
62
|
(0, react_2.useOutsideClick)({
|
|
63
63
|
ref: containerRef,
|
|
64
|
-
handler: function () {
|
|
64
|
+
handler: function () {
|
|
65
|
+
setIsOpen(false);
|
|
66
|
+
},
|
|
65
67
|
});
|
|
66
68
|
var selectedValues = isMultiple
|
|
67
69
|
? Array.isArray(value)
|
|
@@ -149,6 +151,15 @@ var SearchSelect = function (_a) {
|
|
|
149
151
|
// ref: customSelectRef,
|
|
150
152
|
// handler: () => setCustomSelectOpen(false),
|
|
151
153
|
// });
|
|
154
|
+
(0, react_2.useOutsideClick)({
|
|
155
|
+
ref: customSelectRef,
|
|
156
|
+
handler: function (e) {
|
|
157
|
+
var dropdown = document.getElementById('custom-select-portal');
|
|
158
|
+
if (dropdown && dropdown.contains(e.target))
|
|
159
|
+
return;
|
|
160
|
+
setCustomSelectOpen(false);
|
|
161
|
+
},
|
|
162
|
+
});
|
|
152
163
|
var handleCustomSelect = function (item) {
|
|
153
164
|
if (typeof (insideSelect === null || insideSelect === void 0 ? void 0 : insideSelect.onSelect) === 'function') {
|
|
154
165
|
insideSelect.onSelect(item);
|
|
@@ -174,7 +185,7 @@ var SearchSelect = function (_a) {
|
|
|
174
185
|
react_1.default.createElement(SelectTruncatedLabel_1.default, { label: (_e = (_d = insideSelect === null || insideSelect === void 0 ? void 0 : insideSelect.value) === null || _d === void 0 ? void 0 : _d.label) !== null && _e !== void 0 ? _e : "", maxWidth: (insideSelect === null || insideSelect === void 0 ? void 0 : insideSelect.width) || "6rem" }),
|
|
175
186
|
customSelectOpen ? react_1.default.createElement(lucide_react_1.ChevronUp, { size: 16 }) : react_1.default.createElement(lucide_react_1.ChevronDown, { size: 16 })),
|
|
176
187
|
customSelectOpen && (react_1.default.createElement(react_2.Portal, null,
|
|
177
|
-
react_1.default.createElement(react_2.Box, { position: "absolute", top: "".concat(customSelectPos.top, "px"), left: "".concat(customSelectPos.left, "px"), zIndex: 20, bg: theme.colors.white, border: "0.063rem solid", borderColor: theme.colors.gray[300], borderRadius: "md", boxShadow: "md", minW: "10rem", maxW: "38rem" }, (_f = insideSelect === null || insideSelect === void 0 ? void 0 : insideSelect.option) === null || _f === void 0 ? void 0 : _f.map(function (item) { return (react_1.default.createElement(react_2.Box, { key: item.id, display: "flex", alignItems: "center", height: "2.5rem" // height instead of vertical padding
|
|
188
|
+
react_1.default.createElement(react_2.Box, { id: "custom-select-portal", position: "absolute", top: "".concat(customSelectPos.top, "px"), left: "".concat(customSelectPos.left, "px"), zIndex: 20, bg: theme.colors.white, border: "0.063rem solid", borderColor: theme.colors.gray[300], borderRadius: "md", boxShadow: "md", minW: "10rem", maxW: "38rem" }, (_f = insideSelect === null || insideSelect === void 0 ? void 0 : insideSelect.option) === null || _f === void 0 ? void 0 : _f.map(function (item) { return (react_1.default.createElement(react_2.Box, { key: item.id, display: "flex", alignItems: "center", height: "2.5rem" // height instead of vertical padding
|
|
178
189
|
, px: "0.75rem" // light internal spacing
|
|
179
190
|
, fontSize: "sm", _hover: { bg: theme.colors.gray[100] }, cursor: "pointer", onClick: function (e) {
|
|
180
191
|
e.stopPropagation();
|
|
@@ -158,15 +158,15 @@ var SearchSelect = function () {
|
|
|
158
158
|
"label": "Hariharan Jeganathan",
|
|
159
159
|
},
|
|
160
160
|
{
|
|
161
|
-
"id":
|
|
161
|
+
"id": 5,
|
|
162
162
|
"label": "Karuppusamy S",
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
|
-
"id":
|
|
165
|
+
"id": 6,
|
|
166
166
|
"label": "SasiKumar M",
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
|
-
"id":
|
|
169
|
+
"id": 7,
|
|
170
170
|
"label": "Hariharan Jeganathan",
|
|
171
171
|
}
|
|
172
172
|
]
|