@coko/client
Version:
Client side common code for coko apps
31 lines (30 loc) • 752 B
JavaScript
import { debounce as e } from "../../toolkit/funcs.js";
import "react";
import t from "styled-components";
import { jsx as n } from "react/jsx-runtime";
import { AutoComplete as r } from "antd";
//#region src/ui/common/AutoComplete.tsx
var i = t(r)`
width: 100%;
`, a = (t) => {
let { className: r, children: a, debounce: o = !1, debounceTimeout: s = 500, showSearch: c, ...l } = t, u = c;
if (c && typeof c != "boolean" && "onSearch" in c) {
let t = c, n = (e) => t.onSearch(e), r = o ? e(n, s) : n;
u = {
...c,
onSearch: r
};
}
return a ? /* @__PURE__ */ n(i, {
className: r,
showSearch: u,
...l,
children: a
}) : /* @__PURE__ */ n(i, {
className: r,
showSearch: u,
...l
});
};
//#endregion
export { a as default };