@wipco/sdui 0.18.1 → 0.18.2
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.
|
@@ -66,6 +66,17 @@ function AutocompleteFieldImpl({
|
|
|
66
66
|
const [results, setResults] = useState([]);
|
|
67
67
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
68
68
|
const [focusPending, setFocusPending] = useState(false);
|
|
69
|
+
const listRef = useRef(null);
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (!open) return;
|
|
72
|
+
const box = listRef.current;
|
|
73
|
+
const active = box?.querySelector(`#${CSS.escape(`${listId}-opt-${activeIndex}`)}`);
|
|
74
|
+
if (!box || !active) return;
|
|
75
|
+
const top = active.offsetTop;
|
|
76
|
+
const bottom = top + active.offsetHeight;
|
|
77
|
+
if (top < box.scrollTop) box.scrollTop = top;
|
|
78
|
+
else if (bottom > box.scrollTop + box.clientHeight) box.scrollTop = bottom - box.clientHeight;
|
|
79
|
+
}, [open, activeIndex, listId, results]);
|
|
69
80
|
useEffect(() => {
|
|
70
81
|
if (disabled || hasSelection) return;
|
|
71
82
|
const keyword = query.trim();
|
|
@@ -235,9 +246,15 @@ function AutocompleteFieldImpl({
|
|
|
235
246
|
"div",
|
|
236
247
|
{
|
|
237
248
|
id: listId,
|
|
249
|
+
ref: listRef,
|
|
238
250
|
role: "listbox",
|
|
239
251
|
className: "erp-popover__body",
|
|
240
|
-
style: {
|
|
252
|
+
style: {
|
|
253
|
+
maxHeight: 280,
|
|
254
|
+
overflowY: "auto",
|
|
255
|
+
overscrollBehavior: "contain",
|
|
256
|
+
padding: "var(--wp-space-1)"
|
|
257
|
+
},
|
|
241
258
|
children: status === "loading" ? /* @__PURE__ */ jsx("div", { className: "wp-row", style: statusRowStyle, children: /* @__PURE__ */ jsx(Spinner, { size: "sm", label: "\uAC80\uC0C9 \uC911\u2026" }) }) : status === "offline" ? /* @__PURE__ */ jsxs("div", { className: "wp-row", style: statusRowStyle, children: [
|
|
242
259
|
/* @__PURE__ */ jsx(Icon, { name: "unplug", size: 16, style: { color: "var(--wp-text-muted)", flex: "none" } }),
|
|
243
260
|
/* @__PURE__ */ jsx("span", { className: "wp-caption", children: "\uBC31\uC5D4\uB4DC \uBBF8\uC5F0\uB3D9 \u2014 \uAC80\uC0C9 \uACB0\uACFC\uB97C \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4" })
|
package/dist/widgets/index.js
CHANGED
|
@@ -34,7 +34,7 @@ import { PrintSheet } from '../chunk-MYJ2KEIP.js';
|
|
|
34
34
|
export { PrintSheet } from '../chunk-MYJ2KEIP.js';
|
|
35
35
|
import '../chunk-THEP3VWY.js';
|
|
36
36
|
import '../chunk-XQPTSEJC.js';
|
|
37
|
-
export { AutocompleteField, toAutocompleteOptions } from '../chunk-
|
|
37
|
+
export { AutocompleteField, toAutocompleteOptions } from '../chunk-IXC547V6.js';
|
|
38
38
|
import '../chunk-GZB6YLUI.js';
|
|
39
39
|
import { ColumnBoard } from '../chunk-C4JRSZGS.js';
|
|
40
40
|
export { ColumnBoard } from '../chunk-C4JRSZGS.js';
|