Merge remote-tracking branch 'origin/iipbs/wr/dev' into iipbs/sn/dev_kic
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
@tailwind components;
|
||||
|
||||
@layer components {
|
||||
.fileup_root {
|
||||
@apply relative rounded-lg bg-background p-2;
|
||||
}
|
||||
|
||||
.fileup_dropzone {
|
||||
@apply border border-border outline-dashed outline-1 outline-border;
|
||||
}
|
||||
|
||||
.fileup_panel {
|
||||
@apply flex w-full flex-col items-center justify-center p-1;
|
||||
}
|
||||
|
||||
.fileup_icon {
|
||||
@apply h-4 w-5 text-label;
|
||||
}
|
||||
|
||||
.fileup_hint {
|
||||
@apply mb-1 text-sm text-label;
|
||||
}
|
||||
|
||||
.fileup_hint_strong {
|
||||
@apply font-semibold text-foreground;
|
||||
}
|
||||
|
||||
.fileup_meta {
|
||||
@apply text-xs text-label;
|
||||
}
|
||||
|
||||
.fileup_item {
|
||||
@apply text-foreground;
|
||||
}
|
||||
|
||||
.fileup_item_active {
|
||||
@apply bg-muted;
|
||||
}
|
||||
|
||||
.fileup_item_name {
|
||||
@apply flex h-full w-4/5 items-center gap-1.5 overflow-hidden font-medium leading-normal tracking-tight;
|
||||
}
|
||||
|
||||
.fileup_item_remove {
|
||||
@apply text-label;
|
||||
}
|
||||
|
||||
.fileup_item_remove_icon {
|
||||
@apply h-4 w-4 transition-colors duration-200 ease-in-out hover:stroke-destructive;
|
||||
}
|
||||
|
||||
.fileup_input {
|
||||
@apply border;
|
||||
}
|
||||
|
||||
.fileup_input_idle {
|
||||
@apply border-border;
|
||||
}
|
||||
|
||||
.fileup_input_accept {
|
||||
@apply border-primary;
|
||||
}
|
||||
|
||||
.fileup_input_reject {
|
||||
@apply border-destructive;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
"use client";
|
||||
import "./file-upload.css";
|
||||
|
||||
import { CloudUpload, Paperclip } from "lucide-react";
|
||||
import { FileInput, FileUploader, FileUploaderContent, FileUploaderItem } from "./lib/file_upload";
|
||||
|
||||
@@ -36,19 +38,19 @@ export const FileUpload =
|
||||
onValueChange={setFiles}
|
||||
dropzoneOptions={dropZoneConfig}
|
||||
acceptName={fileTypes}
|
||||
className="relative bg-background rounded-lg p-2"
|
||||
className="fileup_root"
|
||||
>
|
||||
<FileInput
|
||||
id="fileInput"
|
||||
className="outline-dashed outline-1 outline-slate-500"
|
||||
className="fileup_dropzone"
|
||||
>
|
||||
<div className="flex items-center justify-center flex-col p-1 w-full ">
|
||||
<CloudUpload className='text-gray-500 w-5 h-4' />
|
||||
<p className="mb-1 text-sm text-gray-500 dark:text-gray-400">
|
||||
<span className="font-semibold">클릭 후 업로드 </span>
|
||||
<div className="fileup_panel">
|
||||
<CloudUpload className='fileup_icon' />
|
||||
<p className="fileup_hint">
|
||||
<span className="fileup_hint_strong">클릭 후 업로드 </span>
|
||||
혹은 파일을 드래그 해주세요
|
||||
</p>
|
||||
<p className="text-xs text-gray-500 dark:text-gray-400">
|
||||
<p className="fileup_meta">
|
||||
{!fileTypes?"SVG, PNG, JPG, GIF":fileTypes}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -344,14 +344,14 @@ export const FileUploaderItem = forwardRef<
|
||||
ref={ref}
|
||||
className={cn(
|
||||
buttonVariants({ variant: "ghost" }),
|
||||
"h-9 justify-between cursor-pointer relative w-full",
|
||||
"fileup_item h-9 justify-between cursor-pointer relative w-full",
|
||||
className,
|
||||
isSelected ? "bg-muted" : "",
|
||||
isSelected ? "fileup_item_active" : "",
|
||||
)}
|
||||
{...props}
|
||||
|
||||
>
|
||||
<div className="font-medium leading-normal tracking-tight flex items-center gap-1.5 h-full !w-4/5 overflow-hidden "
|
||||
<div className="fileup_item_name"
|
||||
onClick={() =>{onFileClick?.(index)
|
||||
}}>
|
||||
{children}
|
||||
@@ -359,7 +359,7 @@ export const FileUploaderItem = forwardRef<
|
||||
<button
|
||||
type="button"
|
||||
className={cn(
|
||||
"absolute",
|
||||
"fileup_item_remove absolute",
|
||||
"!w-1/5 z-50",
|
||||
direction === "rtl"
|
||||
? "left-1 top-1/2 -translate-y-1/2"
|
||||
@@ -372,7 +372,7 @@ export const FileUploaderItem = forwardRef<
|
||||
removeFileFromSet(index)}}
|
||||
>
|
||||
<span className="sr-only">remove item {index}</span>
|
||||
<RemoveIcon className="w-4 h-4 hover:stroke-destructive duration-200 ease-in-out" />
|
||||
<RemoveIcon className="fileup_item_remove_icon" />
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
@@ -396,14 +396,12 @@ export const FileInput = forwardRef<
|
||||
>
|
||||
<div
|
||||
className={cn(
|
||||
`w-full rounded-lg duration-300 ease-in-out
|
||||
${
|
||||
dropzoneState.isDragAccept
|
||||
? "border-green-500"
|
||||
: dropzoneState.isDragReject || isFileTooBig
|
||||
? "border-red-500"
|
||||
: "border-gray-300"
|
||||
}`,
|
||||
"fileup_input w-full rounded-lg duration-300 ease-in-out",
|
||||
dropzoneState.isDragAccept && "fileup_input_accept",
|
||||
(dropzoneState.isDragReject || isFileTooBig) && "fileup_input_reject",
|
||||
!dropzoneState.isDragAccept &&
|
||||
!(dropzoneState.isDragReject || isFileTooBig) &&
|
||||
"fileup_input_idle",
|
||||
className,
|
||||
)}
|
||||
{...rootProps}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
@tailwind components;
|
||||
|
||||
@layer components {
|
||||
.formui_label {
|
||||
@apply text-xl;
|
||||
}
|
||||
|
||||
.formui_option_wrap {
|
||||
@apply float-right;
|
||||
}
|
||||
|
||||
.formui_option {
|
||||
@apply flex items-center gap-2;
|
||||
}
|
||||
|
||||
.formui_option_label {
|
||||
@apply w-28 text-xl text-label;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
import "./form-ui.css";
|
||||
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { FormControl, FormItem, FormLabel, FormMessage } from "../form";
|
||||
import { Button, Checkbox } from "@common/components/ui";
|
||||
import { Checkbox } from "@common/components/ui";
|
||||
|
||||
export const BZNM_TOT_NO = '종사업자등록번호';
|
||||
export const CANDIDATE = '공급처 후보지 선택(필수아님)';
|
||||
export const BZNM_TOT_NO = "종사업자등록번호";
|
||||
export const CANDIDATE = "공급처 후보지 선택(필수아님)";
|
||||
|
||||
interface FormUiProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
label?: string;
|
||||
@@ -29,17 +31,19 @@ const FormUi = React.forwardRef<HTMLDivElement, FormUiProps>(
|
||||
}, [onCheckboxChange]);
|
||||
return (
|
||||
<FormItem ref={ref}>
|
||||
{label && <FormLabel className="text-xl">{label}</FormLabel>}
|
||||
{label && <FormLabel className="formui_label">{label}</FormLabel>}
|
||||
{label === BZNM_TOT_NO && (
|
||||
<>
|
||||
<div className="float-right">
|
||||
<div className="flex items-center gap-2">
|
||||
<Checkbox
|
||||
id="check"
|
||||
<div className="formui_option_wrap">
|
||||
<div className="formui_option">
|
||||
<Checkbox
|
||||
id="check"
|
||||
checked={isChecked}
|
||||
onCheckedChange={handleCheckboxChange}
|
||||
/>
|
||||
<label className="w-28 text-xl text-gray-600" htmlFor="check">해당없음</label>
|
||||
<label className="formui_option_label" htmlFor="check">
|
||||
해당없음
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{children}
|
||||
@@ -48,14 +52,14 @@ const FormUi = React.forwardRef<HTMLDivElement, FormUiProps>(
|
||||
{label === CANDIDATE && (
|
||||
<FormControl>
|
||||
{children}
|
||||
</FormControl>
|
||||
</FormControl>
|
||||
)}
|
||||
{label !== BZNM_TOT_NO && label !== CANDIDATE && (
|
||||
<FormControl>
|
||||
{React.isValidElement(children) && isDisabled
|
||||
? React.cloneElement(children, {
|
||||
? React.cloneElement(children, {
|
||||
disabled: isDisabled,
|
||||
...(children.props as FormElementProps)
|
||||
...(children.props as FormElementProps),
|
||||
})
|
||||
: children}
|
||||
</FormControl>
|
||||
@@ -66,5 +70,5 @@ const FormUi = React.forwardRef<HTMLDivElement, FormUiProps>(
|
||||
}
|
||||
);
|
||||
|
||||
FormUi.displayName = 'FormUi';
|
||||
export { FormUi };
|
||||
FormUi.displayName = "FormUi";
|
||||
export { FormUi };
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import "./search-icon.css";
|
||||
|
||||
export default function SearchIcon() {
|
||||
return (
|
||||
<svg
|
||||
@@ -6,7 +8,7 @@ export default function SearchIcon() {
|
||||
viewBox="0 0 24 24"
|
||||
strokeWidth={1.5}
|
||||
stroke="currentColor"
|
||||
className="w-6 h-6 text-gray-700"
|
||||
className="searchicon_svg"
|
||||
>
|
||||
<path
|
||||
strokeLinecap="round"
|
||||
@@ -15,4 +17,4 @@ export default function SearchIcon() {
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
@tailwind components;
|
||||
|
||||
@layer components {
|
||||
.searchicon_svg {
|
||||
@apply h-6 w-6 text-label;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
import "./search-input.css";
|
||||
|
||||
import { Input, Label } from "@common/components";
|
||||
import React from "react";
|
||||
import { cn } from "../../lib/utils";
|
||||
|
||||
const SearchInput = React.forwardRef<HTMLInputElement, {className:string, label:string, textValue:string, setText:(val:string)=>void}>(({className, label, textValue, setText}, ref) => {
|
||||
const changeText=(e:React.ChangeEvent<HTMLInputElement>)=>{
|
||||
@@ -20,9 +23,9 @@ const SearchInput = React.forwardRef<HTMLInputElement, {className:string, label:
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={className+" flex items-center"} >
|
||||
{label && <Label className="w-20 text-xl text-gray-600">{label}</Label>}
|
||||
<Input className="!text-lg flex-1 w-3/4 h-13 border rounded" value={textValue} onChange={changeText} onKeyUp={keyUp}></Input>
|
||||
<div className={cn("searchinput_root", className)} >
|
||||
{label && <Label className="searchinput_label">{label}</Label>}
|
||||
<Input ref={ref} className="searchinput_field" value={textValue} onChange={changeText} onKeyUp={keyUp}></Input>
|
||||
</div>
|
||||
)
|
||||
});
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
@tailwind components;
|
||||
|
||||
@layer components {
|
||||
.searchinput_root {
|
||||
@apply flex items-center;
|
||||
}
|
||||
|
||||
.searchinput_label {
|
||||
@apply w-20 text-xl;
|
||||
}
|
||||
|
||||
.searchinput_field {
|
||||
@apply h-14 w-3/4 flex-1 rounded-md border border-input text-lg;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
import "./search-input-select.css";
|
||||
|
||||
import { Input, Label } from "@common/components";
|
||||
import React from "react";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../select/lib/selectBox";
|
||||
import { cn } from "../../lib/utils";
|
||||
export type SelectDataType = {
|
||||
text: string;
|
||||
val: string;
|
||||
@@ -23,12 +26,12 @@ const SearchInputSelect = React.forwardRef<HTMLInputElement, {className:string,
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={className+" flex items-center"} >
|
||||
{label && <Label className="w-20 text-xl text-gray-600">{label}</Label>}
|
||||
<div className="flex w-full items-center">
|
||||
<Input className="w-2/3 text-xl h-14 p-2 border rounded" value={textValue} onChange={changeText} />
|
||||
<div className={cn("searchinputselect_root", className)} >
|
||||
{label && <Label className="searchinputselect_label">{label}</Label>}
|
||||
<div className="searchinputselect_controls">
|
||||
<Input ref={ref} className="searchinputselect_input" value={textValue} onChange={changeText} />
|
||||
<Select onValueChange={onSelectValue} value={selectValue}>
|
||||
<SelectTrigger className="ml-2 w-1/3" >
|
||||
<SelectTrigger className="searchinputselect_select" >
|
||||
<SelectValue placeholder={selectData?.[0]?.text ?? ""} />
|
||||
</SelectTrigger>
|
||||
{/* <SelectContent ref={refs ? (refs as unknown as RefType)?.selectValue : null}> */}
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
@tailwind components;
|
||||
|
||||
@layer components {
|
||||
.searchinputselect_root {
|
||||
@apply flex items-center;
|
||||
}
|
||||
|
||||
.searchinputselect_label {
|
||||
@apply w-20 text-xl;
|
||||
}
|
||||
|
||||
.searchinputselect_controls {
|
||||
@apply flex w-full items-center;
|
||||
}
|
||||
|
||||
.searchinputselect_input {
|
||||
@apply h-14 w-2/3 rounded-md border border-input p-2 text-xl;
|
||||
}
|
||||
|
||||
.searchinputselect_select {
|
||||
@apply ml-2 w-1/3;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import "./select.css";
|
||||
|
||||
// selectBox
|
||||
|
||||
import { Label } from "@common/components";
|
||||
@@ -10,6 +12,7 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "./lib/selectBox";
|
||||
import { cn } from "../../lib/utils";
|
||||
|
||||
/** 차트 기본 스타일 */
|
||||
interface SelectBox1 {
|
||||
@@ -43,7 +46,7 @@ const SelectBox = React.forwardRef<
|
||||
value,
|
||||
readOnly = false,
|
||||
selectContentClass,
|
||||
labelClass = "w-20 whitespace-nowrap text-xl text-gray-600",
|
||||
labelClass = "w-20 whitespace-nowrap text-xl",
|
||||
},
|
||||
ref,
|
||||
) => {
|
||||
@@ -72,9 +75,9 @@ const SelectBox = React.forwardRef<
|
||||
: undefined;
|
||||
|
||||
return (
|
||||
<div className={className + " flex items-center"} ref={ref}>
|
||||
<div className={cn("selectbox_root", className)} ref={ref}>
|
||||
{label && (
|
||||
<Label className={labelClass}>
|
||||
<Label className={cn("selectbox_label", labelClass)}>
|
||||
{label}
|
||||
</Label>
|
||||
)}
|
||||
@@ -92,9 +95,7 @@ const SelectBox = React.forwardRef<
|
||||
value={currentValue}
|
||||
// disabled={readOnly} //물재이용 감리 지적사항으로 일단 주석처리
|
||||
>
|
||||
<SelectTrigger
|
||||
className={selectClass ? selectClass : "flex-1 rounded border p-2"}
|
||||
>
|
||||
<SelectTrigger className={cn("selectbox_trigger", selectClass)}>
|
||||
<SelectValue placeholder={placeHolder} />
|
||||
</SelectTrigger>
|
||||
<SelectContent className={selectContentClass}>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
@tailwind components;
|
||||
|
||||
@layer components {
|
||||
.selectbox_root {
|
||||
@apply flex items-center;
|
||||
}
|
||||
|
||||
.selectbox_label {
|
||||
@apply text-label;
|
||||
}
|
||||
|
||||
.selectbox_trigger {
|
||||
@apply flex-1 rounded-md border border-input bg-form px-3 py-2;
|
||||
}
|
||||
}
|
||||
@@ -1,46 +1,61 @@
|
||||
import { Tabs, TabsList, TabsTrigger } from '@common/components/ui';
|
||||
import React from 'react';
|
||||
import "./tab.css";
|
||||
|
||||
import { Tabs, TabsList, TabsTrigger } from "@common/components/ui";
|
||||
import React from "react";
|
||||
import { cn } from "../../lib/utils";
|
||||
|
||||
interface TabItem {
|
||||
value: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
interface UITabProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'dir'> {
|
||||
interface UITabProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "dir"> {
|
||||
defaultValue?: string;
|
||||
tabList: TabItem[];
|
||||
children?: React.ReactNode;
|
||||
onValueChange?: (value: string) => void;
|
||||
variant?: "default" | "underline" | "outline";
|
||||
}
|
||||
|
||||
const UITab = React.forwardRef<
|
||||
HTMLDivElement,
|
||||
UITabProps
|
||||
>(({defaultValue, tabList, children, onValueChange, ...props}, ref) => {
|
||||
return (
|
||||
<Tabs
|
||||
defaultValue={defaultValue || tabList[0]?.value}
|
||||
className={"w-full space-x-1 border-gray-200"}
|
||||
onValueChange={onValueChange}
|
||||
ref={ref}
|
||||
{...props}
|
||||
>
|
||||
<TabsList className="flex space-x-1">
|
||||
{tabList.map((tab) => (
|
||||
<TabsTrigger
|
||||
key={tab.value}
|
||||
value={tab.value}
|
||||
className="py-2 px-4 text-sm font-medium border-b-2 focus:outline-none data-[state=active]:border-blue-500 data-[state=active]:text-blue-600 data-[state=inactive]:border-transparent data-[state=inactive]:text-gray-500 hover:text-gray-700 hover:border-gray-300"
|
||||
>
|
||||
{tab.label}
|
||||
</TabsTrigger>
|
||||
))}
|
||||
</TabsList>
|
||||
{children}
|
||||
</Tabs>
|
||||
);
|
||||
});
|
||||
const UITab = React.forwardRef<HTMLDivElement, UITabProps>(
|
||||
(
|
||||
{
|
||||
defaultValue,
|
||||
tabList,
|
||||
children,
|
||||
onValueChange,
|
||||
className,
|
||||
variant = "default",
|
||||
...props
|
||||
},
|
||||
ref,
|
||||
) => {
|
||||
return (
|
||||
<Tabs
|
||||
variant={variant}
|
||||
defaultValue={defaultValue || tabList[0]?.value}
|
||||
className={cn("w-full", variant === "underline" && "btab_root", className)}
|
||||
onValueChange={onValueChange}
|
||||
ref={ref}
|
||||
{...props}
|
||||
>
|
||||
<TabsList className={cn(variant === "underline" && "btab_list")}>
|
||||
{tabList.map((tab) => (
|
||||
<TabsTrigger
|
||||
key={tab.value}
|
||||
value={tab.value}
|
||||
className={cn(variant === "underline" && "btab_trigger")}
|
||||
>
|
||||
{tab.label}
|
||||
</TabsTrigger>
|
||||
))}
|
||||
</TabsList>
|
||||
{children}
|
||||
</Tabs>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
UITab.displayName = 'UITab';
|
||||
UITab.displayName = "UITab";
|
||||
|
||||
export { UITab };
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
@tailwind components;
|
||||
|
||||
@layer components {
|
||||
.btab_root {
|
||||
@apply w-full;
|
||||
}
|
||||
|
||||
.btab_list {
|
||||
@apply flex space-x-1 border-b border-border bg-transparent p-0;
|
||||
}
|
||||
|
||||
.btab_trigger {
|
||||
@apply rounded-none border-b-2 border-transparent bg-transparent px-4 py-2 text-sm font-medium text-label;
|
||||
}
|
||||
|
||||
.btab_root .btab_trigger[data-state="active"] {
|
||||
@apply border-primary text-primary;
|
||||
}
|
||||
|
||||
.btab_root .btab_trigger[data-state="inactive"] {
|
||||
@apply text-label;
|
||||
}
|
||||
|
||||
.btab_root .btab_trigger:hover {
|
||||
@apply border-border text-foreground;
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ const HeadMakeColSpan = ({ upHeadList }: { upHeadList: TableUpperProps[] }) => {
|
||||
colSpan={head.colSpan || 1}
|
||||
rowSpan={head.rowSpan || 1}
|
||||
style={{ whiteSpace: 'pre-line' }}
|
||||
className="bg-gray-50"
|
||||
className=""
|
||||
>
|
||||
{head.title}
|
||||
</TableHead>
|
||||
|
||||
@@ -22,4 +22,6 @@
|
||||
.tabs[data-variant="outline"] .tabs-trigger {
|
||||
@apply relative rounded-none rounded-t-sm border-border bg-background text-muted-foreground after:absolute after:bottom-0 after:left-0 after:h-[0.1rem] after:w-full after:bg-border after:content-[''] data-[state=active]:border data-[state=active]:border-b-0 data-[state=active]:border-border data-[state=active]:text-foreground data-[state=active]:after:bg-transparent;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user