From 12f6f42b0e63a70efa19fa6abcd2e6758745669d Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Fri, 7 Mar 2025 11:24:22 +0900 Subject: [PATCH 01/14] =?UTF-8?q?selectbox=20=ED=81=AC=EA=B8=B0=20?= =?UTF-8?q?=EC=A1=B0=EC=A0=88=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20?= =?UTF-8?q?=EB=B0=9B=EC=9D=84=EC=88=98=EC=9E=88=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business_components/src/ui/select/index.tsx | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/common/business_components/src/ui/select/index.tsx b/packages/common/business_components/src/ui/select/index.tsx index 72f304caa..370ee52e8 100644 --- a/packages/common/business_components/src/ui/select/index.tsx +++ b/packages/common/business_components/src/ui/select/index.tsx @@ -7,12 +7,8 @@ const styles = { marginLeft : '2rem', display : 'flex' } as React.CSSProperties, - selectStyle : { - marginLeft: '1rem', - width:'8rem' - } as React.CSSProperties, labelStyle : { - margin:'0.8rem 0.8rem 0.8rem 0.8rem', + margin:'0.8rem 0.8rem 0.8rem 1rem', fontSize: '10px', } as React.CSSProperties } @@ -22,14 +18,14 @@ interface SelectBox1 { val:string } -function SelectBox(props: {label : string, selectArray: SelectBox1[]}){ - const placeHolder = props.selectArray.length > 0 ? props.selectArray[0].text : ""; +function SelectBox(props: {label : string, selectArray: SelectBox1[], styleClassName : string, styleSelect : React.CSSProperties}){ + const placeHolder = props.selectArray?.[0]?.text ?? ""; return ( -
+
{props.label && } - + From 37c2901976a0fd6494a3a814749cc3b161a25d3e Mon Sep 17 00:00:00 2001 From: leedj312 Date: Fri, 7 Mar 2025 13:03:09 +0900 Subject: [PATCH 02/14] =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=B8=94=20=ED=83=80?= =?UTF-8?q?=EC=9D=B4=ED=8B=80=20=EB=85=B8=EB=93=9C=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EB=B0=8F=20headlist=20=EC=9D=B8=ED=84=B0=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=8A=A4=20=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ui/table/index.tsx | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index 17360af12..8f1e0761d 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -3,22 +3,26 @@ import UiPageNations from "./uiPageNations"; interface UiTableProps { - headName: string; - publicReuseFacility: any[]; - headlist: { id: string; title: string; }[]; + headName: React.ReactNode|undefined; + publicReuseFacility: { [key: string]: string | number | boolean }[]; + headlist: UiHeadProps[]; pageSize: number; total: number; children: React.ReactNode|undefined; } -export function UiTable(UiTableProps: UiTableProps) { - const { publicReuseFacility, headlist,pageSize , total, children,headName} = UiTableProps; - const cur = 1; +interface UiHeadProps{ + id:string; + title:string; + +} +export function UiTable({ publicReuseFacility, headlist,pageSize , total, children,headName}: UiTableProps) { + const cur = 1; return ( <> -

{headName}

+ {headName?headName:<>} {children? <>{children}: @@ -29,7 +33,7 @@ export function UiTable(UiTableProps: UiTableProps) { - {publicReuseFacility.map((el: any,index) => ( + {publicReuseFacility.map((el: { [key: string]: string | number | boolean },index) => ( {headlist.map((head) => ( {el[head.id]} From 7c03f04078e289e9c252ce7edd4df8ea3892800c Mon Sep 17 00:00:00 2001 From: leedj312 Date: Fri, 7 Mar 2025 13:24:09 +0900 Subject: [PATCH 03/14] =?UTF-8?q?type=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/common/business_components/src/ui/table/index.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index 8f1e0761d..c1d048a1f 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -2,7 +2,7 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@ import UiPageNations from "./uiPageNations"; -interface UiTableProps { +type UiTableProps = { headName: React.ReactNode|undefined; publicReuseFacility: { [key: string]: string | number | boolean }[]; headlist: UiHeadProps[]; @@ -11,8 +11,7 @@ interface UiTableProps { children: React.ReactNode|undefined; } - -interface UiHeadProps{ +type UiHeadProps={ id:string; title:string; From 87031def3c7d77e5867290ceffd1b228edcdba31 Mon Sep 17 00:00:00 2001 From: truthwing Date: Fri, 7 Mar 2025 18:11:26 +0900 Subject: [PATCH 04/14] =?UTF-8?q?searchbar=20=EA=B5=AC=EC=A1=B0=20?= =?UTF-8?q?=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/common/business_components/README.md | 17 ++++++++-- .../src/ui/search_form/index.tsx | 14 +------- .../src/ui/select/index.tsx | 32 ++++++++----------- 3 files changed, 28 insertions(+), 35 deletions(-) diff --git a/packages/common/business_components/README.md b/packages/common/business_components/README.md index 597f49a5c..670a8ac47 100644 --- a/packages/common/business_components/README.md +++ b/packages/common/business_components/README.md @@ -1,6 +1,6 @@ ## business_components 패키지 ### 원앤올에서 제공받는 컴포넌트 외에 업무 파트에서 사용할 수 있는 별도 components 패키지지 -  1) 설정 +  1) 환경설정     (1) tsconfig.json 'path'에 '@common/business_components' 변수를 추가 ```json @@ -8,7 +8,7 @@ "@/*": ["./*"], "@common/components/*": ["../../packages/common/components/src/*"], "@common/components": ["../../packages/common/components/src/index"], - // 작성구문문 + //아래에 해당하는 부분을 추가해줘야함. "@common/business_components/*": ["../../packages/common/business_components/src/*"], "@common/business_components": ["../../packages/common/business_components/src/index"] } @@ -19,4 +19,15 @@ "@common/business_components": "workspace:*", "next": "15.1.7" }, -``` \ No newline at end of file +``` + +    (3) tailwind.config.ts 추가 +``` json +content: [ + "./app/**/*.{js,ts,jsx,tsx,mdx}", + "../../packages/common/components/src/ui/**/*.{js,ts,jsx,tsx,mdx}", + //아래에 해당하는 부분을 추가해줘야함. + "../../packages/common/business_components/src/ui/**/*.{js,ts,jsx,tsx,mdx}", +], +``` + 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 13391dc01..45444a68f 100644 --- a/packages/common/business_components/src/ui/search_form/index.tsx +++ b/packages/common/business_components/src/ui/search_form/index.tsx @@ -1,18 +1,6 @@ -/** - * 검색영역 스타일 - */ -const styles = { - divStyle : { - border: '1px solid black', - margin: '1rem', - display: 'flex', - borderRadius: '1rem' - } as React.CSSProperties -} - function SearchDiv ({children}:{ children: React.ReactNode; }) { return ( -
+
{children}
) diff --git a/packages/common/business_components/src/ui/select/index.tsx b/packages/common/business_components/src/ui/select/index.tsx index 370ee52e8..d1adbb970 100644 --- a/packages/common/business_components/src/ui/select/index.tsx +++ b/packages/common/business_components/src/ui/select/index.tsx @@ -1,41 +1,35 @@ import { Label } from "@common/components"; +import React from "react"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./lib/selectBox"; /** 차트 기본 스타일 */ -const styles = { - selectBoxDiv : { - marginLeft : '2rem', - display : 'flex' - } as React.CSSProperties, - labelStyle : { - margin:'0.8rem 0.8rem 0.8rem 1rem', - fontSize: '10px', - } as React.CSSProperties -} - interface SelectBox1 { text:string, val:string } -function SelectBox(props: {label : string, selectArray: SelectBox1[], styleClassName : string, styleSelect : React.CSSProperties}){ - const placeHolder = props.selectArray?.[0]?.text ?? ""; + +const SelectBox = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes & {label:string, className:string, selectArray:SelectBox1[]} +>(({ label, className, selectArray }, ref)=>{ + const placeHolder = selectArray?.[0]?.text ?? ""; return ( -
- {props.label && } +
+ {label && }
) -} +}) -export { SelectBox }; \ No newline at end of file +export { SelectBox }; From 021a282655faeed591782329d0971d8d46c64e4b Mon Sep 17 00:00:00 2001 From: truthwing Date: Mon, 10 Mar 2025 13:26:39 +0900 Subject: [PATCH 05/14] =?UTF-8?q?search=20bar=EC=97=90=20=EA=B0=92=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=ED=95=98=EB=8A=94=20=ED=98=95=ED=83=9C?= =?UTF-8?q?=EB=A1=9C=20component=20=EA=B5=AC=ED=98=84.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business_components/src/ui/index.ts | 3 ++ .../src/ui/search_input/index.tsx | 16 ++++++++ .../src/ui/search_input_select/index.tsx | 38 +++++++++++++++++++ .../src/ui/select/index.tsx | 6 +-- 4 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 packages/common/business_components/src/ui/search_input/index.tsx create mode 100644 packages/common/business_components/src/ui/search_input_select/index.tsx diff --git a/packages/common/business_components/src/ui/index.ts b/packages/common/business_components/src/ui/index.ts index 1876f2b50..6bf01157c 100644 --- a/packages/common/business_components/src/ui/index.ts +++ b/packages/common/business_components/src/ui/index.ts @@ -2,5 +2,8 @@ export * from "./chart"; export * from "./file-upload"; export * from "./form"; export * from "./search_form"; +export * from "./search_input"; +export * from "./search_input_select"; export * from "./select"; export * from "./table"; + diff --git a/packages/common/business_components/src/ui/search_input/index.tsx b/packages/common/business_components/src/ui/search_input/index.tsx new file mode 100644 index 000000000..f933428fc --- /dev/null +++ b/packages/common/business_components/src/ui/search_input/index.tsx @@ -0,0 +1,16 @@ +import { Input, Label } from "@common/components"; +import React from "react"; + +const SearchInput = React.forwardRef< + HTMLDivElement& HTMLInputElement, + React.HTMLAttributes & {className:string, label:string}> +(({className, label}, ref) => { + console.log(ref); + return ( +
+ {label && } + +
+ ) +}); +export { SearchInput }; 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 new file mode 100644 index 000000000..b00615e4b --- /dev/null +++ b/packages/common/business_components/src/ui/search_input_select/index.tsx @@ -0,0 +1,38 @@ +import { Input, Label } from "@common/components"; +import React from "react"; +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../select/lib/selectBox"; +export type SelectDataType = { + text: string; + val: string; +} +/** + * 검색 입력 및 선택 컴포넌트 + * @param className - string tailwindcss class + * @param label - string label + * @param selectData - SelectDataType[] 선택 데이터 + * @param onSelectValue - (val:string)=>void 선택 값 콜백 + * @param refs - React.forwardRef | null 입력값 ref + * @returns React.FC + */ +const SearchInputSelect = React.forwardRefvoid}>(({className, label, selectData, onSelectValue}, refs) => { + return ( +
+ {label && } +
+ + +
+
+ ) +}); +export { SearchInputSelect }; diff --git a/packages/common/business_components/src/ui/select/index.tsx b/packages/common/business_components/src/ui/select/index.tsx index d1adbb970..dd92774fe 100644 --- a/packages/common/business_components/src/ui/select/index.tsx +++ b/packages/common/business_components/src/ui/select/index.tsx @@ -16,10 +16,10 @@ const SelectBox = React.forwardRef< const placeHolder = selectArray?.[0]?.text ?? ""; return ( -
- {label && } +
+ {label && } +
{children? <>{children}: - {headlist.map((head) => ( + {headlist?.map((head) => ( {head.title} ))} } - - {publicReuseFacility.map((el: { [key: string]: string | number | boolean },index) => ( + + {tableData?.map((el: { [key: string]: string | number | boolean },index) => ( {headlist.map((head) => ( {el[head.id]} @@ -43,7 +43,7 @@ export function UiTable({ publicReuseFacility, headlist,pageSize , total, childr
- + {total <=0? <>: } ); } \ No newline at end of file From e4d5e21b2944169449844be2842ca3f606d8dc35 Mon Sep 17 00:00:00 2001 From: truthwing Date: Mon, 10 Mar 2025 18:25:06 +0900 Subject: [PATCH 09/14] =?UTF-8?q?=EC=9E=85=ED=8F=AC=ED=8A=B8=20=EA=B5=AC?= =?UTF-8?q?=EC=A1=B0=20=EC=88=98=EC=A0=95=20=EC=84=9C=EC=B9=98=ED=8F=BC=20?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=20=ED=81=AC=EA=B8=B0=20=EC=A0=81=EC=9A=A9=20?= =?UTF-8?q?=EA=B8=80=EC=9E=90=ED=81=AC=EA=B8=B0=202xl=EB=A1=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +- .../src/ui/scroll/index.tsx | 4 +- .../src/ui/search_form/index.tsx | 4 +- .../src/ui/select/index.tsx | 4 +- .../src/ui/table/index.tsx | 72 +++++++++---------- 5 files changed, 45 insertions(+), 43 deletions(-) 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/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/select/index.tsx b/packages/common/business_components/src/ui/select/index.tsx index 9f5f6d25c..d039c2c2a 100644 --- a/packages/common/business_components/src/ui/select/index.tsx +++ b/packages/common/business_components/src/ui/select/index.tsx @@ -17,9 +17,9 @@ const SelectBox = React.forwardRef< return (
- {label && } + {label && }
) From 8dfa052ea6c9214a73cd4a13513feefd88fd4823 Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Tue, 11 Mar 2025 13:55:14 +0900 Subject: [PATCH 12/14] =?UTF-8?q?search=20=EC=98=81=EC=97=AD=20label=20?= =?UTF-8?q?=ED=81=AC=EA=B8=B0=20lg=20>=202xl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/business_components/src/ui/search_input/index.tsx | 2 +- .../business_components/src/ui/search_input_select/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 936b8ddbc..f2d1caeb4 100644 --- a/packages/common/business_components/src/ui/search_input/index.tsx +++ b/packages/common/business_components/src/ui/search_input/index.tsx @@ -8,7 +8,7 @@ const SearchInput = React.forwardRef< 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..1496d9ddd 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 @@ -17,7 +17,7 @@ export type SelectDataType = { const SearchInputSelect = React.forwardRefvoid}>(({className, label, selectData, onSelectValue}, refs) => { return (
- {label && } + {label && }