@croquiscom/pds 3.4.2 → 3.5.0
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/CHANGELOG.md +13 -0
- package/assets/icons/ArrowChevronDoubleLeftBold.svg +4 -0
- package/assets/icons/ArrowChevronDoubleRightBold.svg +4 -0
- package/assets/icons/ArrowChevronLeftBold.svg +3 -0
- package/assets/icons/ArrowChevronRightBold.svg +3 -0
- package/dist/components/icons/generated/ArrowChevronDoubleLeftBold.d.ts +4 -0
- package/dist/components/icons/generated/ArrowChevronDoubleRightBold.d.ts +4 -0
- package/dist/components/icons/generated/ArrowChevronLeftBold.d.ts +4 -0
- package/dist/components/icons/generated/ArrowChevronRightBold.d.ts +4 -0
- package/dist/components/icons/generated/index.d.ts +4 -0
- package/dist/components/table/Table.d.ts +6 -0
- package/dist/components/table/Table.stories.d.ts +2 -1
- package/dist/components/table/TableRows.d.ts +2 -2
- package/dist/components/table/reducer.d.ts +1 -9
- package/dist/components/table/storybook-helper/sampleData.d.ts +3 -2
- package/dist/components/table/types.d.ts +5 -5
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @croquiscom/pds
|
|
2
2
|
|
|
3
|
+
## 3.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- b6acaf0: DateRangePicker > 최상위 HStack width 제거
|
|
8
|
+
- b6acaf0: Table > clickableRows, colSpan, selectable 추가
|
|
9
|
+
|
|
10
|
+
## 3.4.3
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 53e1083: 신규 ArrowChevronBold 아이콘 4종 추가
|
|
15
|
+
|
|
3
16
|
## 3.4.2
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.9393 2.93933L13.0606 5.06065L6.1213 12L13.0606 18.9393L10.9393 21.0606L1.87866 12L10.9393 2.93933Z" fill="#363644"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.9393 2.93933L22.0606 5.06065L15.1213 12L22.0606 18.9393L19.9393 21.0606L10.8787 12L19.9393 2.93933Z" fill="#363644"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.87867 12L1.93933 5.06065L4.06065 2.93933L13.1213 12L4.06065 21.0606L1.93933 18.9393L8.87867 12Z" fill="#363644"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.8787 12L10.9393 5.06065L13.0607 2.93933L22.1213 12L13.0607 21.0606L10.9393 18.9393L17.8787 12Z" fill="#363644"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.9393 2.93933L17.0606 5.06065L10.1213 12L17.0606 18.9393L14.9393 21.0606L5.87866 12L14.9393 2.93933Z" fill="#363644"/>
|
|
3
|
+
</svg>
|
|
@@ -4,9 +4,13 @@ export interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
|
4
4
|
color?: string;
|
|
5
5
|
secondaryColor?: string;
|
|
6
6
|
}
|
|
7
|
+
export { default as IconArrowChevronDoubleLeftBold } from './ArrowChevronDoubleLeftBold';
|
|
8
|
+
export { default as IconArrowChevronDoubleRightBold } from './ArrowChevronDoubleRightBold';
|
|
7
9
|
export { default as IconArrowChevronDown } from './ArrowChevronDown';
|
|
8
10
|
export { default as IconArrowChevronLeft } from './ArrowChevronLeft';
|
|
11
|
+
export { default as IconArrowChevronLeftBold } from './ArrowChevronLeftBold';
|
|
9
12
|
export { default as IconArrowChevronRight } from './ArrowChevronRight';
|
|
13
|
+
export { default as IconArrowChevronRightBold } from './ArrowChevronRightBold';
|
|
10
14
|
export { default as IconArrowChevronUp } from './ArrowChevronUp';
|
|
11
15
|
export { default as IconArrowDecrease } from './ArrowDecrease';
|
|
12
16
|
export { default as IconArrowDirectionDown } from './ArrowDirectionDown';
|
|
@@ -42,6 +42,12 @@ export interface TableProps<DataType> {
|
|
|
42
42
|
* - true일 경우 각 테이블 로우는 고유 key가 존재해야 합니다.
|
|
43
43
|
*/
|
|
44
44
|
selectableRows?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Row 클릭으로 Selection 사용 유무
|
|
47
|
+
* - 먼저 selectableRows가 true여야 하며, Row 클릭으로도 선택/해제가 가능합니다.
|
|
48
|
+
* - 해당 옵션 사용시 ROW 내부에 버튼, 링크 등 추가적인 클릭이벤트가 있을 경우 stopPropagation 처리가 필요합니다.
|
|
49
|
+
*/
|
|
50
|
+
clickableRows?: boolean;
|
|
45
51
|
/**
|
|
46
52
|
* Row 선택 상태 정보
|
|
47
53
|
* - 이하 두가지 타입으로 로우 셀렉 상태를 받습니다.
|
|
@@ -15,11 +15,12 @@ export declare const Loading: any;
|
|
|
15
15
|
export declare const NoData: any;
|
|
16
16
|
export declare const CustomNoDataText: any;
|
|
17
17
|
export declare const ColumnGroup: any;
|
|
18
|
-
export declare const
|
|
18
|
+
export declare const CellSpan: any;
|
|
19
19
|
export declare const ColumnFixed: any;
|
|
20
20
|
export declare const StickyHeader: any;
|
|
21
21
|
export declare const Scroll: any;
|
|
22
22
|
export declare const Selection: any;
|
|
23
|
+
export declare const ClickableSelection: any;
|
|
23
24
|
export declare const ResetSelectedRows: any;
|
|
24
25
|
export declare const BeforehandSelectionByKey: any;
|
|
25
26
|
export declare const BeforehandSelectionByFunction: any;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TableProps } from './Table';
|
|
3
3
|
import { TableRowsType, SelectRowAction } from './types';
|
|
4
|
-
interface TableRowsProps<DataType> extends Pick<TableProps<DataType>, 'columns' | 'rows' | 'noDataText' | 'loading' | 'selectableRows' | 'cellHoverStyle'> {
|
|
4
|
+
interface TableRowsProps<DataType> extends Pick<TableProps<DataType>, 'columns' | 'rows' | 'noDataText' | 'loading' | 'selectableRows' | 'clickableRows' | 'cellHoverStyle'> {
|
|
5
5
|
tableContainerAttribute: number;
|
|
6
6
|
allSelected?: boolean;
|
|
7
7
|
selectedRows?: TableRowsType<DataType>;
|
|
8
8
|
onSelectedRow?: (action: SelectRowAction<DataType>) => void;
|
|
9
9
|
}
|
|
10
|
-
export declare const TableRows: <DataType extends object = any>({ columns, rows, loading, selectableRows, selectedRows, noDataText, cellHoverStyle, tableContainerAttribute, onSelectedRow, }: TableRowsProps<DataType>) => JSX.Element;
|
|
10
|
+
export declare const TableRows: <DataType extends object = any>({ columns, rows, loading, selectableRows, clickableRows, selectedRows, noDataText, cellHoverStyle, tableContainerAttribute, onSelectedRow, }: TableRowsProps<DataType>) => JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TableState, TableAction } from './types';
|
|
3
|
-
export declare function tableReducer<DataType>(state: TableState<DataType>, action: TableAction<DataType>):
|
|
4
|
-
allSelected: boolean;
|
|
5
|
-
selectedRows: import("./types").TableRowsType<DataType>;
|
|
6
|
-
selectedRowsKey: import("react").Key[];
|
|
7
|
-
emitSelectedEvent: boolean;
|
|
8
|
-
selectableRows?: boolean;
|
|
9
|
-
autoResetRowSelection?: boolean;
|
|
10
|
-
};
|
|
2
|
+
export declare function tableReducer<DataType>(state: TableState<DataType>, action: TableAction<DataType>): TableState<DataType>;
|
|
@@ -17,9 +17,10 @@ export declare const customColumnCell: TableColumnsType<DataType>;
|
|
|
17
17
|
export declare const customRowCellColumns: TableColumnsType<DataType>;
|
|
18
18
|
export declare const groupColumns: TableColumnsType<DataType>;
|
|
19
19
|
export declare const groupRows: TableRowsType<DataType>;
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
20
|
+
export declare const SpanColumns: TableColumnsType<DataType>;
|
|
21
|
+
export declare const SpanRows: TableRowsType<DataType>;
|
|
22
22
|
export declare const fixedColumns: TableColumnsType<DataType>;
|
|
23
23
|
export declare const selectionRows: TableRowsType<DataType>;
|
|
24
|
+
export declare const selectionRows2: TableRowsType<DataType>;
|
|
24
25
|
export declare const sortColumns: TableColumnsType<DataType>;
|
|
25
26
|
export declare const customRowStyleColumns: TableColumnsType<DataType>;
|
|
@@ -13,7 +13,7 @@ export type CellAttributes = {
|
|
|
13
13
|
style?: CSSObject;
|
|
14
14
|
};
|
|
15
15
|
export type RowSelectState<DataType> = ((row: DataType) => boolean) | Array<Key> | null;
|
|
16
|
-
export type CellAttributesProps<DataType> = (row: DataType, index?: number) => Pick<TdHTMLAttributes<any>, 'rowSpan'> & CellAttributes;
|
|
16
|
+
export type CellAttributesProps<DataType> = (row: DataType, index?: number) => Pick<TdHTMLAttributes<any>, 'rowSpan' | 'colSpan'> & CellAttributes;
|
|
17
17
|
export type CellProps<DataType> = ({ row, value, index, }: {
|
|
18
18
|
row: DataType;
|
|
19
19
|
value: CellValue<any>;
|
|
@@ -71,11 +71,11 @@ export interface TableColumnGroupType<DataType> extends Omit<TableColumnType<Dat
|
|
|
71
71
|
export type TableColumnsType<DataType = unknown> = Array<TableColumnType<DataType> | TableColumnGroupType<DataType>>;
|
|
72
72
|
export type TableRowType<DataType> = DataType & {
|
|
73
73
|
key?: Key;
|
|
74
|
+
selectable?: boolean;
|
|
74
75
|
};
|
|
75
76
|
export type TableRowsType<DataType = unknown> = Array<TableRowType<DataType>>;
|
|
76
77
|
export interface TableState<DataType = unknown> {
|
|
77
78
|
allSelected?: boolean;
|
|
78
|
-
selectableRows?: boolean;
|
|
79
79
|
selectedRowsKey?: Key[];
|
|
80
80
|
selectedRows?: TableRowsType<DataType>;
|
|
81
81
|
emitSelectedEvent?: boolean;
|
|
@@ -87,16 +87,16 @@ export interface SelectRowsAction<DataType> {
|
|
|
87
87
|
}
|
|
88
88
|
export interface SelectRowAction<DataType> {
|
|
89
89
|
type: 'SELECT_ROW';
|
|
90
|
+
rows: TableRowsType<DataType>;
|
|
90
91
|
row: TableRowType<DataType>;
|
|
91
92
|
selected: boolean;
|
|
92
|
-
totalRowCount: number;
|
|
93
93
|
}
|
|
94
94
|
export interface SelectControlledRowAction<DataType> {
|
|
95
95
|
type: 'SELECT_CONTROLLED_ROW';
|
|
96
|
+
controlled_rows: TableRowsType<DataType>;
|
|
96
97
|
rows: TableRowsType<DataType>;
|
|
97
|
-
totalRowCount: number;
|
|
98
98
|
}
|
|
99
99
|
export interface ResetSelectRows {
|
|
100
|
-
type: '
|
|
100
|
+
type: 'RESET_SELECTED_ROWS';
|
|
101
101
|
}
|
|
102
102
|
export type TableAction<DataType> = SelectRowsAction<DataType> | SelectRowAction<DataType> | SelectControlledRowAction<DataType> | ResetSelectRows;
|