Merge commit '9cdf6fb0477cbb7f43794fc9d46b9a60fd7828f7' into iipbs/sn/dev
iipbs_sn / build (push) Waiting to run
iipbs_sn / build (push) Waiting to run
This commit is contained in:
@@ -12,10 +12,12 @@ const dropZoneConfig = {
|
||||
files: File[]; // 파일 배열
|
||||
setFiles: (files: File[] | null) => void; // 파일 배열 세터
|
||||
fileTypes?: string; // 옵션 (파일 확장자 문자열)
|
||||
onFileClick?:(index:number)=> void; // 파일 클릭 핸들러
|
||||
|
||||
}
|
||||
|
||||
export const FileUpload =
|
||||
({ files, setFiles, fileTypes }: FileUploadProps) => {
|
||||
({ files, setFiles, fileTypes ,onFileClick}: FileUploadProps) => {
|
||||
return (
|
||||
<FileUploader
|
||||
value={files}
|
||||
@@ -43,9 +45,9 @@ export const FileUpload =
|
||||
{files&&
|
||||
files.length > 0 &&
|
||||
files.map((file:File, i:number) => (
|
||||
<FileUploaderItem key={i} index={i}>
|
||||
<FileUploaderItem key={i} index={i} onFileClick={onFileClick }>
|
||||
<Paperclip className="h-4 w-4 stroke-current" />
|
||||
<span>{file.name}</span>
|
||||
<span className="w-4/5 overflow-hidden">{file.name}</span>
|
||||
</FileUploaderItem>
|
||||
))}
|
||||
</FileUploaderContent>
|
||||
|
||||
@@ -286,9 +286,9 @@ FileUploaderContent.displayName = "FileUploaderContent";
|
||||
|
||||
export const FileUploaderItem = forwardRef<
|
||||
HTMLDivElement,
|
||||
{ index: number } & React.HTMLAttributes<HTMLDivElement>
|
||||
>(({ className, index, children, ...props }, ref) => {
|
||||
const { removeFileFromSet, activeIndex, direction } = useFileUpload();
|
||||
{ index: number } & React.HTMLAttributes<HTMLDivElement> &{onFileClick?:(index:number)=>void}
|
||||
>(({ className, index, children, onFileClick, ...props }, ref) => {
|
||||
const { removeFileFromSet , activeIndex, direction } = useFileUpload();
|
||||
const isSelected = index === activeIndex;
|
||||
return (
|
||||
<div
|
||||
@@ -300,8 +300,13 @@ export const FileUploaderItem = forwardRef<
|
||||
isSelected ? "bg-muted" : "",
|
||||
)}
|
||||
{...props}
|
||||
|
||||
>
|
||||
<div className="font-medium leading-none tracking-tight flex items-center gap-1.5 h-full w-full">
|
||||
<div className="font-medium leading-none tracking-tight flex items-center gap-1.5 h-full !w-4/5 overflow-hidden "
|
||||
onClick={() =>{
|
||||
|
||||
|
||||
}}>
|
||||
{children}
|
||||
</div>
|
||||
<button
|
||||
@@ -309,8 +314,10 @@ export const FileUploaderItem = forwardRef<
|
||||
className={cn(
|
||||
"absolute",
|
||||
direction === "rtl" ? "top-1 left-1" : "top-1 right-1",
|
||||
|
||||
)}
|
||||
onClick={() => removeFileFromSet(index)}
|
||||
onClick={() =>{
|
||||
removeFileFromSet(index)}}
|
||||
>
|
||||
<span className="sr-only">remove item {index}</span>
|
||||
<RemoveIcon className="w-4 h-4 hover:stroke-destructive duration-200 ease-in-out" />
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Checkbox } from "@common/components/ui";
|
||||
import React, { useCallback, useState } from "react";
|
||||
import { FormControl, FormItem, FormLabel, FormMessage } from "../form";
|
||||
import { Button, Checkbox } from "@common/components/ui";
|
||||
|
||||
export const BZNM_TOT_NO = '총사업자등록번호';
|
||||
export const BZNM_TOT_NO = '종사업자등록번호';
|
||||
export const CANDIDATE = '공급처 후보지 선택(필수아님)';
|
||||
|
||||
interface FormUiProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
@@ -23,11 +23,11 @@ const FormUi = React.forwardRef<HTMLDivElement, FormUiProps>(
|
||||
setIsChecked(checked);
|
||||
onCheckboxChange?.(checked);
|
||||
}, [onCheckboxChange]);
|
||||
console.log(children);
|
||||
return (
|
||||
<FormItem ref={ref}>
|
||||
{label && <FormLabel className="text-xl">{label}</FormLabel>}
|
||||
{label === BZNM_TOT_NO && (
|
||||
<>
|
||||
<div className="float-right">
|
||||
<div className="flex items-center gap-2">
|
||||
<Checkbox
|
||||
@@ -38,6 +38,8 @@ const FormUi = React.forwardRef<HTMLDivElement, FormUiProps>(
|
||||
<label className="w-20 text-xl text-gray-600" htmlFor="check">해당없음</label>
|
||||
</div>
|
||||
</div>
|
||||
{children}
|
||||
</>
|
||||
)}
|
||||
{label === CANDIDATE && (
|
||||
<FormControl>
|
||||
@@ -61,4 +63,4 @@ const FormUi = React.forwardRef<HTMLDivElement, FormUiProps>(
|
||||
);
|
||||
|
||||
FormUi.displayName = 'FormUi';
|
||||
export { FormUi };
|
||||
export { FormUi };
|
||||
|
||||
@@ -7,7 +7,11 @@ const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
|
||||
return (
|
||||
<input
|
||||
className={cn(
|
||||
<<<<<<< HEAD
|
||||
"flex h-[3.2rem] w-full rounded-md border border-input bg-form px-3 py-2 text-base text-foreground ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-placeholder focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
||||
=======
|
||||
"flex h-[3.2rem] w-full rounded-md border border-input bg-form px-3 py-2 text-xl ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-placeholder focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-xl",
|
||||
>>>>>>> 9cdf6fb0477cbb7f43794fc9d46b9a60fd7828f7
|
||||
className,
|
||||
)}
|
||||
ref={ref}
|
||||
|
||||
Reference in New Issue
Block a user