@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.js
CHANGED
|
@@ -3392,6 +3392,23 @@ function CardSelect({
|
|
|
3392
3392
|
setTimeout(() => searchRef.current?.focus(), 0);
|
|
3393
3393
|
}
|
|
3394
3394
|
}, [open, searchable]);
|
|
3395
|
+
React10__namespace.useEffect(() => {
|
|
3396
|
+
const el = listRef.current;
|
|
3397
|
+
if (!el || !open) return;
|
|
3398
|
+
const handleWheel = (e) => {
|
|
3399
|
+
const { scrollTop, scrollHeight, clientHeight } = el;
|
|
3400
|
+
const isScrollable = scrollHeight > clientHeight;
|
|
3401
|
+
if (!isScrollable) return;
|
|
3402
|
+
e.preventDefault();
|
|
3403
|
+
e.stopPropagation();
|
|
3404
|
+
el.scrollTop = Math.max(
|
|
3405
|
+
0,
|
|
3406
|
+
Math.min(scrollTop + e.deltaY, scrollHeight - clientHeight)
|
|
3407
|
+
);
|
|
3408
|
+
};
|
|
3409
|
+
el.addEventListener("wheel", handleWheel, { passive: false, capture: true });
|
|
3410
|
+
return () => el.removeEventListener("wheel", handleWheel, { capture: true });
|
|
3411
|
+
}, [open, filteredOptions]);
|
|
3395
3412
|
const handleScroll = React10__namespace.useCallback(() => {
|
|
3396
3413
|
if (!onLoadMore || !hasMore || loading) return;
|
|
3397
3414
|
const el = listRef.current;
|
|
@@ -3479,7 +3496,7 @@ function CardSelect({
|
|
|
3479
3496
|
isDisabled && "cursor-not-allowed opacity-50 hover:bg-transparent"
|
|
3480
3497
|
),
|
|
3481
3498
|
children: [
|
|
3482
|
-
option.icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-
|
|
3499
|
+
option.icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ jsxRuntime.jsx(option.icon, { className: "h-3.5 w-3.5 text-primary" }) }),
|
|
3483
3500
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
3484
3501
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium leading-tight", children: option.label }),
|
|
3485
3502
|
option.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs leading-tight text-muted-foreground", children: option.description })
|