diff --git a/.gitignore b/.gitignore index 3f815ea23..a4574580d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,6 @@ node_modules # misc -.DS_Store \ No newline at end of file +.DS_Store +apps/wr/.next/**/* +apps/fo/.next/**/* \ No newline at end of file diff --git a/packages/common/business_components/src/ui/date_picker/date-picker.css b/packages/common/business_components/src/ui/date_picker/date-picker.css new file mode 100644 index 000000000..bf9415652 --- /dev/null +++ b/packages/common/business_components/src/ui/date_picker/date-picker.css @@ -0,0 +1,7 @@ +@tailwind components; + +@layer components { + .date-picker-trigger { + @apply h-[3rem] w-[12rem] justify-between border-input !bg-background px-4 py-2 text-left text-[1.3rem] font-normal leading-none text-muted-foreground hover:!bg-accent; + } +} diff --git a/packages/common/business_components/src/ui/date_picker/index.tsx b/packages/common/business_components/src/ui/date_picker/index.tsx new file mode 100644 index 000000000..37dbcb096 --- /dev/null +++ b/packages/common/business_components/src/ui/date_picker/index.tsx @@ -0,0 +1,46 @@ +"use client"; + +import "./date-picker.css"; + +import { format } from "date-fns"; +import { CalendarIcon } from "lucide-react"; +import type { DayPickerSingleProps } from "react-day-picker"; + +import { Button, Calendar, Popover, PopoverContent, PopoverTrigger } from "@common/components/ui"; +import { cn } from "../../lib/utils"; +import { FormControl } from "../form"; + +type DatePickerProps = DayPickerSingleProps & { field: { value: Date; onChange: (date: Date | undefined) => void } }; + +export function DatePicker({ field }: DatePickerProps) { + return ( + + + + + + + + + + + ); +} diff --git a/packages/common/business_components/src/ui/form_ui/index.tsx b/packages/common/business_components/src/ui/form_ui/index.tsx new file mode 100644 index 000000000..bd9930c3c --- /dev/null +++ b/packages/common/business_components/src/ui/form_ui/index.tsx @@ -0,0 +1,19 @@ +import React from "react"; +import { FormControl, FormItem, FormLabel, FormMessage } from "../form"; + +const FormUi = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes & {label:string|undefined} +>(({children, label},ref)=>{ + return ( + + {label?{label}:<>} + + {children} + + + + ) +}) +FormUi.displayName = 'FormUi'; +export { FormUi }; diff --git a/packages/common/business_components/src/ui/index.ts b/packages/common/business_components/src/ui/index.ts index fba8a76ad..795fffa2a 100644 --- a/packages/common/business_components/src/ui/index.ts +++ b/packages/common/business_components/src/ui/index.ts @@ -1,9 +1,12 @@ export * from "./chart"; +export * from "./date_picker"; export * from "./file-upload"; export * from "./form"; +export * from "./form_ui"; +export * from "./scroll"; export * from "./search_form"; export * from "./search_input"; export * from "./search_input_select"; export * from "./select"; export * from "./table"; -export * from "./scroll" + diff --git a/packages/common/business_components/src/ui/scroll/index.tsx b/packages/common/business_components/src/ui/scroll/index.tsx index cf253cf17..cd32e8856 100644 --- a/packages/common/business_components/src/ui/scroll/index.tsx +++ b/packages/common/business_components/src/ui/scroll/index.tsx @@ -1,7 +1,7 @@ -import * as React from "react" import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area" +import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../../lib/utils" const ScrollArea = React.forwardRef< React.ElementRef, diff --git a/packages/common/business_components/src/ui/search_form/index.tsx b/packages/common/business_components/src/ui/search_form/index.tsx index 45444a68f..7c6024748 100644 --- a/packages/common/business_components/src/ui/search_form/index.tsx +++ b/packages/common/business_components/src/ui/search_form/index.tsx @@ -1,9 +1,9 @@ function SearchDiv ({children}:{ children: React.ReactNode; }) { return ( -
+
{children}
) } -export { SearchDiv }; \ No newline at end of file +export { SearchDiv }; diff --git a/packages/common/business_components/src/ui/search_input/index.tsx b/packages/common/business_components/src/ui/search_input/index.tsx index f933428fc..61ff8ec3f 100644 --- a/packages/common/business_components/src/ui/search_input/index.tsx +++ b/packages/common/business_components/src/ui/search_input/index.tsx @@ -5,10 +5,9 @@ const SearchInput = React.forwardRef< HTMLDivElement& HTMLInputElement, React.HTMLAttributes & {className:string, label:string}> (({className, label}, ref) => { - console.log(ref); return (
- {label && } + {label && }
) diff --git a/packages/common/business_components/src/ui/search_input_select/index.tsx b/packages/common/business_components/src/ui/search_input_select/index.tsx index b00615e4b..c6face023 100644 --- a/packages/common/business_components/src/ui/search_input_select/index.tsx +++ b/packages/common/business_components/src/ui/search_input_select/index.tsx @@ -14,12 +14,15 @@ export type SelectDataType = { * @param refs - React.forwardRef | null 입력값 ref * @returns React.FC */ -const SearchInputSelect = React.forwardRefvoid}>(({className, label, selectData, onSelectValue}, refs) => { +const SearchInputSelect = React.forwardRefvoid, textValue:string, setText:(val:string)=>void}>(({className, label, selectData, onSelectValue, textValue, setText}) => { + const changeText=(e:React.ChangeEvent)=>{ + if(e?.target?.value) setText(e.target.value) + } return (
- {label && } + {label && }
- + - + diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index 1e2345a88..c96cabe7c 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -1,49 +1,49 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@common/components"; import UiPageNations from "./uiPageNations"; - - -type UiTableProps = { - headName: React.ReactNode|undefined; + + +type UiTableProps = { + headName: React.ReactNode | undefined; tableData: { [key: string]: string | number | boolean }[]; headlist: UiHeadProps[]; pageSize: number; total: number; - children: React.ReactNode|undefined; + children: React.ReactNode | undefined; } -type UiHeadProps={ - id:string; - title:string; +type UiHeadProps = { + id: string; + title: string; } -export function UiTable({ tableData, headlist,pageSize , total, children,headName}: UiTableProps) { +export function UiTable({ tableData, headlist, pageSize, total, children, headName }: UiTableProps) { const cur = 1; - return ( - <> - {headName?headName:<>} - - - {children? <>{children}: - {headlist?.map((head) => ( - {head.title} - ))} - } - - - - {tableData?.map((el: { [key: string]: string | number | boolean },index) => ( - - {headlist.map((head) => ( - {el[head.id]} - ))} - - + return ( + <> + {headName ? headName : <>} +
+ + {children ? <>{children} : + {headlist?.map((head) => ( + {head.title} ))} - - -
- {total <=0? <>: } - - ); - } \ No newline at end of file + } + + + + {tableData?.map((el: { [key: string]: string | number | boolean }, index) => ( + + {headlist.map((head) => ( + {el[head.id]} + ))} + + + ))} + + + + {total <= 0 ? <> : } + + ); +}