@progress/kendo-react-dropdowns
Version:
React DropDowns offer an interface for users to select different items from a list and more. KendoReact Dropdowns package
59 lines (58 loc) • 2.23 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import * as n from "react";
import e from "prop-types";
import { TextBox as b, InputPrefix as g, InputSeparator as h } from "@progress/kendo-react-inputs";
import { searchIcon as I } from "@progress/kendo-svg-icons";
import { useUnstyled as D, classNames as a, uDropDownsBase as t, IconWrap as w } from "@progress/kendo-react-common";
const c = n.forwardRef((r, u) => {
const o = n.useRef(null), { renderListFilterWrapper: m = !1, renderPrefixSeparator: d = !1, placeholder: f, ...p } = r, s = D(), l = s && s.uDropDownsBase;
n.useImperativeHandle(u, () => o.current);
const x = () => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(g, null, /* @__PURE__ */ n.createElement(
w,
{
name: "search",
icon: I,
className: a(t.inputIcon({ c: l }))
}
)), d && /* @__PURE__ */ n.createElement(h, null)), i = /* @__PURE__ */ n.createElement(
b,
{
...p,
ref: o,
className: a(t.searchbox({ c: l })),
value: r.value || "",
onChange: r.onChange,
onKeyDown: r.onKeyDown,
tabIndex: r.tabIndex,
onClick: (y) => y.stopPropagation(),
size: r.size,
fillMode: r.fillMode,
rounded: r.rounded,
prefix: x,
placeholder: f
}
);
return m ? /* @__PURE__ */ n.createElement("div", { className: a(t.listFilter({ c: l })) }, " ", i, " ") : i;
});
c.propTypes = {
value: e.oneOfType([e.string, e.number, e.array]),
tabIndex: e.number,
onChange: e.func,
onKeyDown: e.func,
size: e.oneOf([null, "small", "medium", "large"]),
rounded: e.oneOf([null, "small", "medium", "large", "full"]),
fillMode: e.oneOf([null, "solid", "flat", "outline"]),
renderListFilterWrapper: e.bool,
placeholder: e.string,
renderPrefixSeparator: e.bool
};
c.displayName = "KendoReactListFilter";
export {
c as default
};