@facter/ds-core 1.14.0 → 1.16.0
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/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3361,6 +3361,23 @@ function CardSelect({
|
|
|
3361
3361
|
setTimeout(() => searchRef.current?.focus(), 0);
|
|
3362
3362
|
}
|
|
3363
3363
|
}, [open, searchable]);
|
|
3364
|
+
React10.useEffect(() => {
|
|
3365
|
+
const el = listRef.current;
|
|
3366
|
+
if (!el || !open) return;
|
|
3367
|
+
const handleWheel = (e) => {
|
|
3368
|
+
const { scrollTop, scrollHeight, clientHeight } = el;
|
|
3369
|
+
const isScrollable = scrollHeight > clientHeight;
|
|
3370
|
+
if (!isScrollable) return;
|
|
3371
|
+
e.preventDefault();
|
|
3372
|
+
e.stopPropagation();
|
|
3373
|
+
el.scrollTop = Math.max(
|
|
3374
|
+
0,
|
|
3375
|
+
Math.min(scrollTop + e.deltaY, scrollHeight - clientHeight)
|
|
3376
|
+
);
|
|
3377
|
+
};
|
|
3378
|
+
el.addEventListener("wheel", handleWheel, { passive: false, capture: true });
|
|
3379
|
+
return () => el.removeEventListener("wheel", handleWheel, { capture: true });
|
|
3380
|
+
}, [open, filteredOptions]);
|
|
3364
3381
|
const handleScroll = React10.useCallback(() => {
|
|
3365
3382
|
if (!onLoadMore || !hasMore || loading) return;
|
|
3366
3383
|
const el = listRef.current;
|
|
@@ -3448,7 +3465,7 @@ function CardSelect({
|
|
|
3448
3465
|
isDisabled && "cursor-not-allowed opacity-50 hover:bg-transparent"
|
|
3449
3466
|
),
|
|
3450
3467
|
children: [
|
|
3451
|
-
option.icon && /* @__PURE__ */ jsx("div", { className: "flex h-
|
|
3468
|
+
option.icon && /* @__PURE__ */ jsx("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ jsx(option.icon, { className: "h-3.5 w-3.5 text-primary" }) }),
|
|
3452
3469
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
3453
3470
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium leading-tight", children: option.label }),
|
|
3454
3471
|
option.description && /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs leading-tight text-muted-foreground", children: option.description })
|