Initial commit

This commit is contained in:
2025-10-04 18:22:24 +03:00
commit 2852c2c054
291 changed files with 38109 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
import { DownOutlined } from "@ant-design/icons";
import { Select } from "antd";
import { ProSelectProps } from "./types";
export default function ProSelect({
optionList,
valueField = "id",
displayField = "name",
autoComplete,
showDialog,
ref,
defaultOpen = false,
...rest
}: ProSelectProps) {
return (
<>
<Select
listHeight={150}
getPopupContainer={(trigger) => trigger.parentNode} // to fix calender scrolling with page
{...rest}
{...(autoComplete
? { showSearch: true, optionFilterProp: "children" }
: {})}
{...(ref ? { ref } : {})}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
if (e.detail === 2 && showDialog) {
showDialog();
}
}}
defaultOpen={defaultOpen}
options={optionList?.map((o) => ({
value: o[valueField],
key: o[valueField],
label: o[displayField],
}))}
showSearch
suffixIcon={<DownOutlined style={{ marginRight: 10 }} />}
/>
</>
);
}