@ncds/ui-admin 1.8.4 → 1.8.6
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/cjs/assets/scripts/featuredIcon.js +87 -0
- package/dist/cjs/assets/scripts/notification/FloatingNotification.js +178 -0
- package/dist/cjs/assets/scripts/notification/FullWidthNotification.js +133 -0
- package/dist/cjs/assets/scripts/notification/MessageNotification.js +159 -0
- package/dist/cjs/assets/scripts/notification/Notification.js +120 -0
- package/dist/cjs/assets/scripts/notification/const/classNames.js +50 -0
- package/dist/cjs/assets/scripts/notification/const/icons.js +31 -0
- package/dist/cjs/assets/scripts/notification/const/index.js +87 -0
- package/dist/cjs/assets/scripts/notification/const/sizes.js +46 -0
- package/dist/cjs/assets/scripts/notification/const/types.js +14 -0
- package/dist/cjs/assets/scripts/notification/index.js +116 -0
- package/dist/cjs/assets/scripts/notification/positionSync.js +180 -0
- package/dist/cjs/assets/scripts/notification/utils.js +122 -0
- package/dist/cjs/assets/scripts/shared/ButtonCloseX.js +45 -0
- package/dist/cjs/assets/scripts/utils/sanitize.js +39 -0
- package/dist/cjs/src/components/data-display/data-grid/DataGrid.js +5 -1
- package/dist/cjs/src/components/data-display/table/Table.js +118 -96
- package/dist/cjs/src/components/data-display/table/useTableScrollbars.js +187 -0
- package/dist/cjs/src/components/forms-and-input/combo-box/ComboBox.js +11 -10
- package/dist/cjs/src/components/forms-and-input/image-file-input/ImageFileInput.js +5 -2
- package/dist/cjs/src/components/forms-and-input/select-box/SelectBox.js +67 -29
- package/dist/cjs/src/components/forms-and-input/slider/Slider.js +2 -3
- package/dist/cjs/src/components/overlays/dropdown/Dropdown.js +47 -19
- package/dist/cjs/src/components/overlays/notification/CalloutNotification.js +25 -0
- package/dist/cjs/src/components/overlays/notification/FloatingNotification.js +86 -13
- package/dist/cjs/src/components/overlays/notification/Notification.js +7 -0
- package/dist/cjs/src/components/overlays/notification/host.js +12 -0
- package/dist/cjs/src/components/overlays/tooltip/Tooltip.js +57 -44
- package/dist/cjs/src/components/select-dropdown/SelectDropdown.js +2 -1
- package/dist/cjs/src/contexts/FloatingContext.js +11 -0
- package/dist/cjs/src/contexts/index.js +16 -0
- package/dist/cjs/src/hooks/index.js +11 -0
- package/dist/cjs/src/hooks/useFloatingPosition.js +78 -0
- package/dist/cjs/src/hooks/usePortalState.js +17 -0
- package/dist/cjs/src/types/component-meta.js +8 -1
- package/dist/cjs/src/utils/dropdown/maxSelection.js +35 -0
- package/dist/cjs/src/utils/dropdown/multiSelect.js +72 -15
- package/dist/esm/assets/scripts/featuredIcon.js +80 -0
- package/dist/esm/assets/scripts/notification/FloatingNotification.js +171 -0
- package/dist/esm/assets/scripts/notification/FullWidthNotification.js +126 -0
- package/dist/esm/assets/scripts/notification/MessageNotification.js +152 -0
- package/dist/esm/assets/scripts/notification/Notification.js +113 -0
- package/dist/esm/assets/scripts/notification/const/classNames.js +44 -0
- package/dist/esm/assets/scripts/notification/const/icons.js +25 -0
- package/dist/esm/assets/scripts/notification/const/index.js +4 -0
- package/dist/esm/assets/scripts/notification/const/sizes.js +40 -0
- package/dist/esm/assets/scripts/notification/const/types.js +8 -0
- package/dist/esm/assets/scripts/notification/index.js +10 -0
- package/dist/esm/assets/scripts/notification/positionSync.js +171 -0
- package/dist/esm/assets/scripts/notification/utils.js +109 -0
- package/dist/esm/assets/scripts/shared/ButtonCloseX.js +37 -0
- package/dist/esm/assets/scripts/utils/sanitize.js +31 -0
- package/dist/esm/src/components/data-display/data-grid/DataGrid.js +5 -1
- package/dist/esm/src/components/data-display/table/Table.js +118 -96
- package/dist/esm/src/components/data-display/table/useTableScrollbars.js +179 -0
- package/dist/esm/src/components/forms-and-input/combo-box/ComboBox.js +11 -10
- package/dist/esm/src/components/forms-and-input/image-file-input/ImageFileInput.js +5 -2
- package/dist/esm/src/components/forms-and-input/select-box/SelectBox.js +67 -29
- package/dist/esm/src/components/forms-and-input/slider/Slider.js +1 -2
- package/dist/esm/src/components/overlays/dropdown/Dropdown.js +47 -19
- package/dist/esm/src/components/overlays/notification/CalloutNotification.js +19 -0
- package/dist/esm/src/components/overlays/notification/FloatingNotification.js +86 -14
- package/dist/esm/src/components/overlays/notification/Notification.js +7 -0
- package/dist/esm/src/components/overlays/notification/host.js +9 -0
- package/dist/esm/src/components/overlays/tooltip/Tooltip.js +58 -45
- package/dist/esm/src/components/select-dropdown/SelectDropdown.js +2 -1
- package/dist/esm/src/contexts/FloatingContext.js +4 -0
- package/dist/esm/src/contexts/index.js +1 -0
- package/dist/esm/src/hooks/index.js +1 -0
- package/dist/esm/src/hooks/useFloatingPosition.js +71 -0
- package/dist/esm/src/hooks/usePortalState.js +10 -0
- package/dist/esm/src/types/component-meta.js +5 -1
- package/dist/esm/src/utils/dropdown/maxSelection.js +27 -0
- package/dist/esm/src/utils/dropdown/multiSelect.js +70 -14
- package/dist/temp/assets/scripts/featuredIcon.d.ts +22 -0
- package/dist/temp/assets/scripts/featuredIcon.js +79 -0
- package/dist/temp/assets/scripts/notification/FloatingNotification.d.ts +24 -0
- package/dist/temp/assets/scripts/notification/FloatingNotification.js +156 -0
- package/dist/temp/assets/scripts/notification/FullWidthNotification.d.ts +21 -0
- package/dist/temp/assets/scripts/notification/FullWidthNotification.js +111 -0
- package/dist/temp/assets/scripts/notification/MessageNotification.d.ts +22 -0
- package/dist/temp/assets/scripts/notification/MessageNotification.js +140 -0
- package/dist/temp/assets/scripts/notification/Notification.d.ts +22 -0
- package/dist/temp/assets/scripts/notification/Notification.js +112 -0
- package/dist/temp/assets/scripts/notification/const/classNames.d.ts +43 -0
- package/dist/temp/assets/scripts/notification/const/classNames.js +44 -0
- package/dist/temp/assets/scripts/notification/const/icons.d.ts +25 -0
- package/dist/temp/assets/scripts/notification/const/icons.js +25 -0
- package/dist/temp/assets/scripts/notification/const/index.d.ts +5 -0
- package/dist/temp/assets/scripts/notification/const/index.js +4 -0
- package/dist/temp/assets/scripts/notification/const/sizes.d.ts +32 -0
- package/dist/temp/assets/scripts/notification/const/sizes.js +40 -0
- package/dist/temp/assets/scripts/notification/const/types.d.ts +19 -0
- package/dist/temp/assets/scripts/notification/const/types.js +8 -0
- package/dist/temp/assets/scripts/notification/index.d.ts +8 -0
- package/dist/temp/assets/scripts/notification/index.js +10 -0
- package/dist/temp/assets/scripts/notification/positionSync.d.ts +50 -0
- package/dist/temp/assets/scripts/notification/positionSync.js +170 -0
- package/dist/temp/assets/scripts/notification/utils.d.ts +8 -0
- package/dist/temp/assets/scripts/notification/utils.js +115 -0
- package/dist/temp/assets/scripts/shared/ButtonCloseX.d.ts +5 -0
- package/dist/temp/assets/scripts/shared/ButtonCloseX.js +33 -0
- package/dist/temp/assets/scripts/utils/sanitize.d.ts +22 -0
- package/dist/temp/assets/scripts/utils/sanitize.js +31 -0
- package/dist/temp/src/components/data-display/data-grid/DataGrid.js +1 -1
- package/dist/temp/src/components/data-display/data-grid/DataGrid.types.d.ts +7 -0
- package/dist/temp/src/components/data-display/table/Table.d.ts +4 -1
- package/dist/temp/src/components/data-display/table/Table.js +53 -68
- package/dist/temp/src/components/data-display/table/types.d.ts +18 -0
- package/dist/temp/src/components/data-display/table/useTableScrollbars.d.ts +25 -0
- package/dist/temp/src/components/data-display/table/useTableScrollbars.js +136 -0
- package/dist/temp/src/components/forms-and-input/combo-box/ComboBox.d.ts +8 -0
- package/dist/temp/src/components/forms-and-input/combo-box/ComboBox.js +7 -11
- package/dist/temp/src/components/forms-and-input/image-file-input/ImageFileInput.js +1 -1
- package/dist/temp/src/components/forms-and-input/select-box/SelectBox.d.ts +13 -0
- package/dist/temp/src/components/forms-and-input/select-box/SelectBox.js +30 -3
- package/dist/temp/src/components/forms-and-input/slider/Slider.d.ts +0 -1
- package/dist/temp/src/components/forms-and-input/slider/Slider.js +0 -1
- package/dist/temp/src/components/overlays/dropdown/Dropdown.d.ts +5 -0
- package/dist/temp/src/components/overlays/dropdown/Dropdown.js +35 -11
- package/dist/temp/src/components/overlays/notification/CalloutNotification.d.ts +9 -0
- package/dist/temp/src/components/overlays/notification/CalloutNotification.js +6 -0
- package/dist/temp/src/components/overlays/notification/FloatingNotification.d.ts +15 -0
- package/dist/temp/src/components/overlays/notification/FloatingNotification.js +81 -13
- package/dist/temp/src/components/overlays/notification/Notification.d.ts +18 -3
- package/dist/temp/src/components/overlays/notification/Notification.js +4 -0
- package/dist/temp/src/components/overlays/notification/host.d.ts +9 -0
- package/dist/temp/src/components/overlays/notification/host.js +9 -0
- package/dist/temp/src/components/overlays/tooltip/Tooltip.d.ts +5 -1
- package/dist/temp/src/components/overlays/tooltip/Tooltip.js +25 -22
- package/dist/temp/src/components/select-dropdown/SelectDropdown.d.ts +6 -0
- package/dist/temp/src/components/select-dropdown/SelectDropdown.js +2 -2
- package/dist/temp/src/contexts/FloatingContext.d.ts +6 -0
- package/dist/temp/src/contexts/FloatingContext.js +4 -0
- package/dist/temp/src/contexts/index.d.ts +1 -0
- package/dist/temp/src/contexts/index.js +1 -0
- package/dist/temp/src/hooks/index.d.ts +1 -0
- package/dist/temp/src/hooks/index.js +1 -0
- package/dist/temp/src/hooks/useFloatingPosition.d.ts +19 -0
- package/dist/temp/src/hooks/useFloatingPosition.js +55 -0
- package/dist/temp/src/hooks/usePortalState.d.ts +6 -0
- package/dist/temp/src/hooks/usePortalState.js +7 -0
- package/dist/temp/src/types/component-meta.d.ts +6 -2
- package/dist/temp/src/types/component-meta.js +14 -1
- package/dist/temp/src/utils/dropdown/maxSelection.d.ts +24 -0
- package/dist/temp/src/utils/dropdown/maxSelection.js +28 -0
- package/dist/temp/src/utils/dropdown/multiSelect.d.ts +42 -2
- package/dist/temp/src/utils/dropdown/multiSelect.js +66 -13
- package/dist/types/assets/scripts/featuredIcon.d.ts +22 -0
- package/dist/types/assets/scripts/notification/FloatingNotification.d.ts +24 -0
- package/dist/types/assets/scripts/notification/FullWidthNotification.d.ts +21 -0
- package/dist/types/assets/scripts/notification/MessageNotification.d.ts +22 -0
- package/dist/types/assets/scripts/notification/Notification.d.ts +22 -0
- package/dist/types/assets/scripts/notification/const/classNames.d.ts +43 -0
- package/dist/types/assets/scripts/notification/const/icons.d.ts +25 -0
- package/dist/types/assets/scripts/notification/const/index.d.ts +5 -0
- package/dist/types/assets/scripts/notification/const/sizes.d.ts +32 -0
- package/dist/types/assets/scripts/notification/const/types.d.ts +19 -0
- package/dist/types/assets/scripts/notification/index.d.ts +8 -0
- package/dist/types/assets/scripts/notification/positionSync.d.ts +50 -0
- package/dist/types/assets/scripts/notification/utils.d.ts +8 -0
- package/dist/types/assets/scripts/shared/ButtonCloseX.d.ts +5 -0
- package/dist/types/assets/scripts/utils/sanitize.d.ts +22 -0
- package/dist/types/src/components/data-display/data-grid/DataGrid.types.d.ts +7 -0
- package/dist/types/src/components/data-display/table/Table.d.ts +4 -1
- package/dist/types/src/components/data-display/table/types.d.ts +18 -0
- package/dist/types/src/components/data-display/table/useTableScrollbars.d.ts +25 -0
- package/dist/types/src/components/forms-and-input/combo-box/ComboBox.d.ts +8 -0
- package/dist/types/src/components/forms-and-input/select-box/SelectBox.d.ts +13 -0
- package/dist/types/src/components/forms-and-input/slider/Slider.d.ts +0 -1
- package/dist/types/src/components/overlays/dropdown/Dropdown.d.ts +5 -0
- package/dist/types/src/components/overlays/notification/CalloutNotification.d.ts +9 -0
- package/dist/types/src/components/overlays/notification/FloatingNotification.d.ts +15 -0
- package/dist/types/src/components/overlays/notification/Notification.d.ts +18 -3
- package/dist/types/src/components/overlays/notification/host.d.ts +9 -0
- package/dist/types/src/components/overlays/tooltip/Tooltip.d.ts +5 -1
- package/dist/types/src/components/select-dropdown/SelectDropdown.d.ts +6 -0
- package/dist/types/src/contexts/FloatingContext.d.ts +6 -0
- package/dist/types/src/contexts/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/useFloatingPosition.d.ts +19 -0
- package/dist/types/src/hooks/usePortalState.d.ts +6 -0
- package/dist/types/src/types/component-meta.d.ts +6 -2
- package/dist/types/src/utils/dropdown/maxSelection.d.ts +24 -0
- package/dist/types/src/utils/dropdown/multiSelect.d.ts +42 -2
- package/dist/ui-admin/assets/styles/style.css +312 -64
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTML 문자열을 DOMPurify 기본 설정으로 sanitize한다.
|
|
3
|
+
*
|
|
4
|
+
* 제거되는 항목 (기본 설정):
|
|
5
|
+
* - `<script>`, `<iframe>`, `<object>` 등 실행 위험 태그
|
|
6
|
+
* - `onclick`, `onerror` 등 inline 이벤트 핸들러 속성
|
|
7
|
+
* - `href="javascript:..."` 같은 javascript: URL
|
|
8
|
+
*
|
|
9
|
+
* 유지되는 항목:
|
|
10
|
+
* - `<svg>`, `<button>`, `<div>`, `<span>`, `<input>` 등 일반 HTML/SVG 태그
|
|
11
|
+
* - `class`, `style`, `role`, `aria-*`, `data-*` 등 표현용 속성
|
|
12
|
+
* - SVG 표현 속성 (`viewBox`, `stroke`, `fill` 등)
|
|
13
|
+
*
|
|
14
|
+
* 이벤트 바인딩은 addEventListener로 별도 처리할 것.
|
|
15
|
+
*/
|
|
16
|
+
export declare function sanitizeHtml(dirty: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* 엘리먼트에 콘텐츠를 안전하게 설정한다.
|
|
19
|
+
* - string: sanitize 후 innerHTML 교체
|
|
20
|
+
* - HTMLElement: 기존 자식 제거 후 appendChild
|
|
21
|
+
*/
|
|
22
|
+
export declare function setSafeInnerHTML(element: HTMLElement, content: string | HTMLElement): void;
|
|
@@ -29,6 +29,13 @@ export type DataGridTableProps = {
|
|
|
29
29
|
maxHeight?: string | number;
|
|
30
30
|
hoverable?: boolean;
|
|
31
31
|
selectable?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* 가로 스크롤 활성화 시 외부 wrapper에 overflow-x: auto를 적용하고,
|
|
34
|
+
* 내부의 SelectBox·Dropdown이 FloatingProvider를 통해 자동으로 Portal 렌더로 전환된다.
|
|
35
|
+
*/
|
|
36
|
+
horizontalScroll?: boolean;
|
|
37
|
+
/** 가로 스크롤 트리거 임계 너비. horizontalScroll=true 일 때만 의미가 있다. */
|
|
38
|
+
minWidth?: string | number;
|
|
32
39
|
};
|
|
33
40
|
export type DataGridPaginationProps = ComponentProps<'div'> & {
|
|
34
41
|
children: ReactNode;
|
|
@@ -6,6 +6,8 @@ export declare const Table: import("react").ForwardRefExoticComponent<Omit<impor
|
|
|
6
6
|
maxHeight?: string | number | undefined;
|
|
7
7
|
hoverable?: boolean | undefined;
|
|
8
8
|
selectable?: boolean | undefined;
|
|
9
|
+
horizontalScroll?: boolean | undefined;
|
|
10
|
+
minWidth?: string | number | undefined;
|
|
9
11
|
children: ReactNode;
|
|
10
12
|
} & import("react").RefAttributes<HTMLDivElement>> & {
|
|
11
13
|
Header: {
|
|
@@ -24,6 +26,7 @@ export declare const Table: import("react").ForwardRefExoticComponent<Omit<impor
|
|
|
24
26
|
sortDirection?: SortDirection | undefined;
|
|
25
27
|
onSort?: (() => void) | undefined;
|
|
26
28
|
width?: string | number | undefined;
|
|
29
|
+
minWidth?: string | number | undefined;
|
|
27
30
|
} & import("react").RefAttributes<HTMLTableCellElement>>;
|
|
28
31
|
Cell: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "ref"> & {
|
|
29
32
|
isHeader?: boolean | undefined;
|
|
@@ -37,7 +40,7 @@ export declare const Table: import("react").ForwardRefExoticComponent<Omit<impor
|
|
|
37
40
|
displayName: string;
|
|
38
41
|
};
|
|
39
42
|
ColGroup: {
|
|
40
|
-
({ widths }: TableColGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
({ widths, minWidths }: TableColGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
41
44
|
displayName: string;
|
|
42
45
|
};
|
|
43
46
|
Empty: {
|
|
@@ -8,6 +8,17 @@ export type TableProps = Omit<ComponentProps<'div'>, 'ref'> & {
|
|
|
8
8
|
maxHeight?: string | number;
|
|
9
9
|
hoverable?: boolean;
|
|
10
10
|
selectable?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 가로 스크롤 활성화. 외곽에 overflow-x: auto wrapper가 추가되며,
|
|
13
|
+
* 내부의 SelectBox·Dropdown 등 floating 컴포넌트가 FloatingProvider를 통해
|
|
14
|
+
* 자동으로 React Portal 렌더로 전환된다.
|
|
15
|
+
*/
|
|
16
|
+
horizontalScroll?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 가로 스크롤 트리거 임계 너비. horizontalScroll=true 일 때만 의미가 있으며,
|
|
19
|
+
* 기본값은 1140 (14인치 모니터 + LNB 기준 디자인 권장 너비).
|
|
20
|
+
*/
|
|
21
|
+
minWidth?: string | number;
|
|
11
22
|
children: ReactNode;
|
|
12
23
|
};
|
|
13
24
|
export type TableHeaderProps = {
|
|
@@ -26,6 +37,11 @@ export type TableHeaderCellProps = Omit<ComponentProps<'th'>, 'ref'> & {
|
|
|
26
37
|
sortDirection?: SortDirection;
|
|
27
38
|
onSort?: () => void;
|
|
28
39
|
width?: string | number;
|
|
40
|
+
/**
|
|
41
|
+
* 셀 최소 너비. 가로 스크롤 정책에 따라 글자수 기준으로 설정한다.
|
|
42
|
+
* 예: 제목·메인 10자 ≈ 160px, 이름·일자 5자 ≈ 80px, 버튼 xxs ≈ 40~60px, 기타 2자 ≈ 32px.
|
|
43
|
+
*/
|
|
44
|
+
minWidth?: string | number;
|
|
29
45
|
};
|
|
30
46
|
export type TableCellProps = Omit<ComponentProps<'td'>, 'ref'> & {
|
|
31
47
|
isHeader?: boolean;
|
|
@@ -40,6 +56,8 @@ export type TablePaginationProps = {
|
|
|
40
56
|
};
|
|
41
57
|
export type TableColGroupProps = {
|
|
42
58
|
widths: (string | number)[];
|
|
59
|
+
/** 컬럼별 최소 너비. 가로 스크롤 시 셀이 더 좁아지지 않도록 강제한다. */
|
|
60
|
+
minWidths?: (string | number)[];
|
|
43
61
|
};
|
|
44
62
|
export type TableEmptyProps = {
|
|
45
63
|
colSpan: number;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type MouseEvent, type RefObject } from 'react';
|
|
2
|
+
export declare const TABLE_HEADER_HEIGHT = 40;
|
|
3
|
+
export declare const SCROLLBAR_THUMB_MIN_HEIGHT = 40;
|
|
4
|
+
export declare const H_SCROLLBAR_THUMB_MIN_WIDTH = 40;
|
|
5
|
+
export declare const H_SCROLLBAR_SIDE_GAP = 8;
|
|
6
|
+
export declare const SCROLLBAR_TRACK_OFFSET = 16;
|
|
7
|
+
type VerticalScrollbarOptions = {
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
scrollContainerRef: RefObject<HTMLDivElement | null>;
|
|
10
|
+
scrollAreaRef: RefObject<HTMLDivElement | null>;
|
|
11
|
+
thumbRef: RefObject<HTMLDivElement | null>;
|
|
12
|
+
};
|
|
13
|
+
export declare const useTableVerticalScrollbar: ({ enabled, scrollContainerRef, scrollAreaRef, thumbRef, }: VerticalScrollbarOptions) => {
|
|
14
|
+
handleThumbMouseDown: (e: MouseEvent<HTMLDivElement>) => void;
|
|
15
|
+
};
|
|
16
|
+
type HorizontalScrollbarOptions = {
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
hScrollContainerRef: RefObject<HTMLDivElement | null>;
|
|
19
|
+
hScrollbarRef: RefObject<HTMLDivElement | null>;
|
|
20
|
+
hThumbRef: RefObject<HTMLDivElement | null>;
|
|
21
|
+
};
|
|
22
|
+
export declare const useTableHorizontalScrollbar: ({ enabled, hScrollContainerRef, hScrollbarRef, hThumbRef, }: HorizontalScrollbarOptions) => {
|
|
23
|
+
handleHThumbMouseDown: (e: MouseEvent<HTMLDivElement>) => void;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -21,6 +21,14 @@ interface ComboBoxProps extends Omit<ComponentPropsWithRef<'div'>, 'size' | 'onC
|
|
|
21
21
|
required?: boolean;
|
|
22
22
|
multiple?: boolean;
|
|
23
23
|
showFooterButtons?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 최대 선택 가능 개수 (multiple=true에서만 유효).
|
|
26
|
+
* - `0` 이상의 정수: 제한 활성 → footer의 "전체선택" Link 미노출 (DES-SPEC-009 §3.10.1).
|
|
27
|
+
* - `0`은 모든 새 선택을 차단한다.
|
|
28
|
+
* - 양수는 도달 후 추가 선택을 무시한다 (이미 선택된 항목 해제는 정상).
|
|
29
|
+
* - 음수 / 비정수 / `null` / `undefined`: 제한 없음.
|
|
30
|
+
*/
|
|
31
|
+
maxSelection?: number | null;
|
|
24
32
|
onEdit?: () => void;
|
|
25
33
|
}
|
|
26
34
|
declare const ComboBox: import("react").ForwardRefExoticComponent<Omit<ComboBoxProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -19,8 +19,21 @@ type SelectBoxProps = Omit<ComponentPropsWithRef<'div'>, 'size' | 'onChange'> &
|
|
|
19
19
|
register?: UseFormRegisterReturn;
|
|
20
20
|
maxHeight?: number;
|
|
21
21
|
multiple?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* 최대 선택 가능 개수 (multiple=true에서만 유효).
|
|
24
|
+
* - `0` 이상의 정수: 제한 활성 → footer "전체선택" Link 미노출.
|
|
25
|
+
* - `0`은 모든 새 선택을 차단한다.
|
|
26
|
+
* - 양수는 도달 후 추가 선택을 무시한다 (이미 선택된 항목 해제는 정상).
|
|
27
|
+
* - 음수 / 비정수 / `null` / `undefined`: 제한 없음.
|
|
28
|
+
*/
|
|
29
|
+
maxSelection?: number | null;
|
|
22
30
|
onEdit?: () => void;
|
|
23
31
|
align?: 'left' | 'right';
|
|
32
|
+
/**
|
|
33
|
+
* 옵션 패널을 React Portal로 body에 렌더한다.
|
|
34
|
+
* 미지정 시 FloatingContext.preferPortal 값을 따른다 (DataGrid.Table horizontalScroll 내부에서는 자동 true).
|
|
35
|
+
*/
|
|
36
|
+
usePortal?: boolean;
|
|
24
37
|
};
|
|
25
38
|
declare const SelectBox: import("react").ForwardRefExoticComponent<Omit<SelectBoxProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
39
|
export type { SelectBoxProps };
|
|
@@ -49,6 +49,11 @@ export type DropdownBaseProps = {
|
|
|
49
49
|
className?: string;
|
|
50
50
|
opened?: boolean;
|
|
51
51
|
closeOnClickOutside?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* 메뉴를 React Portal로 body에 렌더한다.
|
|
54
|
+
* 미지정 시 FloatingContext.preferPortal 값을 따른다 (DataGrid.Table horizontalScroll 내부에서는 자동 true).
|
|
55
|
+
*/
|
|
56
|
+
usePortal?: boolean;
|
|
52
57
|
};
|
|
53
58
|
export type ActionDropdownProps = DropdownBaseProps & {
|
|
54
59
|
variant?: 'action';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
|
+
import type { NotificationColor } from './Notification';
|
|
3
|
+
interface CalloutNotificationProps extends Omit<ComponentPropsWithoutRef<'div'>, 'title'> {
|
|
4
|
+
color?: NotificationColor;
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare const CalloutNotification: import("react").ForwardRefExoticComponent<CalloutNotificationProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export type { CalloutNotificationProps };
|
|
9
|
+
export { CalloutNotification };
|
|
@@ -31,6 +31,21 @@ interface FloatingNotificationProps extends Omit<ComponentPropsWithoutRef<'div'>
|
|
|
31
31
|
* @default 0
|
|
32
32
|
*/
|
|
33
33
|
autoClose?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Portal 마운트 여부.
|
|
36
|
+
*
|
|
37
|
+
* - `false` (기본값): 부모 JSX 트리 안에 카드로 그대로 렌더된다.
|
|
38
|
+
* 특정 컨테이너 안에서 표시하거나, 인라인 미리보기 (docs/스토리북) 용도.
|
|
39
|
+
*
|
|
40
|
+
* - `true`: document.body의 `.ncua-floating-notification-host` 싱글톤에
|
|
41
|
+
* `createPortal`로 마운트되어 우측 상단에 노출. 다중 발생 시 최신 토스트가
|
|
42
|
+
* 상단에 노출되고 이전 토스트들이 아래로 12px씩 겹쳐 쌓인다 (LIFO,
|
|
43
|
+
* `--ncua-floating-notification-stack-overlap` 변수로 조정 가능).
|
|
44
|
+
* Vanilla(CDN) 측 `new ncua.Notification({type:'floating'}).show()` 와 동일한 동작.
|
|
45
|
+
*
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
portal?: boolean;
|
|
34
49
|
}
|
|
35
50
|
declare const FloatingNotification: import("react").ForwardRefExoticComponent<FloatingNotificationProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
36
51
|
export type { FloatingNotificationProps };
|
|
@@ -2,7 +2,8 @@ import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
|
2
2
|
import type { ColorTone } from '../../../../constant/color';
|
|
3
3
|
import type { SlotIconComponent } from '../../../types/side-slot';
|
|
4
4
|
import type { ButtonTheme } from '../../action/button';
|
|
5
|
-
|
|
5
|
+
import { type CalloutNotificationProps } from './CalloutNotification';
|
|
6
|
+
type NotificationType = 'floating' | 'full-width' | 'message' | 'callout';
|
|
6
7
|
type NotificationColor = Extract<ColorTone, 'neutral' | 'error' | 'warning' | 'success' | 'info'>;
|
|
7
8
|
type NotificationSize = 'desktop' | 'mobile';
|
|
8
9
|
interface NotificationAction {
|
|
@@ -26,9 +27,9 @@ interface NotificationProps extends Omit<ComponentPropsWithoutRef<'div'>, 'title
|
|
|
26
27
|
*/
|
|
27
28
|
type?: NotificationType;
|
|
28
29
|
/**
|
|
29
|
-
* 알림 제목 텍스트
|
|
30
|
+
* 알림 제목 텍스트 (callout 유형에서는 안내 텍스트로 사용)
|
|
30
31
|
*/
|
|
31
|
-
title
|
|
32
|
+
title?: ReactNode;
|
|
32
33
|
/**
|
|
33
34
|
* 알림 본문 텍스트 (선택사항)
|
|
34
35
|
*/
|
|
@@ -66,7 +67,21 @@ interface NotificationProps extends Omit<ComponentPropsWithoutRef<'div'>, 'title
|
|
|
66
67
|
* message, full-width 타입에서 사용 가능
|
|
67
68
|
*/
|
|
68
69
|
onHidePermanently?: () => void;
|
|
70
|
+
/**
|
|
71
|
+
* Portal 마운트 여부. `floating` 타입에서만 동작한다.
|
|
72
|
+
*
|
|
73
|
+
* 기본값 `false`에서는 부모 JSX 트리 안에 카드로 그대로 렌더된다.
|
|
74
|
+
* `true`로 설정하면 자동으로 document.body의 `.ncua-floating-notification-host`
|
|
75
|
+
* 호스트에 createPortal로 마운트되어 우측 상단에 노출되고 LIFO로 스택된다
|
|
76
|
+
* — 최신 토스트가 상단에 노출되고 이전 토스트들이 아래로 12px씩 겹쳐 쌓인다
|
|
77
|
+
* (vanilla `Notification.show()`와 동일, `--ncua-floating-notification-stack-overlap`
|
|
78
|
+
* 변수로 조정 가능).
|
|
79
|
+
*
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
portal?: boolean;
|
|
69
83
|
}
|
|
70
84
|
declare const Notification: import("react").ForwardRefExoticComponent<NotificationProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
71
85
|
export type { NotificationType, NotificationColor, NotificationSize, NotificationAction, NotificationProps };
|
|
86
|
+
export type { CalloutNotificationProps };
|
|
72
87
|
export { Notification };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Floating Notification 호스트 관리 — React 측 진입점.
|
|
3
|
+
*
|
|
4
|
+
* 실제 구현은 vanilla/React 가 공유하는 `assets/scripts/notification/positionSync.ts` 에 있고,
|
|
5
|
+
* 외부 노출은 그 폴더의 public barrel(`assets/scripts/notification/index.ts`)이 담당한다.
|
|
6
|
+
* 이 모듈은 React 컴포넌트가 vanilla 내부 파일을 직접 참조하지 않도록 barrel 을 경유하는
|
|
7
|
+
* 한 단계 re-export 만 제공한다 — positionSync.ts 의 위치/이름이 바뀌어도 host.ts 만 영향.
|
|
8
|
+
*/
|
|
9
|
+
export { mountFloatingNotificationHost } from '../../../../assets/scripts/notification';
|
|
@@ -12,6 +12,10 @@ interface TooltipProps {
|
|
|
12
12
|
iconColor?: string;
|
|
13
13
|
iconStyle?: 'help-circle' | 'alert-circle';
|
|
14
14
|
zIndex?: number;
|
|
15
|
+
/** 외부에서 직접 패널 표시 여부를 제어 */
|
|
16
|
+
forceVisible?: boolean;
|
|
17
|
+
/** true이면 Portal 없이 앵커 내부에 패널을 인라인 렌더링. CSS 기반 위치 지정이 필요한 경우 사용 */
|
|
18
|
+
disablePortal?: boolean;
|
|
15
19
|
}
|
|
16
|
-
export declare const Tooltip: ({ tooltipType, iconType, position, size, title, content, hideArrow, type, iconColor, iconStyle, className, zIndex, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const Tooltip: ({ tooltipType, iconType, position, size, title, content, hideArrow, type, iconColor, iconStyle, className, zIndex, forceVisible, disablePortal, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
21
|
export {};
|
|
@@ -17,6 +17,12 @@ type SelectDropdownProps = ComponentPropsWithRef<'div'> & {
|
|
|
17
17
|
multiple?: boolean;
|
|
18
18
|
showFooterButtons?: boolean;
|
|
19
19
|
selectAllButtonText?: string;
|
|
20
|
+
/**
|
|
21
|
+
* footer의 "전체 선택" Link 노출 여부 (default: `true`).
|
|
22
|
+
* footer 자체(편집/선택 완료 버튼)는 영향받지 않는다.
|
|
23
|
+
* 호출자가 도메인 조건(예: 최대 선택 개수 제한)에 따라 `false`로 내리면 Link만 숨겨진다.
|
|
24
|
+
*/
|
|
25
|
+
showSelectAllAction?: boolean;
|
|
20
26
|
onSelectAll?: () => void;
|
|
21
27
|
onEdit?: () => void;
|
|
22
28
|
onComplete?: () => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type FloatingContextValue = {
|
|
2
|
+
preferPortal: boolean;
|
|
3
|
+
portalContainer?: HTMLElement | null;
|
|
4
|
+
};
|
|
5
|
+
export declare const FloatingProvider: import("react").Provider<FloatingContextValue | null>;
|
|
6
|
+
export declare const useFloatingContext: () => FloatingContextValue | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FloatingContext';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type CSSProperties, type RefObject } from 'react';
|
|
2
|
+
type FloatingDirection = 'up' | 'down';
|
|
3
|
+
type UseFloatingPositionParams = {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
triggerRef: RefObject<HTMLElement | null>;
|
|
7
|
+
floatingRef: RefObject<HTMLElement | null>;
|
|
8
|
+
direction: FloatingDirection;
|
|
9
|
+
offset?: number;
|
|
10
|
+
align?: 'left' | 'right';
|
|
11
|
+
/**
|
|
12
|
+
* true면 floating 요소의 width를 trigger 너비에 맞춘다.
|
|
13
|
+
* Portal 모드에서 부모가 body로 바뀌면서 min-width: 100% 같은 CSS가 viewport 너비로
|
|
14
|
+
* 폭주하는 것을 막는다 (예: SelectBox 옵션 패널).
|
|
15
|
+
*/
|
|
16
|
+
matchTriggerWidth?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare const useFloatingPosition: ({ enabled, isOpen, triggerRef, floatingRef, direction, offset, align, matchTriggerWidth, }: UseFloatingPositionParams) => CSSProperties | null;
|
|
19
|
+
export {};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/** AI 에이전트용 컴포넌트 메타데이터 타입 */
|
|
2
|
-
/**
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* 컴포넌트 카테고리 — `src/components/` 하위 디렉토리명과 동일.
|
|
4
|
+
* 타입과 런타임 값을 한 곳에서 정의해 추가/변경 시 동기화 누락을 막는다.
|
|
5
|
+
*/
|
|
6
|
+
export declare const COMPONENT_CATEGORIES: readonly ["action", "data-display", "feedback-and-status", "forms-and-input", "image-and-icons", "layout", "navigation", "overlays"];
|
|
7
|
+
export type ComponentCategory = (typeof COMPONENT_CATEGORIES)[number];
|
|
4
8
|
export interface ComponentMeta {
|
|
5
9
|
category: ComponentCategory;
|
|
6
10
|
aliases: string[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SelectBox / ComboBox 공통 — 최대 선택 개수 제한 활성 여부 판정.
|
|
3
|
+
*
|
|
4
|
+
* React 훅(`useMultiSelect`)과 vanilla 드롭다운(`DropdownModel`)가 동일 로직을 공유하므로
|
|
5
|
+
* 두 곳에 정의가 갈라지지 않도록 단일 source-of-truth로 둔다.
|
|
6
|
+
*
|
|
7
|
+
* **계약**
|
|
8
|
+
* - `0` 이상의 정수 → 활성 (단, `0`은 모든 새 선택을 차단하는 의미)
|
|
9
|
+
* - 음수 / 비정수 / `undefined` / `null` → 비활성 (제한 없는 것과 동일)
|
|
10
|
+
*
|
|
11
|
+
* `0`을 활성으로 보는 이유: 호출자가 `maxSelection={0}`을 명시적으로 전달했을 때
|
|
12
|
+
* "선택 자체를 막겠다"는 의도로 해석하기 위함. 음수는 일반적으로 "값 없음"의 sentinel이므로 비활성.
|
|
13
|
+
*/
|
|
14
|
+
export declare const isMaxSelectionLimitActive: (maxSelection?: number | null) => maxSelection is number;
|
|
15
|
+
/**
|
|
16
|
+
* 현재 선택 길이가 최대치에 도달했는지 단일 함수로 판정.
|
|
17
|
+
*
|
|
18
|
+
* 호출 측에서 `>=`을 직접 작성하지 않도록 의미를 노출하고, type predicate가 내부에서 적용되어
|
|
19
|
+
* `maxSelection`의 narrowing이 보장된다 (외부 predicate 호출로 인한 narrowing 누락 방지).
|
|
20
|
+
*
|
|
21
|
+
* - 제한 비활성(음수 / null / undefined / 비정수): 항상 `false`.
|
|
22
|
+
* - 활성: `currentLength >= maxSelection`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const isMaxSelectionReached: (currentLength: number, maxSelection?: number | null) => boolean;
|
|
@@ -19,13 +19,53 @@ export declare const getSelectedTags: (selectedValues: (string | number)[], opti
|
|
|
19
19
|
* 태그 제거 시 선택값에서 해당 ID를 제거하는 유틸 함수
|
|
20
20
|
*/
|
|
21
21
|
export declare const removeTagFromSelected: (selectedValues: (string | number)[], tagIdToRemove: string | number) => (string | number)[];
|
|
22
|
+
export interface UseMultiSelectOptions {
|
|
23
|
+
/** 전체 선택 버튼의 라벨 (default: '전체 선택') */
|
|
24
|
+
selectText?: string;
|
|
25
|
+
/** 전체 해제 버튼의 라벨 (default: '전체 해제') */
|
|
26
|
+
deselectText?: string;
|
|
27
|
+
/**
|
|
28
|
+
* 최대 선택 가능 개수 (선택).
|
|
29
|
+
* - `0` 이상의 정수: 제한 활성 (`isMaxSelectionActive: true`).
|
|
30
|
+
* - `0`은 모든 새 선택을 차단한다 (이미 선택된 항목 해제는 정상 동작).
|
|
31
|
+
* - 양수는 해당 개수 도달 후 추가 선택을 무시한다.
|
|
32
|
+
* - 음수 / 비정수 / `null` / `undefined`: 제한 없음.
|
|
33
|
+
*/
|
|
34
|
+
maxSelection?: number | null;
|
|
35
|
+
}
|
|
22
36
|
/**
|
|
23
|
-
*
|
|
37
|
+
* 최대 선택 개수 관련 응집을 별도 훅으로 분리.
|
|
38
|
+
*
|
|
39
|
+
* - `isMaxSelectionActive`: 제한 활성 여부.
|
|
40
|
+
* - `isMaxReached`: 현재 선택 길이가 최대치에 도달했는지.
|
|
41
|
+
* - `canAdd(currentLength)`: 새 항목 추가가 허용되는지 (도달 시 `false`).
|
|
42
|
+
*
|
|
43
|
+
* 도메인 규칙(`>=` 비교 등)을 외부로 노출하지 않고 헬퍼를 통해 의미만 반환한다.
|
|
44
|
+
* `useMultiSelect`가 내부에서 사용하지만, 단독으로도 필요한 호출자가 쓸 수 있게 export한다.
|
|
24
45
|
*/
|
|
25
|
-
export declare const
|
|
46
|
+
export declare const useMaxSelection: (selectedValues: (string | number)[], maxSelection?: number | null) => {
|
|
47
|
+
isMaxSelectionActive: boolean;
|
|
48
|
+
isMaxReached: boolean;
|
|
49
|
+
canAdd: (currentLength: number) => boolean;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* 전체 선택 관련 로직을 한 번에 처리하는 커스텀 훅.
|
|
53
|
+
*
|
|
54
|
+
* 시그니처는 호출자가 maxSelection만 지정하더라도 텍스트 라벨을 건너뛰지 않도록 옵션 객체로 받는다.
|
|
55
|
+
*
|
|
56
|
+
* **반환의 `tryToggle`**: multiple 토글 결과를 직접 돌려준다.
|
|
57
|
+
* - 새 배열 반환: 정상 토글 (추가 또는 해제).
|
|
58
|
+
* - `null` 반환: 최대 개수 도달로 추가가 차단됨 (호출자는 변경 없이 종료해야 함).
|
|
59
|
+
*
|
|
60
|
+
* 호출자가 `>= maxSelection` 같은 도메인 규칙을 직접 검사하지 않도록 결과만 노출한다.
|
|
61
|
+
*/
|
|
62
|
+
export declare const useMultiSelect: (selectedValues: (string | number)[], options: MultiSelectOption[], config?: UseMultiSelectOptions) => {
|
|
26
63
|
isAllSelected: boolean;
|
|
27
64
|
buttonText: string;
|
|
28
65
|
toggleSelectAll: () => (string | number)[];
|
|
29
66
|
getSelectedTagsData: () => SelectedTag[];
|
|
30
67
|
removeTag: (tagId: string | number) => (string | number)[];
|
|
68
|
+
isMaxSelectionActive: boolean;
|
|
69
|
+
isMaxReached: boolean;
|
|
70
|
+
tryToggle: (optionId: string | number, currentArray: (string | number)[] | undefined) => (string | number)[] | null;
|
|
31
71
|
};
|