@farmzone/fz-react-ui 1.1.11 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +123 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -3
- package/dist/index.d.ts +44 -3
- package/dist/index.js +122 -14
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -93,6 +93,12 @@ interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
93
93
|
showPasswordToggle?: boolean;
|
|
94
94
|
clearable?: boolean;
|
|
95
95
|
onClear?: () => void;
|
|
96
|
+
/** 값의 첫 글자로 스페이스를 입력할 수 있는지 (기본 true) */
|
|
97
|
+
allowLeadingSpace?: boolean;
|
|
98
|
+
/** 값 중간(선행/후행 공백을 제외한 부분)에 스페이스가 남아있을 수 있는지 (기본 true) */
|
|
99
|
+
allowMiddleSpace?: boolean;
|
|
100
|
+
/** 포커스를 벗어날 때(blur) 값 끝에 스페이스가 남아있을 수 있는지 (기본 true) */
|
|
101
|
+
allowTrailingSpace?: boolean;
|
|
96
102
|
}
|
|
97
103
|
declare function Input(props: InputProps): react.JSX.Element;
|
|
98
104
|
|
|
@@ -400,10 +406,12 @@ declare function useBreadCrumbItems(params: Omit<BuildBreadCrumbItemsParams, "pa
|
|
|
400
406
|
pathname?: string;
|
|
401
407
|
}): BreadCrumbItem[];
|
|
402
408
|
|
|
403
|
-
declare function ToastProvider(): react.JSX.Element;
|
|
404
|
-
|
|
405
409
|
type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
406
410
|
type ToastType = "success" | "error" | "warning" | "info" | "loading";
|
|
411
|
+
interface ToastIconTheme {
|
|
412
|
+
primary: string;
|
|
413
|
+
secondary: string;
|
|
414
|
+
}
|
|
407
415
|
interface ToastProps {
|
|
408
416
|
toast: string;
|
|
409
417
|
id?: string;
|
|
@@ -412,10 +420,35 @@ interface ToastProps {
|
|
|
412
420
|
duration?: number;
|
|
413
421
|
showCloseButton?: boolean;
|
|
414
422
|
className?: string;
|
|
423
|
+
style?: CSSProperties;
|
|
424
|
+
iconTheme?: ToastIconTheme;
|
|
415
425
|
icon?: ReactNode;
|
|
416
426
|
onClose?: () => void;
|
|
417
427
|
onClick?: () => void;
|
|
418
428
|
}
|
|
429
|
+
interface ToastStyleOptions {
|
|
430
|
+
className?: string;
|
|
431
|
+
style?: CSSProperties;
|
|
432
|
+
iconTheme?: ToastIconTheme;
|
|
433
|
+
}
|
|
434
|
+
interface ToastOptions extends ToastStyleOptions {
|
|
435
|
+
duration?: number;
|
|
436
|
+
success?: ToastStyleOptions & {
|
|
437
|
+
duration?: number;
|
|
438
|
+
};
|
|
439
|
+
error?: ToastStyleOptions & {
|
|
440
|
+
duration?: number;
|
|
441
|
+
};
|
|
442
|
+
warning?: ToastStyleOptions & {
|
|
443
|
+
duration?: number;
|
|
444
|
+
};
|
|
445
|
+
info?: ToastStyleOptions & {
|
|
446
|
+
duration?: number;
|
|
447
|
+
};
|
|
448
|
+
loading?: ToastStyleOptions & {
|
|
449
|
+
duration?: number;
|
|
450
|
+
};
|
|
451
|
+
}
|
|
419
452
|
interface ToastHookReturn {
|
|
420
453
|
showToast: (props: ToastProps) => string;
|
|
421
454
|
dismissToast: (toastId: string) => void;
|
|
@@ -434,6 +467,11 @@ declare const toast: {
|
|
|
434
467
|
dismissAllExcept: (type: ToastType) => void;
|
|
435
468
|
};
|
|
436
469
|
|
|
470
|
+
interface ToastProviderProps {
|
|
471
|
+
toastOptions?: ToastOptions;
|
|
472
|
+
}
|
|
473
|
+
declare function ToastProvider(props: ToastProviderProps): react.JSX.Element;
|
|
474
|
+
|
|
437
475
|
interface CalendarYearRange {
|
|
438
476
|
minYear: string;
|
|
439
477
|
maxYear: string;
|
|
@@ -964,6 +1002,9 @@ declare const SubmitForm: typeof SubmitFormRoot & {
|
|
|
964
1002
|
Table: typeof FormTable;
|
|
965
1003
|
};
|
|
966
1004
|
|
|
1005
|
+
declare function formatNumberWithCommas(value: string | number): string;
|
|
1006
|
+
declare function parseFormattedNumber(value: string): number | undefined;
|
|
1007
|
+
|
|
967
1008
|
type SelectableOption = {
|
|
968
1009
|
label: string;
|
|
969
1010
|
value: string;
|
|
@@ -1648,4 +1689,4 @@ declare const Z_INDEX: {
|
|
|
1648
1689
|
};
|
|
1649
1690
|
type ZIndexKey = keyof typeof Z_INDEX;
|
|
1650
1691
|
|
|
1651
|
-
export { ArrowIcon, Badge, type BadgeProps, type BaseParams, BaseUploader, type BaseUploaderProps, BreadCrumb, type BreadCrumbItem, type BreadCrumbMenuItem, type BreadCrumbProps, type BreadCrumbRoot, Button, type ButtonProps, type ButtonSize, type ButtonVariant, type CalendarYearRange, Carousel, type CarouselProps, type CarouselRef, Checkbox, type CheckboxProps, type Column, type ConfirmOptions, DatePicker, DebouncedButton, type DebouncedButtonProps, DetailContent, type DetailContentProps, type DetailField, type DetailFieldOrSection, DetailModalFrame, type DetailMode, DetailPageFrame, Empty, ExcelUploader, FilePreviewViewer, FileUploader, type FilterRow, type FormFieldConfig, Input, type InputProps, Loading, LoadingOverlay, type LoadingOverlayProps, type LoadingProps, type MentionItem, type MenuChild, type MenuGrandchild, type MenuItem, type MenuSection, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, ModalIconHeader, type ModalIconHeaderProps, ModalOverlay, type ModalProps, type ModalType, MultiTabBar as MultiTab, type MultiTabGroupInfo, type MultiTab as MultiTabItem, type MultiTabMenuItem, PageFilter, type PageParams, Pagination, type PaginationProps, Popover, type PopoverAlign, PopoverAnchor, PopoverClose, PopoverContent, type PopoverContentProps, PopoverDescription, PopoverFooter, PopoverHeader, type PopoverPosition, PopoverTitle, PopoverTrigger, Radio, RadioGroup, type RadioGroupProps, type RadioOptionType, type RadioProps, RichEditor, RichEditorContent, type RichEditorContentProps, type RichEditorHeadingLevel, type RichEditorProps, type RichEditorThemeOverride, RichEditorToolbar, type RichEditorToolbarConfig, type RichEditorToolbarProps, ScrollArea, ScrollBar, SearchAddress, type SearchAddressProps, SearchBar, type SearchBarProps, Select, Select$1 as SelectBase, SelectContent, SelectGroup, SelectItem, SelectLabel, type SelectOptionType, type SelectProps, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Sidebar, type SidebarHeaderRenderProps, type SidebarProps, SimplePopover, type SimplePopoverProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type SortOption, type SortOrder, type SortParams, Spinner, type SpinnerColor, type SpinnerProps, type SpinnerSize, SubmitForm, Switch, type SwitchProps, Tab, type TabItem, type TabProps, Table, Textarea, type TextareaProps, type ToastPosition, type ToastProps, ToastProvider, type ToastType, ToggleSwitch, Tooltip, type TooltipProps, type UseParams, type UseRichEditorOptions, type UseRichEditorReturn, type YmdDateString, type ZIndexKey, Z_INDEX, buildBreadCrumbItems, buttonVariants, cn, confirmModal, findParentMenuItem, findParentMenuName, formatDate, getFileLabel, getPreviewFileType, isCalendarDayAfterMax, isDateInRange, switchTrackSizes, textVariants, toast, useBlockModalConfirm, useBreadCrumbItems, useCustomBlocker, useDetailController, useFilePreviewViewer, useModal, useMultiTabStore, useParams, useRichEditor, useScrollToTop, useStableImageSrc, useToast, validateAndFormatInput };
|
|
1692
|
+
export { ArrowIcon, Badge, type BadgeProps, type BaseParams, BaseUploader, type BaseUploaderProps, BreadCrumb, type BreadCrumbItem, type BreadCrumbMenuItem, type BreadCrumbProps, type BreadCrumbRoot, Button, type ButtonProps, type ButtonSize, type ButtonVariant, type CalendarYearRange, Carousel, type CarouselProps, type CarouselRef, Checkbox, type CheckboxProps, type Column, type ConfirmOptions, DatePicker, DebouncedButton, type DebouncedButtonProps, DetailContent, type DetailContentProps, type DetailField, type DetailFieldOrSection, DetailModalFrame, type DetailMode, DetailPageFrame, Empty, ExcelUploader, FilePreviewViewer, FileUploader, type FilterRow, type FormFieldConfig, Input, type InputProps, Loading, LoadingOverlay, type LoadingOverlayProps, type LoadingProps, type MentionItem, type MenuChild, type MenuGrandchild, type MenuItem, type MenuSection, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, ModalIconHeader, type ModalIconHeaderProps, ModalOverlay, type ModalProps, type ModalType, MultiTabBar as MultiTab, type MultiTabGroupInfo, type MultiTab as MultiTabItem, type MultiTabMenuItem, PageFilter, type PageParams, Pagination, type PaginationProps, Popover, type PopoverAlign, PopoverAnchor, PopoverClose, PopoverContent, type PopoverContentProps, PopoverDescription, PopoverFooter, PopoverHeader, type PopoverPosition, PopoverTitle, PopoverTrigger, Radio, RadioGroup, type RadioGroupProps, type RadioOptionType, type RadioProps, RichEditor, RichEditorContent, type RichEditorContentProps, type RichEditorHeadingLevel, type RichEditorProps, type RichEditorThemeOverride, RichEditorToolbar, type RichEditorToolbarConfig, type RichEditorToolbarProps, ScrollArea, ScrollBar, SearchAddress, type SearchAddressProps, SearchBar, type SearchBarProps, Select, Select$1 as SelectBase, SelectContent, SelectGroup, SelectItem, SelectLabel, type SelectOptionType, type SelectProps, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Sidebar, type SidebarHeaderRenderProps, type SidebarProps, SimplePopover, type SimplePopoverProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type SortOption, type SortOrder, type SortParams, Spinner, type SpinnerColor, type SpinnerProps, type SpinnerSize, SubmitForm, Switch, type SwitchProps, Tab, type TabItem, type TabProps, Table, Textarea, type TextareaProps, type ToastIconTheme, type ToastOptions, type ToastPosition, type ToastProps, ToastProvider, type ToastStyleOptions, type ToastType, ToggleSwitch, Tooltip, type TooltipProps, type UseParams, type UseRichEditorOptions, type UseRichEditorReturn, type YmdDateString, type ZIndexKey, Z_INDEX, buildBreadCrumbItems, buttonVariants, cn, confirmModal, findParentMenuItem, findParentMenuName, formatDate, formatNumberWithCommas, getFileLabel, getPreviewFileType, isCalendarDayAfterMax, isDateInRange, parseFormattedNumber, switchTrackSizes, textVariants, toast, useBlockModalConfirm, useBreadCrumbItems, useCustomBlocker, useDetailController, useFilePreviewViewer, useModal, useMultiTabStore, useParams, useRichEditor, useScrollToTop, useStableImageSrc, useToast, validateAndFormatInput };
|
package/dist/index.d.ts
CHANGED
|
@@ -93,6 +93,12 @@ interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
93
93
|
showPasswordToggle?: boolean;
|
|
94
94
|
clearable?: boolean;
|
|
95
95
|
onClear?: () => void;
|
|
96
|
+
/** 값의 첫 글자로 스페이스를 입력할 수 있는지 (기본 true) */
|
|
97
|
+
allowLeadingSpace?: boolean;
|
|
98
|
+
/** 값 중간(선행/후행 공백을 제외한 부분)에 스페이스가 남아있을 수 있는지 (기본 true) */
|
|
99
|
+
allowMiddleSpace?: boolean;
|
|
100
|
+
/** 포커스를 벗어날 때(blur) 값 끝에 스페이스가 남아있을 수 있는지 (기본 true) */
|
|
101
|
+
allowTrailingSpace?: boolean;
|
|
96
102
|
}
|
|
97
103
|
declare function Input(props: InputProps): react.JSX.Element;
|
|
98
104
|
|
|
@@ -400,10 +406,12 @@ declare function useBreadCrumbItems(params: Omit<BuildBreadCrumbItemsParams, "pa
|
|
|
400
406
|
pathname?: string;
|
|
401
407
|
}): BreadCrumbItem[];
|
|
402
408
|
|
|
403
|
-
declare function ToastProvider(): react.JSX.Element;
|
|
404
|
-
|
|
405
409
|
type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
406
410
|
type ToastType = "success" | "error" | "warning" | "info" | "loading";
|
|
411
|
+
interface ToastIconTheme {
|
|
412
|
+
primary: string;
|
|
413
|
+
secondary: string;
|
|
414
|
+
}
|
|
407
415
|
interface ToastProps {
|
|
408
416
|
toast: string;
|
|
409
417
|
id?: string;
|
|
@@ -412,10 +420,35 @@ interface ToastProps {
|
|
|
412
420
|
duration?: number;
|
|
413
421
|
showCloseButton?: boolean;
|
|
414
422
|
className?: string;
|
|
423
|
+
style?: CSSProperties;
|
|
424
|
+
iconTheme?: ToastIconTheme;
|
|
415
425
|
icon?: ReactNode;
|
|
416
426
|
onClose?: () => void;
|
|
417
427
|
onClick?: () => void;
|
|
418
428
|
}
|
|
429
|
+
interface ToastStyleOptions {
|
|
430
|
+
className?: string;
|
|
431
|
+
style?: CSSProperties;
|
|
432
|
+
iconTheme?: ToastIconTheme;
|
|
433
|
+
}
|
|
434
|
+
interface ToastOptions extends ToastStyleOptions {
|
|
435
|
+
duration?: number;
|
|
436
|
+
success?: ToastStyleOptions & {
|
|
437
|
+
duration?: number;
|
|
438
|
+
};
|
|
439
|
+
error?: ToastStyleOptions & {
|
|
440
|
+
duration?: number;
|
|
441
|
+
};
|
|
442
|
+
warning?: ToastStyleOptions & {
|
|
443
|
+
duration?: number;
|
|
444
|
+
};
|
|
445
|
+
info?: ToastStyleOptions & {
|
|
446
|
+
duration?: number;
|
|
447
|
+
};
|
|
448
|
+
loading?: ToastStyleOptions & {
|
|
449
|
+
duration?: number;
|
|
450
|
+
};
|
|
451
|
+
}
|
|
419
452
|
interface ToastHookReturn {
|
|
420
453
|
showToast: (props: ToastProps) => string;
|
|
421
454
|
dismissToast: (toastId: string) => void;
|
|
@@ -434,6 +467,11 @@ declare const toast: {
|
|
|
434
467
|
dismissAllExcept: (type: ToastType) => void;
|
|
435
468
|
};
|
|
436
469
|
|
|
470
|
+
interface ToastProviderProps {
|
|
471
|
+
toastOptions?: ToastOptions;
|
|
472
|
+
}
|
|
473
|
+
declare function ToastProvider(props: ToastProviderProps): react.JSX.Element;
|
|
474
|
+
|
|
437
475
|
interface CalendarYearRange {
|
|
438
476
|
minYear: string;
|
|
439
477
|
maxYear: string;
|
|
@@ -964,6 +1002,9 @@ declare const SubmitForm: typeof SubmitFormRoot & {
|
|
|
964
1002
|
Table: typeof FormTable;
|
|
965
1003
|
};
|
|
966
1004
|
|
|
1005
|
+
declare function formatNumberWithCommas(value: string | number): string;
|
|
1006
|
+
declare function parseFormattedNumber(value: string): number | undefined;
|
|
1007
|
+
|
|
967
1008
|
type SelectableOption = {
|
|
968
1009
|
label: string;
|
|
969
1010
|
value: string;
|
|
@@ -1648,4 +1689,4 @@ declare const Z_INDEX: {
|
|
|
1648
1689
|
};
|
|
1649
1690
|
type ZIndexKey = keyof typeof Z_INDEX;
|
|
1650
1691
|
|
|
1651
|
-
export { ArrowIcon, Badge, type BadgeProps, type BaseParams, BaseUploader, type BaseUploaderProps, BreadCrumb, type BreadCrumbItem, type BreadCrumbMenuItem, type BreadCrumbProps, type BreadCrumbRoot, Button, type ButtonProps, type ButtonSize, type ButtonVariant, type CalendarYearRange, Carousel, type CarouselProps, type CarouselRef, Checkbox, type CheckboxProps, type Column, type ConfirmOptions, DatePicker, DebouncedButton, type DebouncedButtonProps, DetailContent, type DetailContentProps, type DetailField, type DetailFieldOrSection, DetailModalFrame, type DetailMode, DetailPageFrame, Empty, ExcelUploader, FilePreviewViewer, FileUploader, type FilterRow, type FormFieldConfig, Input, type InputProps, Loading, LoadingOverlay, type LoadingOverlayProps, type LoadingProps, type MentionItem, type MenuChild, type MenuGrandchild, type MenuItem, type MenuSection, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, ModalIconHeader, type ModalIconHeaderProps, ModalOverlay, type ModalProps, type ModalType, MultiTabBar as MultiTab, type MultiTabGroupInfo, type MultiTab as MultiTabItem, type MultiTabMenuItem, PageFilter, type PageParams, Pagination, type PaginationProps, Popover, type PopoverAlign, PopoverAnchor, PopoverClose, PopoverContent, type PopoverContentProps, PopoverDescription, PopoverFooter, PopoverHeader, type PopoverPosition, PopoverTitle, PopoverTrigger, Radio, RadioGroup, type RadioGroupProps, type RadioOptionType, type RadioProps, RichEditor, RichEditorContent, type RichEditorContentProps, type RichEditorHeadingLevel, type RichEditorProps, type RichEditorThemeOverride, RichEditorToolbar, type RichEditorToolbarConfig, type RichEditorToolbarProps, ScrollArea, ScrollBar, SearchAddress, type SearchAddressProps, SearchBar, type SearchBarProps, Select, Select$1 as SelectBase, SelectContent, SelectGroup, SelectItem, SelectLabel, type SelectOptionType, type SelectProps, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Sidebar, type SidebarHeaderRenderProps, type SidebarProps, SimplePopover, type SimplePopoverProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type SortOption, type SortOrder, type SortParams, Spinner, type SpinnerColor, type SpinnerProps, type SpinnerSize, SubmitForm, Switch, type SwitchProps, Tab, type TabItem, type TabProps, Table, Textarea, type TextareaProps, type ToastPosition, type ToastProps, ToastProvider, type ToastType, ToggleSwitch, Tooltip, type TooltipProps, type UseParams, type UseRichEditorOptions, type UseRichEditorReturn, type YmdDateString, type ZIndexKey, Z_INDEX, buildBreadCrumbItems, buttonVariants, cn, confirmModal, findParentMenuItem, findParentMenuName, formatDate, getFileLabel, getPreviewFileType, isCalendarDayAfterMax, isDateInRange, switchTrackSizes, textVariants, toast, useBlockModalConfirm, useBreadCrumbItems, useCustomBlocker, useDetailController, useFilePreviewViewer, useModal, useMultiTabStore, useParams, useRichEditor, useScrollToTop, useStableImageSrc, useToast, validateAndFormatInput };
|
|
1692
|
+
export { ArrowIcon, Badge, type BadgeProps, type BaseParams, BaseUploader, type BaseUploaderProps, BreadCrumb, type BreadCrumbItem, type BreadCrumbMenuItem, type BreadCrumbProps, type BreadCrumbRoot, Button, type ButtonProps, type ButtonSize, type ButtonVariant, type CalendarYearRange, Carousel, type CarouselProps, type CarouselRef, Checkbox, type CheckboxProps, type Column, type ConfirmOptions, DatePicker, DebouncedButton, type DebouncedButtonProps, DetailContent, type DetailContentProps, type DetailField, type DetailFieldOrSection, DetailModalFrame, type DetailMode, DetailPageFrame, Empty, ExcelUploader, FilePreviewViewer, FileUploader, type FilterRow, type FormFieldConfig, Input, type InputProps, Loading, LoadingOverlay, type LoadingOverlayProps, type LoadingProps, type MentionItem, type MenuChild, type MenuGrandchild, type MenuItem, type MenuSection, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, ModalIconHeader, type ModalIconHeaderProps, ModalOverlay, type ModalProps, type ModalType, MultiTabBar as MultiTab, type MultiTabGroupInfo, type MultiTab as MultiTabItem, type MultiTabMenuItem, PageFilter, type PageParams, Pagination, type PaginationProps, Popover, type PopoverAlign, PopoverAnchor, PopoverClose, PopoverContent, type PopoverContentProps, PopoverDescription, PopoverFooter, PopoverHeader, type PopoverPosition, PopoverTitle, PopoverTrigger, Radio, RadioGroup, type RadioGroupProps, type RadioOptionType, type RadioProps, RichEditor, RichEditorContent, type RichEditorContentProps, type RichEditorHeadingLevel, type RichEditorProps, type RichEditorThemeOverride, RichEditorToolbar, type RichEditorToolbarConfig, type RichEditorToolbarProps, ScrollArea, ScrollBar, SearchAddress, type SearchAddressProps, SearchBar, type SearchBarProps, Select, Select$1 as SelectBase, SelectContent, SelectGroup, SelectItem, SelectLabel, type SelectOptionType, type SelectProps, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Sidebar, type SidebarHeaderRenderProps, type SidebarProps, SimplePopover, type SimplePopoverProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type SortOption, type SortOrder, type SortParams, Spinner, type SpinnerColor, type SpinnerProps, type SpinnerSize, SubmitForm, Switch, type SwitchProps, Tab, type TabItem, type TabProps, Table, Textarea, type TextareaProps, type ToastIconTheme, type ToastOptions, type ToastPosition, type ToastProps, ToastProvider, type ToastStyleOptions, type ToastType, ToggleSwitch, Tooltip, type TooltipProps, type UseParams, type UseRichEditorOptions, type UseRichEditorReturn, type YmdDateString, type ZIndexKey, Z_INDEX, buildBreadCrumbItems, buttonVariants, cn, confirmModal, findParentMenuItem, findParentMenuName, formatDate, formatNumberWithCommas, getFileLabel, getPreviewFileType, isCalendarDayAfterMax, isDateInRange, parseFormattedNumber, switchTrackSizes, textVariants, toast, useBlockModalConfirm, useBreadCrumbItems, useCustomBlocker, useDetailController, useFilePreviewViewer, useModal, useMultiTabStore, useParams, useRichEditor, useScrollToTop, useStableImageSrc, useToast, validateAndFormatInput };
|
package/dist/index.js
CHANGED
|
@@ -451,6 +451,12 @@ function Input2(props) {
|
|
|
451
451
|
clearable = false,
|
|
452
452
|
onClear,
|
|
453
453
|
onChange,
|
|
454
|
+
onKeyDown,
|
|
455
|
+
onBlur,
|
|
456
|
+
maxLength,
|
|
457
|
+
allowLeadingSpace = true,
|
|
458
|
+
allowMiddleSpace = true,
|
|
459
|
+
allowTrailingSpace = true,
|
|
454
460
|
...rest
|
|
455
461
|
} = props;
|
|
456
462
|
const randomId = useId();
|
|
@@ -497,6 +503,15 @@ function Input2(props) {
|
|
|
497
503
|
children: showPassword ? /* @__PURE__ */ jsx(EyeOff, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Eye, { className: "h-4 w-4" })
|
|
498
504
|
}
|
|
499
505
|
) : null);
|
|
506
|
+
const splitSpaceRuns = (value) => {
|
|
507
|
+
const core = value.trim();
|
|
508
|
+
if (core === "") {
|
|
509
|
+
return { leading: value, core: "", trailing: "" };
|
|
510
|
+
}
|
|
511
|
+
const leading = value.slice(0, value.length - value.trimStart().length);
|
|
512
|
+
const trailing = value.slice(value.trimEnd().length);
|
|
513
|
+
return { leading, core, trailing };
|
|
514
|
+
};
|
|
500
515
|
const handleChange = (event) => {
|
|
501
516
|
const { value } = event.target;
|
|
502
517
|
if (type === "number" || type === "money") {
|
|
@@ -506,7 +521,9 @@ function Input2(props) {
|
|
|
506
521
|
sanitized = parts[0] + "." + parts.slice(1).join("");
|
|
507
522
|
}
|
|
508
523
|
if (type === "money") {
|
|
509
|
-
|
|
524
|
+
let digitsOnly = sanitized.replace(/\D/g, "");
|
|
525
|
+
digitsOnly = digitsOnly.replace(/^0+/, "");
|
|
526
|
+
digitsOnly = digitsOnly.slice(0, maxLength);
|
|
510
527
|
if (digitsOnly.length === 0) {
|
|
511
528
|
event.target.value = "";
|
|
512
529
|
} else {
|
|
@@ -516,11 +533,39 @@ function Input2(props) {
|
|
|
516
533
|
} else {
|
|
517
534
|
event.target.value = sanitized;
|
|
518
535
|
}
|
|
536
|
+
} else if (!allowLeadingSpace || !allowMiddleSpace) {
|
|
537
|
+
const { leading, core, trailing } = splitSpaceRuns(value);
|
|
538
|
+
const nextLeading = allowLeadingSpace ? leading : "";
|
|
539
|
+
const nextCore = allowMiddleSpace ? core : core.replace(/ /g, "");
|
|
540
|
+
const sanitized = nextLeading + nextCore + trailing;
|
|
541
|
+
if (sanitized !== value) {
|
|
542
|
+
event.target.value = sanitized;
|
|
543
|
+
}
|
|
519
544
|
}
|
|
520
545
|
if (onChange) {
|
|
521
546
|
onChange(event);
|
|
522
547
|
}
|
|
523
548
|
};
|
|
549
|
+
const handleKeyDown = (event) => {
|
|
550
|
+
if (event.key === " ") {
|
|
551
|
+
if (type === "number" || type === "money") {
|
|
552
|
+
event.preventDefault();
|
|
553
|
+
} else if (!allowLeadingSpace && event.currentTarget.selectionStart === 0) {
|
|
554
|
+
event.preventDefault();
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
onKeyDown?.(event);
|
|
558
|
+
};
|
|
559
|
+
const handleBlur = (event) => {
|
|
560
|
+
if (!allowTrailingSpace && type !== "number" && type !== "money") {
|
|
561
|
+
const trimmed = event.currentTarget.value.replace(/ +$/, "");
|
|
562
|
+
if (trimmed !== event.currentTarget.value) {
|
|
563
|
+
event.currentTarget.value = trimmed;
|
|
564
|
+
onChange?.(event);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
onBlur?.(event);
|
|
568
|
+
};
|
|
524
569
|
const inputBlock = /* @__PURE__ */ jsxs("div", { className: "relative m-0", children: [
|
|
525
570
|
leftIcon && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground absolute top-1/2 left-3 -translate-y-1/2 transform", children: leftIcon }),
|
|
526
571
|
/* @__PURE__ */ jsx(
|
|
@@ -532,7 +577,10 @@ function Input2(props) {
|
|
|
532
577
|
placeholder,
|
|
533
578
|
disabled,
|
|
534
579
|
ref,
|
|
580
|
+
maxLength: type === "money" ? void 0 : maxLength,
|
|
535
581
|
onChange: handleChange,
|
|
582
|
+
onKeyDown: handleKeyDown,
|
|
583
|
+
onBlur: handleBlur,
|
|
536
584
|
...rest
|
|
537
585
|
}
|
|
538
586
|
),
|
|
@@ -1677,12 +1725,36 @@ var ToastManager = class _ToastManager {
|
|
|
1677
1725
|
static instance;
|
|
1678
1726
|
containers = /* @__PURE__ */ new Map();
|
|
1679
1727
|
toasts = /* @__PURE__ */ new Map();
|
|
1728
|
+
// ToastProvider가 마운트/prop 변경 시 넣어주는 전역 기본값 — 개별 toast() 호출의 props가 항상 우선한다.
|
|
1729
|
+
defaultOptions = {};
|
|
1680
1730
|
static getInstance() {
|
|
1681
1731
|
if (!_ToastManager.instance) {
|
|
1682
1732
|
_ToastManager.instance = new _ToastManager();
|
|
1683
1733
|
}
|
|
1684
1734
|
return _ToastManager.instance;
|
|
1685
1735
|
}
|
|
1736
|
+
setDefaultOptions(options) {
|
|
1737
|
+
this.defaultOptions = options;
|
|
1738
|
+
}
|
|
1739
|
+
getDefaultOptions() {
|
|
1740
|
+
return this.defaultOptions;
|
|
1741
|
+
}
|
|
1742
|
+
// 호출 시점 props를 전역 기본값(및 상태별 기본값)과 합쳐 최종 props를 만든다. 우선순위는
|
|
1743
|
+
// 호출 props > 상태별 기본값(options[type]) > 공통 기본값(options.*) > 하드코딩 폴백.
|
|
1744
|
+
resolveProps(props) {
|
|
1745
|
+
const type = props.type ?? "info";
|
|
1746
|
+
const base = this.defaultOptions;
|
|
1747
|
+
const perType = base[type] ?? {};
|
|
1748
|
+
const style = { ...base.style, ...perType.style, ...props.style };
|
|
1749
|
+
const className = [base.className, perType.className, props.className].filter((value) => Boolean(value)).join(" ");
|
|
1750
|
+
return {
|
|
1751
|
+
...props,
|
|
1752
|
+
duration: props.duration ?? perType.duration ?? base.duration ?? 1500,
|
|
1753
|
+
style: Object.keys(style).length > 0 ? style : void 0,
|
|
1754
|
+
className: className || void 0,
|
|
1755
|
+
iconTheme: props.iconTheme ?? perType.iconTheme ?? base.iconTheme
|
|
1756
|
+
};
|
|
1757
|
+
}
|
|
1686
1758
|
registerContainer(position, setToasts) {
|
|
1687
1759
|
this.containers.set(position, setToasts);
|
|
1688
1760
|
const existingToasts = this.toasts.get(position) || [];
|
|
@@ -1692,7 +1764,8 @@ var ToastManager = class _ToastManager {
|
|
|
1692
1764
|
setToasts([]);
|
|
1693
1765
|
}
|
|
1694
1766
|
}
|
|
1695
|
-
addToast(
|
|
1767
|
+
addToast(rawProps) {
|
|
1768
|
+
const props = this.resolveProps(rawProps);
|
|
1696
1769
|
const position = props.position || "top-center";
|
|
1697
1770
|
const duration = props.duration !== void 0 ? props.duration : 1500;
|
|
1698
1771
|
if (props.id) {
|
|
@@ -1888,15 +1961,16 @@ function ToastItemCard(props) {
|
|
|
1888
1961
|
const { toast: toast2, onRemove } = props;
|
|
1889
1962
|
const [isVisible, setIsVisible] = useState(true);
|
|
1890
1963
|
const removeTimeoutRef = useRef(null);
|
|
1964
|
+
const EXIT_ANIMATION_MS = 400;
|
|
1891
1965
|
useEffect(() => {
|
|
1892
1966
|
const duration = toast2.props.duration ?? 1500;
|
|
1893
|
-
if (duration !== Infinity && duration >
|
|
1894
|
-
const fadeOutTime = Math.max(0, duration -
|
|
1967
|
+
if (duration !== Infinity && duration > EXIT_ANIMATION_MS) {
|
|
1968
|
+
const fadeOutTime = Math.max(0, duration - EXIT_ANIMATION_MS);
|
|
1895
1969
|
const fadeOutTimer = setTimeout(() => {
|
|
1896
1970
|
setIsVisible(false);
|
|
1897
1971
|
removeTimeoutRef.current = setTimeout(() => {
|
|
1898
1972
|
onRemove(toast2.id);
|
|
1899
|
-
},
|
|
1973
|
+
}, EXIT_ANIMATION_MS);
|
|
1900
1974
|
}, fadeOutTime);
|
|
1901
1975
|
return () => {
|
|
1902
1976
|
clearTimeout(fadeOutTimer);
|
|
@@ -1917,14 +1991,15 @@ function ToastItemCard(props) {
|
|
|
1917
1991
|
}
|
|
1918
1992
|
removeTimeoutRef.current = setTimeout(() => {
|
|
1919
1993
|
onRemove(toast2.id);
|
|
1920
|
-
},
|
|
1994
|
+
}, EXIT_ANIMATION_MS);
|
|
1921
1995
|
};
|
|
1922
1996
|
const handleCloseClick = (e) => {
|
|
1923
1997
|
e.stopPropagation();
|
|
1924
1998
|
handleClose();
|
|
1925
1999
|
};
|
|
1926
|
-
const getTypeStyles = (type) => {
|
|
2000
|
+
const getTypeStyles = (type, hasCustomStyle2) => {
|
|
1927
2001
|
const baseStyles = "px-4 py-3 rounded-lg shadow-lg border flex items-center gap-3 min-w-[300px] max-w-[500px] pointer-events-auto";
|
|
2002
|
+
if (hasCustomStyle2) return baseStyles;
|
|
1928
2003
|
const typeStyles = {
|
|
1929
2004
|
success: "bg-green-50 border-green-200 text-green-800",
|
|
1930
2005
|
error: "bg-red-50 border-red-200 text-red-800",
|
|
@@ -1934,7 +2009,7 @@ function ToastItemCard(props) {
|
|
|
1934
2009
|
};
|
|
1935
2010
|
return `${baseStyles} ${typeStyles[type]}`;
|
|
1936
2011
|
};
|
|
1937
|
-
const getDefaultIcon = (type) => {
|
|
2012
|
+
const getDefaultIcon = (type, iconTheme) => {
|
|
1938
2013
|
const icons = {
|
|
1939
2014
|
success: "\u2713",
|
|
1940
2015
|
error: "\u2715",
|
|
@@ -1942,6 +2017,26 @@ function ToastItemCard(props) {
|
|
|
1942
2017
|
info: "\u2139",
|
|
1943
2018
|
loading: "\u27F3"
|
|
1944
2019
|
};
|
|
2020
|
+
if (iconTheme) {
|
|
2021
|
+
const colorVars = {
|
|
2022
|
+
"--fz-toast-icon-primary": iconTheme.primary,
|
|
2023
|
+
"--fz-toast-icon-secondary": iconTheme.secondary
|
|
2024
|
+
};
|
|
2025
|
+
if (type === "loading") {
|
|
2026
|
+
return /* @__PURE__ */ jsx("span", { className: "fz-toast-icon-spinner", style: colorVars });
|
|
2027
|
+
}
|
|
2028
|
+
if (type === "success" || type === "error") {
|
|
2029
|
+
return /* @__PURE__ */ jsx("span", { className: `fz-toast-icon-badge fz-toast-icon-badge--${type}`, style: colorVars });
|
|
2030
|
+
}
|
|
2031
|
+
return /* @__PURE__ */ jsx(
|
|
2032
|
+
"span",
|
|
2033
|
+
{
|
|
2034
|
+
className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-xs font-bold",
|
|
2035
|
+
style: { backgroundColor: iconTheme.primary, color: iconTheme.secondary },
|
|
2036
|
+
children: icons[type]
|
|
2037
|
+
}
|
|
2038
|
+
);
|
|
2039
|
+
}
|
|
1945
2040
|
return /* @__PURE__ */ jsx("span", { className: `text-lg ${type === "loading" ? "animate-spin" : ""}`, children: icons[type] });
|
|
1946
2041
|
};
|
|
1947
2042
|
const getCloseButtonStyles = (type) => {
|
|
@@ -1955,15 +2050,17 @@ function ToastItemCard(props) {
|
|
|
1955
2050
|
};
|
|
1956
2051
|
return `${baseStyles} ${typeStyles[type]}`;
|
|
1957
2052
|
};
|
|
2053
|
+
const hasCustomStyle = Boolean(toast2.props.style && Object.keys(toast2.props.style).length > 0);
|
|
1958
2054
|
return /* @__PURE__ */ jsxs(
|
|
1959
2055
|
"div",
|
|
1960
2056
|
{
|
|
1961
|
-
className: `${getTypeStyles(toast2.props.type || "info")}
|
|
2057
|
+
className: `${getTypeStyles(toast2.props.type || "info", hasCustomStyle)} ${isVisible ? "fz-toast-card-enter" : "fz-toast-card-exit"} mb-2 cursor-pointer ${toast2.props.className ?? ""}`,
|
|
2058
|
+
style: toast2.props.style,
|
|
1962
2059
|
onClick: handleClick,
|
|
1963
2060
|
children: [
|
|
1964
|
-
toast2.props.icon || getDefaultIcon(toast2.props.type || "info"),
|
|
2061
|
+
toast2.props.icon || getDefaultIcon(toast2.props.type || "info", toast2.props.iconTheme),
|
|
1965
2062
|
/* @__PURE__ */ jsx("span", { className: "flex-1 text-sm font-medium", children: toast2.props.toast }),
|
|
1966
|
-
toast2.props.showCloseButton
|
|
2063
|
+
toast2.props.showCloseButton === true && /* @__PURE__ */ jsx(
|
|
1967
2064
|
"button",
|
|
1968
2065
|
{
|
|
1969
2066
|
onClick: handleCloseClick,
|
|
@@ -1985,7 +2082,12 @@ var TOAST_POSITIONS = [
|
|
|
1985
2082
|
"bottom-center",
|
|
1986
2083
|
"bottom-right"
|
|
1987
2084
|
];
|
|
1988
|
-
function ToastProvider() {
|
|
2085
|
+
function ToastProvider(props) {
|
|
2086
|
+
const { toastOptions } = props;
|
|
2087
|
+
useEffect(() => {
|
|
2088
|
+
if (!toastOptions) return;
|
|
2089
|
+
ToastManager.getInstance().setDefaultOptions(toastOptions);
|
|
2090
|
+
}, [toastOptions]);
|
|
1989
2091
|
return /* @__PURE__ */ jsx(Fragment, { children: TOAST_POSITIONS.map((position) => /* @__PURE__ */ jsx(ToastContainer, { position }, position)) });
|
|
1990
2092
|
}
|
|
1991
2093
|
|
|
@@ -6363,7 +6465,7 @@ var THREE_DIGIT_AREA_CODES = /* @__PURE__ */ new Set([
|
|
|
6363
6465
|
"063"
|
|
6364
6466
|
]);
|
|
6365
6467
|
function formatPhoneNumber(value) {
|
|
6366
|
-
|
|
6468
|
+
const digits = value.replace(/\D/g, "");
|
|
6367
6469
|
if (digits.startsWith("02")) {
|
|
6368
6470
|
if (digits.length > 2 && digits.length <= 6) {
|
|
6369
6471
|
return `${digits.slice(0, 2)}-${digits.slice(2)}`;
|
|
@@ -6400,6 +6502,12 @@ function formatNumberWithCommas(value) {
|
|
|
6400
6502
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
6401
6503
|
return parts.join(".");
|
|
6402
6504
|
}
|
|
6505
|
+
function parseFormattedNumber(value) {
|
|
6506
|
+
const digitsOnly = value.replace(/,/g, "").replace(/[^\d.]/g, "");
|
|
6507
|
+
if (digitsOnly === "" || digitsOnly === ".") return void 0;
|
|
6508
|
+
const num = Number(digitsOnly);
|
|
6509
|
+
return Number.isNaN(num) ? void 0 : num;
|
|
6510
|
+
}
|
|
6403
6511
|
function removeNonNumeric(value, allowDecimal = false) {
|
|
6404
6512
|
if (allowDecimal) {
|
|
6405
6513
|
return value.replace(/[^\d.]/g, "").replace(/(\..*?)\./g, "$1");
|
|
@@ -12017,6 +12125,6 @@ function useParams(initialParams) {
|
|
|
12017
12125
|
};
|
|
12018
12126
|
}
|
|
12019
12127
|
|
|
12020
|
-
export { ArrowIcon, Badge, BaseUploader, BreadCrumb, Button, Carousel_default as Carousel, Checkbox, DatePicker, DebouncedButton, DetailContent, DetailModalFrame, DetailPageFrame, Empty, ExcelUploader, FilePreviewViewer, FileUploader, Input2 as Input, Loading, LoadingOverlay, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, ModalIconHeader, ModalOverlay, MultiTabBar as MultiTab, PageFilter, Pagination, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverFooter, PopoverHeader, PopoverTitle, PopoverTrigger, Radio, RadioGroup, RichEditor_default as RichEditor, RichEditorContent, RichEditorToolbar, ScrollArea_default as ScrollArea, ScrollBar, SearchAddress, SearchBar, Select2 as Select, Select as SelectBase, SelectContent, SelectGroup2 as SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Sidebar, SimplePopover, Skeleton, Slider, Spinner, SubmitForm, Switch, Tab, Table, Textarea, ToastProvider, ToggleSwitch, Tooltip2 as Tooltip, Z_INDEX, buildBreadCrumbItems, buttonVariants, cn, confirmModal, findParentMenuItem, findParentMenuName, formatDate, getFileLabel, getPreviewFileType, isCalendarDayAfterMax, isDateInRange, switchTrackSizes, textVariants, toast, useBlockModalConfirm, useBreadCrumbItems, useCustomBlocker, useDetailController, useFilePreviewViewer, useModal, useMultiTabStore, useParams, useRichEditor, useScrollToTop, useStableImageSrc, useToast, validateAndFormatInput };
|
|
12128
|
+
export { ArrowIcon, Badge, BaseUploader, BreadCrumb, Button, Carousel_default as Carousel, Checkbox, DatePicker, DebouncedButton, DetailContent, DetailModalFrame, DetailPageFrame, Empty, ExcelUploader, FilePreviewViewer, FileUploader, Input2 as Input, Loading, LoadingOverlay, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, ModalIconHeader, ModalOverlay, MultiTabBar as MultiTab, PageFilter, Pagination, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverFooter, PopoverHeader, PopoverTitle, PopoverTrigger, Radio, RadioGroup, RichEditor_default as RichEditor, RichEditorContent, RichEditorToolbar, ScrollArea_default as ScrollArea, ScrollBar, SearchAddress, SearchBar, Select2 as Select, Select as SelectBase, SelectContent, SelectGroup2 as SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Sidebar, SimplePopover, Skeleton, Slider, Spinner, SubmitForm, Switch, Tab, Table, Textarea, ToastProvider, ToggleSwitch, Tooltip2 as Tooltip, Z_INDEX, buildBreadCrumbItems, buttonVariants, cn, confirmModal, findParentMenuItem, findParentMenuName, formatDate, formatNumberWithCommas, getFileLabel, getPreviewFileType, isCalendarDayAfterMax, isDateInRange, parseFormattedNumber, switchTrackSizes, textVariants, toast, useBlockModalConfirm, useBreadCrumbItems, useCustomBlocker, useDetailController, useFilePreviewViewer, useModal, useMultiTabStore, useParams, useRichEditor, useScrollToTop, useStableImageSrc, useToast, validateAndFormatInput };
|
|
12021
12129
|
//# sourceMappingURL=index.js.map
|
|
12022
12130
|
//# sourceMappingURL=index.js.map
|