@ncds/ui-admin 1.8.11 → 1.8.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/cjs/src/components/data-display/data-grid/DataGrid.js +9 -5
- package/dist/cjs/src/components/data-display/table/Table.js +326 -75
- package/dist/cjs/src/components/data-display/table/dnd-context.js +15 -0
- package/dist/cjs/src/components/data-display/table/dnd-preview.js +127 -0
- package/dist/esm/src/components/data-display/data-grid/DataGrid.js +9 -5
- package/dist/esm/src/components/data-display/table/Table.js +328 -77
- package/dist/esm/src/components/data-display/table/dnd-context.js +10 -0
- package/dist/esm/src/components/data-display/table/dnd-preview.js +121 -0
- package/dist/temp/src/components/data-display/data-grid/DataGrid.d.ts +1 -0
- package/dist/temp/src/components/data-display/data-grid/DataGrid.js +8 -7
- package/dist/temp/src/components/data-display/data-grid/DataGrid.types.d.ts +6 -0
- package/dist/temp/src/components/data-display/table/Table.d.ts +14 -4
- package/dist/temp/src/components/data-display/table/Table.js +172 -14
- package/dist/temp/src/components/data-display/table/dnd-context.d.ts +12 -0
- package/dist/temp/src/components/data-display/table/dnd-context.js +10 -0
- package/dist/temp/src/components/data-display/table/dnd-preview.d.ts +6 -0
- package/dist/temp/src/components/data-display/table/dnd-preview.js +120 -0
- package/dist/temp/src/components/data-display/table/types.d.ts +24 -1
- package/dist/types/src/components/data-display/data-grid/DataGrid.d.ts +1 -0
- package/dist/types/src/components/data-display/data-grid/DataGrid.types.d.ts +6 -0
- package/dist/types/src/components/data-display/table/Table.d.ts +14 -4
- package/dist/types/src/components/data-display/table/dnd-context.d.ts +12 -0
- package/dist/types/src/components/data-display/table/dnd-preview.d.ts +6 -0
- package/dist/types/src/components/data-display/table/types.d.ts +24 -1
- package/dist/ui-admin/assets/styles/style.css +177 -2
- package/package.json +2 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type TableDndContextValue = {
|
|
2
|
+
isDraggable: boolean;
|
|
3
|
+
tableId: string;
|
|
4
|
+
};
|
|
5
|
+
declare const TableDndContext: import("react").Context<TableDndContextValue>;
|
|
6
|
+
type RowDndContextValue = {
|
|
7
|
+
dragId: string | undefined;
|
|
8
|
+
setIsDragging: (v: boolean) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const RowDndContext: import("react").Context<RowDndContextValue>;
|
|
11
|
+
export type { TableDndContextValue, RowDndContextValue };
|
|
12
|
+
export { TableDndContext, RowDndContext };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const TABLE_DND_ID_RADIX = 36;
|
|
2
|
+
declare const TABLE_DND_ID_SLICE_START = 2;
|
|
3
|
+
declare const TABLE_DND_ID_SLICE_END = 9;
|
|
4
|
+
declare const PREVIEW_BADGE_SIZE = 24;
|
|
5
|
+
declare const buildDragPreview: (rows: HTMLElement[], rowRect: DOMRect) => HTMLDivElement;
|
|
6
|
+
export { TABLE_DND_ID_RADIX, TABLE_DND_ID_SLICE_START, TABLE_DND_ID_SLICE_END, PREVIEW_BADGE_SIZE, buildDragPreview };
|
|
@@ -2,7 +2,7 @@ import type { ComponentProps, ReactNode } from 'react';
|
|
|
2
2
|
export type TableType = 'horizontal' | 'vertical';
|
|
3
3
|
export type SortDirection = 'asc' | 'desc' | 'none';
|
|
4
4
|
export type RowStatus = 'warning' | 'error';
|
|
5
|
-
export type TableProps = Omit<ComponentProps<'div'>, 'ref'> & {
|
|
5
|
+
export type TableProps = Omit<ComponentProps<'div'>, 'ref' | 'draggable'> & {
|
|
6
6
|
type?: TableType;
|
|
7
7
|
fixedHeader?: boolean;
|
|
8
8
|
maxHeight?: string | number;
|
|
@@ -19,6 +19,11 @@ export type TableProps = Omit<ComponentProps<'div'>, 'ref'> & {
|
|
|
19
19
|
* 기본값은 1140 (14인치 모니터 + LNB 기준 디자인 권장 너비).
|
|
20
20
|
*/
|
|
21
21
|
minWidth?: string | number;
|
|
22
|
+
/**
|
|
23
|
+
* 행 드래그앤드롭 활성화. Table.Row에 dragId, Table.Body에 onRowDrop,
|
|
24
|
+
* 헤더에 Table.DragHeaderCell, 각 행에 Table.DragCell을 함께 사용한다.
|
|
25
|
+
*/
|
|
26
|
+
draggable?: boolean;
|
|
22
27
|
children: ReactNode;
|
|
23
28
|
};
|
|
24
29
|
export type TableHeaderProps = {
|
|
@@ -28,10 +33,28 @@ export type TableHeaderProps = {
|
|
|
28
33
|
export type TableBodyProps = {
|
|
29
34
|
children: ReactNode;
|
|
30
35
|
className?: string;
|
|
36
|
+
/**
|
|
37
|
+
* draggable=true 테이블에서 행이 재정렬될 때 호출된다.
|
|
38
|
+
* fromId → toId 로 이동, edge는 toId 행의 위(top)/아래(bottom) 삽입 위치.
|
|
39
|
+
*/
|
|
40
|
+
onRowDrop?: (fromId: string, toId: string, edge: 'top' | 'bottom') => void;
|
|
31
41
|
};
|
|
32
42
|
export type TableRowProps = Omit<ComponentProps<'tr'>, 'ref'> & {
|
|
33
43
|
selected?: boolean;
|
|
34
44
|
status?: RowStatus;
|
|
45
|
+
/** 드래그앤드롭 식별자. draggable 테이블에서 필수. */
|
|
46
|
+
dragId?: string;
|
|
47
|
+
};
|
|
48
|
+
export type TableDragCellProps = {
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
className?: string;
|
|
51
|
+
/** 드래그 셀에 함께 배치할 콘텐츠 (예: CheckboxInput). 아이콘 우측 8px gap으로 배치된다. */
|
|
52
|
+
children?: ReactNode;
|
|
53
|
+
};
|
|
54
|
+
export type TableDragHeaderCellProps = {
|
|
55
|
+
className?: string;
|
|
56
|
+
/** 헤더 드래그 셀에 함께 배치할 콘텐츠 (예: 전체선택 CheckboxInput). 아이콘 우측 8px gap으로 배치된다. */
|
|
57
|
+
children?: ReactNode;
|
|
35
58
|
};
|
|
36
59
|
export type TableHeaderCellProps = Omit<ComponentProps<'th'>, 'ref'> & {
|
|
37
60
|
sortDirection?: SortDirection;
|
|
@@ -126,6 +126,7 @@
|
|
|
126
126
|
spinner (200) — 부분 로딩 표시
|
|
127
127
|
popover (500) — dropdown · select-dropdown 등 부유 popover
|
|
128
128
|
(Portal 미사용, 부모 stacking context 안에서 동작)
|
|
129
|
+
dnd-preview (600) — table row DnD 드래그 오버레이 — popover 위, modal 아래
|
|
129
130
|
modal (1000) — 작업 차단 다이얼로그. backdrop이 stacking context를 만들고
|
|
130
131
|
자식인 본체는 자연 stacking으로 따라가므로 단일 토큰으로 충분
|
|
131
132
|
tooltip (2000) — 정보 보조. tag 자체 tooltip도 동일 토큰 사용
|
|
@@ -139,6 +140,7 @@
|
|
|
139
140
|
--z-index-sticky: 10;
|
|
140
141
|
--z-index-spinner: 200;
|
|
141
142
|
--z-index-popover: 500;
|
|
143
|
+
--z-index-dnd-preview: 600;
|
|
142
144
|
--z-index-modal: 1000;
|
|
143
145
|
--z-index-tooltip: 2000;
|
|
144
146
|
--z-index-notification: 2100;
|
|
@@ -6499,10 +6501,10 @@ button {
|
|
|
6499
6501
|
min-width: 240px;
|
|
6500
6502
|
max-width: 240px;
|
|
6501
6503
|
padding: 10px var(--spacing-m);
|
|
6502
|
-
font-size: var(--font-size-
|
|
6504
|
+
font-size: var(--font-size-xs);
|
|
6503
6505
|
font-weight: var(--font-weights-commerce-sans-1);
|
|
6504
6506
|
line-height: var(--line-heights-sm);
|
|
6505
|
-
color: var(--gray-
|
|
6507
|
+
color: var(--gray-500);
|
|
6506
6508
|
text-align: left;
|
|
6507
6509
|
background: var(--gray-50);
|
|
6508
6510
|
border-right: 1px solid var(--gray-100);
|
|
@@ -6575,6 +6577,168 @@ button {
|
|
|
6575
6577
|
margin-right: 4px;
|
|
6576
6578
|
}
|
|
6577
6579
|
|
|
6580
|
+
.ncua-table__drag-header-cell {
|
|
6581
|
+
width: 74px;
|
|
6582
|
+
min-width: 74px;
|
|
6583
|
+
max-width: 74px;
|
|
6584
|
+
padding: 0;
|
|
6585
|
+
border-right: 1px solid var(--gray-200);
|
|
6586
|
+
}
|
|
6587
|
+
|
|
6588
|
+
.ncua-table__drag-cell {
|
|
6589
|
+
width: 74px;
|
|
6590
|
+
min-width: 74px;
|
|
6591
|
+
max-width: 74px;
|
|
6592
|
+
padding: 0;
|
|
6593
|
+
border-right: 1px solid var(--gray-100);
|
|
6594
|
+
text-align: center;
|
|
6595
|
+
vertical-align: middle;
|
|
6596
|
+
line-height: 0;
|
|
6597
|
+
}
|
|
6598
|
+
|
|
6599
|
+
.ncua-table--draggable:not(.ncua-table--selectable) .ncua-table__drag-header-cell,
|
|
6600
|
+
.ncua-table--draggable:not(.ncua-table--selectable) .ncua-table__drag-cell {
|
|
6601
|
+
width: 56px;
|
|
6602
|
+
min-width: 56px;
|
|
6603
|
+
max-width: 56px;
|
|
6604
|
+
}
|
|
6605
|
+
|
|
6606
|
+
.ncua-table__drag-cell-inner {
|
|
6607
|
+
display: flex;
|
|
6608
|
+
width: 100%;
|
|
6609
|
+
align-items: center;
|
|
6610
|
+
justify-content: center;
|
|
6611
|
+
gap: 8px;
|
|
6612
|
+
padding: 0 8px;
|
|
6613
|
+
}
|
|
6614
|
+
|
|
6615
|
+
.ncua-table__drag-header-icon {
|
|
6616
|
+
display: inline-flex;
|
|
6617
|
+
align-items: center;
|
|
6618
|
+
justify-content: center;
|
|
6619
|
+
width: 16px;
|
|
6620
|
+
height: 16px;
|
|
6621
|
+
color: var(--gray-300);
|
|
6622
|
+
flex-shrink: 0;
|
|
6623
|
+
}
|
|
6624
|
+
|
|
6625
|
+
.ncua-table__drag-handle {
|
|
6626
|
+
display: inline-flex;
|
|
6627
|
+
align-items: center;
|
|
6628
|
+
justify-content: center;
|
|
6629
|
+
background: none;
|
|
6630
|
+
border: none;
|
|
6631
|
+
padding: 0;
|
|
6632
|
+
cursor: grab;
|
|
6633
|
+
color: var(--gray-300);
|
|
6634
|
+
width: 16px;
|
|
6635
|
+
height: 16px;
|
|
6636
|
+
flex-shrink: 0;
|
|
6637
|
+
}
|
|
6638
|
+
.ncua-table__drag-handle svg {
|
|
6639
|
+
width: 16px;
|
|
6640
|
+
height: 16px;
|
|
6641
|
+
flex-shrink: 0;
|
|
6642
|
+
}
|
|
6643
|
+
.ncua-table__drag-handle:hover {
|
|
6644
|
+
color: var(--gray-600);
|
|
6645
|
+
}
|
|
6646
|
+
.ncua-table__drag-handle:active {
|
|
6647
|
+
cursor: grabbing;
|
|
6648
|
+
}
|
|
6649
|
+
.ncua-table__drag-handle:disabled {
|
|
6650
|
+
cursor: not-allowed;
|
|
6651
|
+
color: var(--gray-200);
|
|
6652
|
+
pointer-events: none;
|
|
6653
|
+
}
|
|
6654
|
+
|
|
6655
|
+
.ncua-table__row.is-dragging {
|
|
6656
|
+
opacity: 1;
|
|
6657
|
+
}
|
|
6658
|
+
|
|
6659
|
+
.ncua-table__row--drag-over-top td:first-child,
|
|
6660
|
+
.ncua-table__row--drag-over-top th:first-child,
|
|
6661
|
+
.ncua-table__row--drag-over-bottom td:first-child,
|
|
6662
|
+
.ncua-table__row--drag-over-bottom th:first-child {
|
|
6663
|
+
position: relative;
|
|
6664
|
+
}
|
|
6665
|
+
|
|
6666
|
+
.ncua-table__row--drag-over-top td:first-child::after,
|
|
6667
|
+
.ncua-table__row--drag-over-top th:first-child::after {
|
|
6668
|
+
content: "";
|
|
6669
|
+
position: absolute;
|
|
6670
|
+
top: 0;
|
|
6671
|
+
left: 0;
|
|
6672
|
+
width: 10000px;
|
|
6673
|
+
height: 1px;
|
|
6674
|
+
background-color: var(--gray-600);
|
|
6675
|
+
pointer-events: none;
|
|
6676
|
+
z-index: 2;
|
|
6677
|
+
}
|
|
6678
|
+
|
|
6679
|
+
.ncua-table__row--drag-over-bottom td:first-child::after,
|
|
6680
|
+
.ncua-table__row--drag-over-bottom th:first-child::after {
|
|
6681
|
+
content: "";
|
|
6682
|
+
position: absolute;
|
|
6683
|
+
bottom: 0;
|
|
6684
|
+
left: 0;
|
|
6685
|
+
width: 10000px;
|
|
6686
|
+
height: 1px;
|
|
6687
|
+
background-color: var(--gray-600);
|
|
6688
|
+
pointer-events: none;
|
|
6689
|
+
z-index: 2;
|
|
6690
|
+
}
|
|
6691
|
+
|
|
6692
|
+
.ncua-table-dnd-preview {
|
|
6693
|
+
position: fixed;
|
|
6694
|
+
top: -9999px;
|
|
6695
|
+
left: -9999px;
|
|
6696
|
+
z-index: var(--z-index-dnd-preview);
|
|
6697
|
+
pointer-events: none;
|
|
6698
|
+
}
|
|
6699
|
+
|
|
6700
|
+
.ncua-table-dnd-preview__badge {
|
|
6701
|
+
position: absolute;
|
|
6702
|
+
top: 0;
|
|
6703
|
+
left: 0;
|
|
6704
|
+
width: 24px;
|
|
6705
|
+
height: 24px;
|
|
6706
|
+
border-radius: 50%;
|
|
6707
|
+
background: var(--gray-600);
|
|
6708
|
+
color: var(--base-white);
|
|
6709
|
+
font-size: 12px;
|
|
6710
|
+
font-weight: bold;
|
|
6711
|
+
display: flex;
|
|
6712
|
+
align-items: center;
|
|
6713
|
+
justify-content: center;
|
|
6714
|
+
z-index: 999;
|
|
6715
|
+
box-sizing: border-box;
|
|
6716
|
+
pointer-events: none;
|
|
6717
|
+
}
|
|
6718
|
+
|
|
6719
|
+
.ncua-table-dnd-preview__summary {
|
|
6720
|
+
position: absolute;
|
|
6721
|
+
isolation: isolate;
|
|
6722
|
+
z-index: 0;
|
|
6723
|
+
background: var(--gray-50);
|
|
6724
|
+
opacity: 0.5;
|
|
6725
|
+
box-shadow: var(--shadow-md);
|
|
6726
|
+
box-sizing: border-box;
|
|
6727
|
+
}
|
|
6728
|
+
|
|
6729
|
+
.ncua-table-dnd-preview__card {
|
|
6730
|
+
position: absolute;
|
|
6731
|
+
isolation: isolate;
|
|
6732
|
+
overflow: hidden;
|
|
6733
|
+
opacity: 1;
|
|
6734
|
+
box-shadow: var(--shadow-md);
|
|
6735
|
+
box-sizing: border-box;
|
|
6736
|
+
border-radius: 0;
|
|
6737
|
+
}
|
|
6738
|
+
.ncua-table-dnd-preview__card table {
|
|
6739
|
+
table-layout: fixed;
|
|
6740
|
+
}
|
|
6741
|
+
|
|
6578
6742
|
.ncua-data-grid {
|
|
6579
6743
|
display: flex;
|
|
6580
6744
|
flex-direction: column;
|
|
@@ -6654,12 +6818,23 @@ button {
|
|
|
6654
6818
|
.ncua-data-grid__table:first-child {
|
|
6655
6819
|
border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
|
|
6656
6820
|
}
|
|
6821
|
+
.ncua-data-grid__table:first-child .ncua-table {
|
|
6822
|
+
border-top-left-radius: var(--border-radius-md);
|
|
6823
|
+
border-top-right-radius: var(--border-radius-md);
|
|
6824
|
+
}
|
|
6657
6825
|
.ncua-data-grid__table:last-child {
|
|
6658
6826
|
border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
|
|
6659
6827
|
}
|
|
6828
|
+
.ncua-data-grid__table:last-child .ncua-table {
|
|
6829
|
+
border-bottom-left-radius: var(--border-radius-md);
|
|
6830
|
+
border-bottom-right-radius: var(--border-radius-md);
|
|
6831
|
+
}
|
|
6660
6832
|
.ncua-data-grid__table:first-child:last-child {
|
|
6661
6833
|
border-radius: var(--border-radius-md);
|
|
6662
6834
|
}
|
|
6835
|
+
.ncua-data-grid__table:first-child:last-child .ncua-table {
|
|
6836
|
+
border-radius: var(--border-radius-md);
|
|
6837
|
+
}
|
|
6663
6838
|
.ncua-data-grid__table .ncua-table-wrapper {
|
|
6664
6839
|
border: none;
|
|
6665
6840
|
box-shadow: none;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ncds/ui-admin",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.13",
|
|
4
4
|
"description": "nhn-commerce의 어드민 디자인 시스템입니다.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"barrel": "node barrel.js",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "2.1.0",
|
|
71
71
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "1.1.0",
|
|
72
72
|
"@atlaskit/pragmatic-drag-and-drop-react-accessibility": "1.1.4",
|
|
73
|
-
"@ncds/ui-admin-icon": "0.1.
|
|
73
|
+
"@ncds/ui-admin-icon": "0.1.12",
|
|
74
74
|
"classnames": "2.5.1",
|
|
75
75
|
"dompurify": "3.4.1",
|
|
76
76
|
"flatpickr": "4.6.13",
|