@withwiz/toolkit 0.1.4 → 0.2.1
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/auth/index.js +3 -3
- package/dist/chunk-6JZQE7ZQ.js +225 -0
- package/dist/chunk-7IY3RQQL.js +151 -0
- package/dist/{chunk-SLG26KHZ.js → chunk-FH6E36YZ.js} +1 -1
- package/dist/chunk-IPXPCBDO.js +127 -0
- package/dist/chunk-KHYY4KCV.js +110 -0
- package/dist/chunk-MAATEX2R.js +81 -0
- package/dist/chunk-NY5QXT33.js +31 -0
- package/dist/chunk-SEZJN4TC.js +136 -0
- package/dist/components/ui/DataTable.d.ts +8 -103
- package/dist/components/ui/DataTable.js +17 -602
- package/dist/components/ui/data-table/DataTable.d.ts +2 -0
- package/dist/components/ui/data-table/DataTable.js +22 -0
- package/dist/components/ui/data-table/DataTableBody.d.ts +19 -0
- package/dist/components/ui/data-table/DataTableBody.js +10 -0
- package/dist/components/ui/data-table/DataTableBulkActions.d.ts +17 -0
- package/dist/components/ui/data-table/DataTableBulkActions.js +12 -0
- package/dist/components/ui/data-table/DataTableFilters.d.ts +15 -0
- package/dist/components/ui/data-table/DataTableFilters.js +13 -0
- package/dist/components/ui/data-table/DataTablePagination.d.ts +10 -0
- package/dist/components/ui/data-table/DataTablePagination.js +11 -0
- package/dist/components/ui/data-table/DataTableSearch.d.ts +24 -0
- package/dist/components/ui/data-table/DataTableSearch.js +12 -0
- package/dist/components/ui/data-table/index.d.ts +13 -0
- package/dist/components/ui/data-table/types.d.ts +115 -0
- package/dist/constants/index.js +13 -13
- package/dist/error/hooks/index.js +2 -2
- package/dist/error/hooks/useErrorHandler.js +2 -2
- package/dist/error/index.js +25 -25
- package/dist/error/recovery/index.js +7 -7
- package/dist/geolocation/index.js +4 -4
- package/dist/geolocation/providers/index.js +4 -4
- package/dist/hooks/useDataTable.d.ts +45 -0
- package/dist/hooks/useDataTable.js +13 -11
- package/dist/middleware/error-handler.js +2 -2
- package/dist/middleware/index.js +3 -3
- package/dist/middleware/wrappers.js +3 -3
- package/package.json +3 -1
- package/dist/{chunk-TMVS4F7E.js → chunk-5OWZKYWQ.js} +3 -3
- package/dist/{chunk-IAJNC34M.js → chunk-6UAYU5NU.js} +3 -3
- package/dist/{chunk-QF6FH4GZ.js → chunk-S73334QY.js} +3 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BulkAction } from "./types";
|
|
2
|
+
export interface DataTableBulkActionsProps {
|
|
3
|
+
bulkActions: BulkAction[];
|
|
4
|
+
localSelectedIds: string[];
|
|
5
|
+
dataLength: number;
|
|
6
|
+
bulkActionLoading: string | null;
|
|
7
|
+
onSelectAll: (checked: boolean) => void;
|
|
8
|
+
onBulkAction: (action: BulkAction) => void;
|
|
9
|
+
labels: {
|
|
10
|
+
selectAll: string;
|
|
11
|
+
selectAllShort: string;
|
|
12
|
+
selected: string;
|
|
13
|
+
processing: string;
|
|
14
|
+
processingItems: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare function DataTableBulkActions({ bulkActions, localSelectedIds, dataLength, bulkActionLoading, onSelectAll, onBulkAction, labels, }: DataTableBulkActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
DataTableBulkActions
|
|
4
|
+
} from "../../../chunk-MAATEX2R.js";
|
|
5
|
+
import "../../../chunk-NY5QXT33.js";
|
|
6
|
+
import "../../../chunk-34WAGUT5.js";
|
|
7
|
+
import "../../../chunk-L25BNU3E.js";
|
|
8
|
+
import "../../../chunk-62FLBG6B.js";
|
|
9
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
10
|
+
export {
|
|
11
|
+
DataTableBulkActions
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FilterConfig } from "./types";
|
|
2
|
+
export interface DataTableFiltersProps {
|
|
3
|
+
filters: FilterConfig[];
|
|
4
|
+
filterValues: Record<string, any>;
|
|
5
|
+
onFilterChange?: (key: string, value: any) => void;
|
|
6
|
+
onClearFilters?: () => void;
|
|
7
|
+
hasActiveFilters: boolean;
|
|
8
|
+
labels: {
|
|
9
|
+
all: string;
|
|
10
|
+
min: string;
|
|
11
|
+
max: string;
|
|
12
|
+
clearFilters: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare function DataTableFilters({ filters, filterValues, onFilterChange, onClearFilters, hasActiveFilters, labels, }: DataTableFiltersProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
DataTableFilters
|
|
4
|
+
} from "../../../chunk-SEZJN4TC.js";
|
|
5
|
+
import "../../../chunk-RJUVBBZG.js";
|
|
6
|
+
import "../../../chunk-IJEZ7G7S.js";
|
|
7
|
+
import "../../../chunk-WDUFQFDP.js";
|
|
8
|
+
import "../../../chunk-L25BNU3E.js";
|
|
9
|
+
import "../../../chunk-62FLBG6B.js";
|
|
10
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
11
|
+
export {
|
|
12
|
+
DataTableFilters
|
|
13
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PaginationConfig } from "./types";
|
|
2
|
+
export interface DataTablePaginationProps {
|
|
3
|
+
pagination: PaginationConfig;
|
|
4
|
+
labels: {
|
|
5
|
+
showing: string;
|
|
6
|
+
previous: string;
|
|
7
|
+
next: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare function DataTablePagination({ pagination, labels, }: DataTablePaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
DataTablePagination
|
|
4
|
+
} from "../../../chunk-IPXPCBDO.js";
|
|
5
|
+
import "../../../chunk-NY5QXT33.js";
|
|
6
|
+
import "../../../chunk-YJWLWUFK.js";
|
|
7
|
+
import "../../../chunk-62FLBG6B.js";
|
|
8
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
9
|
+
export {
|
|
10
|
+
DataTablePagination
|
|
11
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import type { PaginationConfig, FilterConfig } from "./types";
|
|
3
|
+
export interface DataTableSearchProps {
|
|
4
|
+
onSearch?: (search: string) => void;
|
|
5
|
+
onSearchValueChange?: (searchValue: string) => void;
|
|
6
|
+
searchValue: string;
|
|
7
|
+
searchPlaceholder: string;
|
|
8
|
+
labels: {
|
|
9
|
+
search: string;
|
|
10
|
+
filter: string;
|
|
11
|
+
filterActive: string;
|
|
12
|
+
perPage: string;
|
|
13
|
+
};
|
|
14
|
+
filters: FilterConfig[];
|
|
15
|
+
onToggleFilters?: (show: boolean) => void;
|
|
16
|
+
showFilters: boolean;
|
|
17
|
+
hasActiveFilters: boolean;
|
|
18
|
+
pagination?: PaginationConfig;
|
|
19
|
+
createButton?: ReactNode | {
|
|
20
|
+
label: string;
|
|
21
|
+
onClick: () => void;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare function DataTableSearch({ onSearch, onSearchValueChange, searchValue, searchPlaceholder, labels, filters, onToggleFilters, showFilters, hasActiveFilters, pagination, createButton, }: DataTableSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
DataTableSearch
|
|
4
|
+
} from "../../../chunk-KHYY4KCV.js";
|
|
5
|
+
import "../../../chunk-NY5QXT33.js";
|
|
6
|
+
import "../../../chunk-RJUVBBZG.js";
|
|
7
|
+
import "../../../chunk-L25BNU3E.js";
|
|
8
|
+
import "../../../chunk-62FLBG6B.js";
|
|
9
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
10
|
+
export {
|
|
11
|
+
DataTableSearch
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataTable
|
|
3
|
+
*
|
|
4
|
+
* Public API - 모든 DataTable 관련 타입과 컴포넌트 export
|
|
5
|
+
*/
|
|
6
|
+
export { DataTable } from "./DataTable";
|
|
7
|
+
export { DataTableSearch } from "./DataTableSearch";
|
|
8
|
+
export { DataTableFilters } from "./DataTableFilters";
|
|
9
|
+
export { DataTableBulkActions } from "./DataTableBulkActions";
|
|
10
|
+
export { DataTableBody } from "./DataTableBody";
|
|
11
|
+
export { DataTablePagination } from "./DataTablePagination";
|
|
12
|
+
export type { DataTableLabels, ColumnDef, BulkAction, FilterConfig, PaginationConfig, SortConfig, DataTableProps, } from "./types";
|
|
13
|
+
export { DEFAULT_LABELS, formatLabel } from "./types";
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataTable Types
|
|
3
|
+
*
|
|
4
|
+
* DataTable 컴포넌트의 모든 타입 정의
|
|
5
|
+
*/
|
|
6
|
+
import { ReactNode } from "react";
|
|
7
|
+
export interface DataTableLabels {
|
|
8
|
+
search?: string;
|
|
9
|
+
filter?: string;
|
|
10
|
+
filterActive?: string;
|
|
11
|
+
clearFilters?: string;
|
|
12
|
+
selectAll?: string;
|
|
13
|
+
selectAllShort?: string;
|
|
14
|
+
selected?: string;
|
|
15
|
+
processing?: string;
|
|
16
|
+
processingItems?: string;
|
|
17
|
+
loading?: string;
|
|
18
|
+
perPage?: string;
|
|
19
|
+
all?: string;
|
|
20
|
+
min?: string;
|
|
21
|
+
max?: string;
|
|
22
|
+
previous?: string;
|
|
23
|
+
next?: string;
|
|
24
|
+
showing?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const DEFAULT_LABELS: Required<DataTableLabels>;
|
|
27
|
+
export declare function formatLabel(template: string, values: Record<string, string | number>): string;
|
|
28
|
+
export interface ColumnDef<T> {
|
|
29
|
+
key: string;
|
|
30
|
+
header: string;
|
|
31
|
+
accessorKey?: keyof T;
|
|
32
|
+
cell?: (item: T) => React.ReactNode;
|
|
33
|
+
sortable?: boolean;
|
|
34
|
+
width?: string;
|
|
35
|
+
className?: string;
|
|
36
|
+
hidden?: boolean;
|
|
37
|
+
responsive?: {
|
|
38
|
+
sm?: boolean;
|
|
39
|
+
md?: boolean;
|
|
40
|
+
lg?: boolean;
|
|
41
|
+
xl?: boolean;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface BulkAction {
|
|
45
|
+
key: string;
|
|
46
|
+
label: string;
|
|
47
|
+
icon?: React.ReactNode;
|
|
48
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link";
|
|
49
|
+
onClick: (selectedIds: string[]) => Promise<void>;
|
|
50
|
+
disabled?: (selectedIds: string[]) => boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface FilterConfig {
|
|
53
|
+
key: string;
|
|
54
|
+
label: string;
|
|
55
|
+
type: 'text' | 'select' | 'date' | 'number' | 'switch' | 'range';
|
|
56
|
+
options?: {
|
|
57
|
+
value: string;
|
|
58
|
+
label: string;
|
|
59
|
+
}[];
|
|
60
|
+
placeholder?: string;
|
|
61
|
+
className?: string;
|
|
62
|
+
inputType?: 'text' | 'number' | 'date';
|
|
63
|
+
minPlaceholder?: string;
|
|
64
|
+
maxPlaceholder?: string;
|
|
65
|
+
/** 필터 모드: 'server'(기본값)는 서버 사이드, 'client'는 클라이언트 사이드 필터링 */
|
|
66
|
+
filterMode?: 'server' | 'client';
|
|
67
|
+
/** 클라이언트 사이드 필터링 함수 (filterMode === 'client'일 때 사용) */
|
|
68
|
+
filterFn?: (item: any, value: any) => boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface PaginationConfig {
|
|
71
|
+
page: number;
|
|
72
|
+
pageSize: number;
|
|
73
|
+
total: number;
|
|
74
|
+
pageSizeOptions?: number[];
|
|
75
|
+
onPageChange: (page: number) => void;
|
|
76
|
+
onPageSizeChange: (pageSize: number) => void;
|
|
77
|
+
}
|
|
78
|
+
export interface SortConfig {
|
|
79
|
+
sort: string;
|
|
80
|
+
order: 'asc' | 'desc';
|
|
81
|
+
onSortChange: (sort: string, order: 'asc' | 'desc') => void;
|
|
82
|
+
}
|
|
83
|
+
export interface DataTableProps<T> {
|
|
84
|
+
data: T[];
|
|
85
|
+
columns: ColumnDef<T>[];
|
|
86
|
+
loading?: boolean;
|
|
87
|
+
error?: string | null;
|
|
88
|
+
pagination?: PaginationConfig;
|
|
89
|
+
sort?: SortConfig;
|
|
90
|
+
bulkActions?: BulkAction[];
|
|
91
|
+
filters?: FilterConfig[];
|
|
92
|
+
filterValues?: Record<string, any>;
|
|
93
|
+
onFilterChange?: (key: string, value: any) => void;
|
|
94
|
+
onClearFilters?: () => void;
|
|
95
|
+
selectable?: boolean;
|
|
96
|
+
onSelectionChange?: (selectedIds: string[]) => void;
|
|
97
|
+
selectedIds?: string[];
|
|
98
|
+
getRowId: (item: T) => string;
|
|
99
|
+
className?: string;
|
|
100
|
+
emptyMessage?: string;
|
|
101
|
+
searchPlaceholder?: string;
|
|
102
|
+
onSearch?: (search: string) => void;
|
|
103
|
+
onSearchValueChange?: (searchValue: string) => void;
|
|
104
|
+
searchValue?: string;
|
|
105
|
+
showFilters?: boolean;
|
|
106
|
+
onToggleFilters?: (show: boolean) => void;
|
|
107
|
+
createButton?: ReactNode | {
|
|
108
|
+
label: string;
|
|
109
|
+
onClick: () => void;
|
|
110
|
+
};
|
|
111
|
+
/** i18n labels - 미제공 시 영어 기본값 사용 */
|
|
112
|
+
labels?: Partial<DataTableLabels>;
|
|
113
|
+
/** URL 쿼리 파라미터와 상태 동기화 (기본값: false) */
|
|
114
|
+
syncWithUrl?: boolean;
|
|
115
|
+
}
|
package/dist/constants/index.js
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ERROR_CODES,
|
|
3
|
+
HTTP_STATUS,
|
|
4
|
+
formatErrorMessage,
|
|
5
|
+
getAllErrorCodes,
|
|
6
|
+
getDefaultErrorMessage,
|
|
7
|
+
getErrorByCode,
|
|
8
|
+
getErrorCategory,
|
|
9
|
+
getErrorCodesByCategory,
|
|
10
|
+
getErrorInfo,
|
|
11
|
+
getHttpStatus,
|
|
12
|
+
getLogLevel
|
|
13
|
+
} from "../chunk-Y3OTJH2S.js";
|
|
1
14
|
import {
|
|
2
15
|
GENERIC_CONFIRM_MESSAGES,
|
|
3
16
|
GENERIC_ERROR_MESSAGES,
|
|
@@ -31,19 +44,6 @@ import {
|
|
|
31
44
|
URL,
|
|
32
45
|
USER_INPUT
|
|
33
46
|
} from "../chunk-LNV2E4I6.js";
|
|
34
|
-
import {
|
|
35
|
-
ERROR_CODES,
|
|
36
|
-
HTTP_STATUS,
|
|
37
|
-
formatErrorMessage,
|
|
38
|
-
getAllErrorCodes,
|
|
39
|
-
getDefaultErrorMessage,
|
|
40
|
-
getErrorByCode,
|
|
41
|
-
getErrorCategory,
|
|
42
|
-
getErrorCodesByCategory,
|
|
43
|
-
getErrorInfo,
|
|
44
|
-
getHttpStatus,
|
|
45
|
-
getLogLevel
|
|
46
|
-
} from "../chunk-Y3OTJH2S.js";
|
|
47
47
|
import "../chunk-ORMEWXMH.js";
|
|
48
48
|
export {
|
|
49
49
|
API_KEY,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "../../chunk-Y2TUZFCP.js";
|
|
2
2
|
import {
|
|
3
3
|
useErrorHandler
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-6UAYU5NU.js";
|
|
5
|
+
import "../../chunk-MLGO3HLS.js";
|
|
5
6
|
import "../../chunk-POKGHK3L.js";
|
|
6
7
|
import "../../chunk-EEUBKZV4.js";
|
|
7
8
|
import "../../chunk-N4YGR5WH.js";
|
|
8
9
|
import "../../chunk-KXAWBFJN.js";
|
|
9
|
-
import "../../chunk-MLGO3HLS.js";
|
|
10
10
|
import "../../chunk-Y3OTJH2S.js";
|
|
11
11
|
import "../../chunk-ORMEWXMH.js";
|
|
12
12
|
export {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
useErrorHandler
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-6UAYU5NU.js";
|
|
5
|
+
import "../../chunk-MLGO3HLS.js";
|
|
5
6
|
import "../../chunk-POKGHK3L.js";
|
|
6
7
|
import "../../chunk-EEUBKZV4.js";
|
|
7
8
|
import "../../chunk-N4YGR5WH.js";
|
|
8
9
|
import "../../chunk-KXAWBFJN.js";
|
|
9
|
-
import "../../chunk-MLGO3HLS.js";
|
|
10
10
|
import "../../chunk-Y3OTJH2S.js";
|
|
11
11
|
import "../../chunk-ORMEWXMH.js";
|
|
12
12
|
export {
|
package/dist/error/index.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import "../chunk-ULF5RDDX.js";
|
|
2
|
-
import {
|
|
3
|
-
CircuitBreaker,
|
|
4
|
-
ECircuitState
|
|
5
|
-
} from "../chunk-7VJNLGAS.js";
|
|
6
|
-
import {
|
|
7
|
-
FeatureDegradation
|
|
8
|
-
} from "../chunk-TEIYA7U4.js";
|
|
9
2
|
import {
|
|
10
3
|
withFallback,
|
|
11
4
|
withFallbackChain,
|
|
@@ -14,16 +7,10 @@ import {
|
|
|
14
7
|
import {
|
|
15
8
|
withRetry
|
|
16
9
|
} from "../chunk-A6EAAWMK.js";
|
|
17
|
-
import {
|
|
18
|
-
EmptyState,
|
|
19
|
-
ErrorAlert,
|
|
20
|
-
ErrorPage,
|
|
21
|
-
LoadingState
|
|
22
|
-
} from "../chunk-ZHVUK5OY.js";
|
|
23
10
|
import "../chunk-Y2TUZFCP.js";
|
|
24
11
|
import {
|
|
25
12
|
useErrorHandler
|
|
26
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-6UAYU5NU.js";
|
|
27
14
|
import "../chunk-7XFHGAJP.js";
|
|
28
15
|
import "../chunk-COK4ZXNG.js";
|
|
29
16
|
import {
|
|
@@ -47,15 +34,39 @@ import {
|
|
|
47
34
|
import {
|
|
48
35
|
ELogLevel
|
|
49
36
|
} from "../chunk-6C7HQIX4.js";
|
|
37
|
+
import {
|
|
38
|
+
CircuitBreaker,
|
|
39
|
+
ECircuitState
|
|
40
|
+
} from "../chunk-7VJNLGAS.js";
|
|
41
|
+
import {
|
|
42
|
+
FeatureDegradation
|
|
43
|
+
} from "../chunk-TEIYA7U4.js";
|
|
44
|
+
import {
|
|
45
|
+
EmptyState,
|
|
46
|
+
ErrorAlert,
|
|
47
|
+
ErrorPage,
|
|
48
|
+
LoadingState
|
|
49
|
+
} from "../chunk-ZHVUK5OY.js";
|
|
50
50
|
import {
|
|
51
51
|
LocaleDetector
|
|
52
52
|
} from "../chunk-XHZ5L4FO.js";
|
|
53
|
+
import {
|
|
54
|
+
extractErrorInfo,
|
|
55
|
+
formatInlineError,
|
|
56
|
+
getDefaultErrorCode,
|
|
57
|
+
getErrorIcon,
|
|
58
|
+
handleApiResponse,
|
|
59
|
+
showFriendlyError
|
|
60
|
+
} from "../chunk-3DZA6AGS.js";
|
|
53
61
|
import {
|
|
54
62
|
ErrorResponse,
|
|
55
63
|
errorToResponse,
|
|
56
64
|
processError,
|
|
57
65
|
withErrorHandler
|
|
58
66
|
} from "../chunk-GPBOMJSZ.js";
|
|
67
|
+
import {
|
|
68
|
+
AppError
|
|
69
|
+
} from "../chunk-MLGO3HLS.js";
|
|
59
70
|
import {
|
|
60
71
|
formatFriendlyError,
|
|
61
72
|
getErrorDisplayInfo as getErrorDisplayInfo2,
|
|
@@ -70,17 +81,6 @@ import {
|
|
|
70
81
|
} from "../chunk-EEUBKZV4.js";
|
|
71
82
|
import "../chunk-N4YGR5WH.js";
|
|
72
83
|
import "../chunk-KXAWBFJN.js";
|
|
73
|
-
import {
|
|
74
|
-
AppError
|
|
75
|
-
} from "../chunk-MLGO3HLS.js";
|
|
76
|
-
import {
|
|
77
|
-
extractErrorInfo,
|
|
78
|
-
formatInlineError,
|
|
79
|
-
getDefaultErrorCode,
|
|
80
|
-
getErrorIcon,
|
|
81
|
-
handleApiResponse,
|
|
82
|
-
showFriendlyError
|
|
83
|
-
} from "../chunk-3DZA6AGS.js";
|
|
84
84
|
import {
|
|
85
85
|
getErrorDisplayInfo
|
|
86
86
|
} from "../chunk-2DVWSDST.js";
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import "../../chunk-ULF5RDDX.js";
|
|
2
|
-
import {
|
|
3
|
-
CircuitBreaker,
|
|
4
|
-
ECircuitState
|
|
5
|
-
} from "../../chunk-7VJNLGAS.js";
|
|
6
|
-
import {
|
|
7
|
-
FeatureDegradation
|
|
8
|
-
} from "../../chunk-TEIYA7U4.js";
|
|
9
2
|
import {
|
|
10
3
|
withFallback,
|
|
11
4
|
withFallbackChain,
|
|
@@ -14,6 +7,13 @@ import {
|
|
|
14
7
|
import {
|
|
15
8
|
withRetry
|
|
16
9
|
} from "../../chunk-A6EAAWMK.js";
|
|
10
|
+
import {
|
|
11
|
+
CircuitBreaker,
|
|
12
|
+
ECircuitState
|
|
13
|
+
} from "../../chunk-7VJNLGAS.js";
|
|
14
|
+
import {
|
|
15
|
+
FeatureDegradation
|
|
16
|
+
} from "../../chunk-TEIYA7U4.js";
|
|
17
17
|
import "../../chunk-ORMEWXMH.js";
|
|
18
18
|
export {
|
|
19
19
|
CircuitBreaker,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GeoIPProviderFactory
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-S73334QY.js";
|
|
4
|
+
import {
|
|
5
|
+
IPApiProvider
|
|
6
|
+
} from "../chunk-DEEJBDJE.js";
|
|
4
7
|
import {
|
|
5
8
|
IPApiCoProvider
|
|
6
9
|
} from "../chunk-VSGKVZB4.js";
|
|
@@ -10,9 +13,6 @@ import {
|
|
|
10
13
|
import {
|
|
11
14
|
MaxMindProvider
|
|
12
15
|
} from "../chunk-4NWJ3WCZ.js";
|
|
13
|
-
import {
|
|
14
|
-
IPApiProvider
|
|
15
|
-
} from "../chunk-DEEJBDJE.js";
|
|
16
16
|
import {
|
|
17
17
|
BaseGeoIPProvider,
|
|
18
18
|
truncateString
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GeoIPProviderFactory
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-S73334QY.js";
|
|
4
|
+
import {
|
|
5
|
+
IPApiProvider
|
|
6
|
+
} from "../../chunk-DEEJBDJE.js";
|
|
4
7
|
import {
|
|
5
8
|
IPApiCoProvider
|
|
6
9
|
} from "../../chunk-VSGKVZB4.js";
|
|
@@ -10,9 +13,6 @@ import {
|
|
|
10
13
|
import {
|
|
11
14
|
MaxMindProvider
|
|
12
15
|
} from "../../chunk-4NWJ3WCZ.js";
|
|
13
|
-
import {
|
|
14
|
-
IPApiProvider
|
|
15
|
-
} from "../../chunk-DEEJBDJE.js";
|
|
16
16
|
import {
|
|
17
17
|
BaseGeoIPProvider,
|
|
18
18
|
truncateString
|
|
@@ -22,6 +22,44 @@ export interface UseDataTableOptions<T> {
|
|
|
22
22
|
pagination: DataTablePagination;
|
|
23
23
|
}) => Promise<void>;
|
|
24
24
|
}
|
|
25
|
+
export interface UseDataTableState<T> {
|
|
26
|
+
data: T[];
|
|
27
|
+
loading: boolean;
|
|
28
|
+
error: string | null;
|
|
29
|
+
total: number;
|
|
30
|
+
filters: DataTableFilters;
|
|
31
|
+
sort: DataTableSort;
|
|
32
|
+
pagination: DataTablePagination;
|
|
33
|
+
selectedIds: string[];
|
|
34
|
+
}
|
|
35
|
+
export interface UseDataTableDataActions<T> {
|
|
36
|
+
setData: (data: T[]) => void;
|
|
37
|
+
setLoading: (loading: boolean) => void;
|
|
38
|
+
setError: (error: string | null) => void;
|
|
39
|
+
setTotal: (total: number) => void;
|
|
40
|
+
}
|
|
41
|
+
export interface UseDataTableFilterActions {
|
|
42
|
+
setFilters: (filters: DataTableFilters) => void;
|
|
43
|
+
updateFilter: (key: string, value: any) => void;
|
|
44
|
+
clearFilters: () => void;
|
|
45
|
+
}
|
|
46
|
+
export interface UseDataTableSortActions {
|
|
47
|
+
setSort: (sort: string, order?: 'asc' | 'desc') => void;
|
|
48
|
+
}
|
|
49
|
+
export interface UseDataTablePaginationActions {
|
|
50
|
+
setPage: (page: number) => void;
|
|
51
|
+
setPageSize: (pageSize: number) => void;
|
|
52
|
+
}
|
|
53
|
+
export interface UseDataTableSelectionActions {
|
|
54
|
+
setSelectedIds: (ids: string[]) => void;
|
|
55
|
+
toggleSelection: (id: string) => void;
|
|
56
|
+
selectAll: () => void;
|
|
57
|
+
clearSelection: () => void;
|
|
58
|
+
}
|
|
59
|
+
export interface UseDataTableActions {
|
|
60
|
+
refresh: () => Promise<void>;
|
|
61
|
+
bulkAction: (action: (ids: string[]) => Promise<void>) => Promise<void>;
|
|
62
|
+
}
|
|
25
63
|
export interface UseDataTableReturn<T> {
|
|
26
64
|
data: T[];
|
|
27
65
|
loading: boolean;
|
|
@@ -47,5 +85,12 @@ export interface UseDataTableReturn<T> {
|
|
|
47
85
|
clearSelection: () => void;
|
|
48
86
|
refresh: () => Promise<void>;
|
|
49
87
|
bulkAction: (action: (ids: string[]) => Promise<void>) => Promise<void>;
|
|
88
|
+
state: UseDataTableState<T>;
|
|
89
|
+
dataActions: UseDataTableDataActions<T>;
|
|
90
|
+
filterActions: UseDataTableFilterActions;
|
|
91
|
+
sortActions: UseDataTableSortActions;
|
|
92
|
+
paginationActions: UseDataTablePaginationActions;
|
|
93
|
+
selectionActions: UseDataTableSelectionActions;
|
|
94
|
+
actions: UseDataTableActions;
|
|
50
95
|
}
|
|
51
96
|
export declare function useDataTable<T>({ initialFilters, initialSort, initialPagination, debounceMs, onDataChange, }: UseDataTableOptions<T>): UseDataTableReturn<T>;
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "../chunk-ORMEWXMH.js";
|
|
9
9
|
|
|
10
10
|
// src/hooks/useDataTable.ts
|
|
11
|
-
import { useState, useCallback,
|
|
11
|
+
import { useState, useCallback, useEffect } from "react";
|
|
12
12
|
function useDataTable({
|
|
13
13
|
initialFilters = {},
|
|
14
14
|
initialSort = { sort: "createdAt", order: "desc" },
|
|
@@ -102,16 +102,16 @@ function useDataTable({
|
|
|
102
102
|
setLoading(false);
|
|
103
103
|
}
|
|
104
104
|
}, [selectedIds, refresh]);
|
|
105
|
-
|
|
105
|
+
useEffect(() => {
|
|
106
106
|
if (debouncedSearch !== filters.search) {
|
|
107
107
|
setPaginationState((prev) => __spreadProps(__spreadValues({}, prev), { page: 1 }));
|
|
108
108
|
}
|
|
109
109
|
}, [debouncedSearch, filters.search]);
|
|
110
|
-
|
|
110
|
+
useEffect(() => {
|
|
111
111
|
refresh();
|
|
112
112
|
}, [debouncedSearch, sort.sort, sort.order, pagination.page, pagination.pageSize]);
|
|
113
113
|
return {
|
|
114
|
-
//
|
|
114
|
+
// 기존 flat 리턴 (하위 호환)
|
|
115
115
|
data,
|
|
116
116
|
loading,
|
|
117
117
|
error,
|
|
@@ -120,28 +120,30 @@ function useDataTable({
|
|
|
120
120
|
sort,
|
|
121
121
|
pagination,
|
|
122
122
|
selectedIds,
|
|
123
|
-
// 데이터 관리
|
|
124
123
|
setData,
|
|
125
124
|
setLoading,
|
|
126
125
|
setError,
|
|
127
126
|
setTotal,
|
|
128
|
-
// 필터 관리
|
|
129
127
|
setFilters,
|
|
130
128
|
updateFilter,
|
|
131
129
|
clearFilters,
|
|
132
|
-
// 정렬 관리
|
|
133
130
|
setSort,
|
|
134
|
-
// 페이지네이션 관리
|
|
135
131
|
setPage,
|
|
136
132
|
setPageSize,
|
|
137
|
-
// 선택 관리
|
|
138
133
|
setSelectedIds,
|
|
139
134
|
toggleSelection,
|
|
140
135
|
selectAll,
|
|
141
136
|
clearSelection,
|
|
142
|
-
// 액션
|
|
143
137
|
refresh,
|
|
144
|
-
bulkAction
|
|
138
|
+
bulkAction,
|
|
139
|
+
// 새 그룹화 리턴
|
|
140
|
+
state: { data, loading, error, total, filters, sort, pagination, selectedIds },
|
|
141
|
+
dataActions: { setData, setLoading, setError, setTotal },
|
|
142
|
+
filterActions: { setFilters, updateFilter, clearFilters },
|
|
143
|
+
sortActions: { setSort },
|
|
144
|
+
paginationActions: { setPage, setPageSize },
|
|
145
|
+
selectionActions: { setSelectedIds, toggleSelection, selectAll, clearSelection },
|
|
146
|
+
actions: { refresh, bulkAction }
|
|
145
147
|
};
|
|
146
148
|
}
|
|
147
149
|
export {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
errorHandlerMiddleware
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-5OWZKYWQ.js";
|
|
4
|
+
import "../chunk-MLGO3HLS.js";
|
|
4
5
|
import "../chunk-EEUBKZV4.js";
|
|
5
6
|
import "../chunk-N4YGR5WH.js";
|
|
6
7
|
import "../chunk-KXAWBFJN.js";
|
|
7
|
-
import "../chunk-MLGO3HLS.js";
|
|
8
8
|
import "../chunk-Y3OTJH2S.js";
|
|
9
9
|
import "../chunk-EZR55KV2.js";
|
|
10
10
|
import "../chunk-ORMEWXMH.js";
|
package/dist/middleware/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
withCustomApi,
|
|
5
5
|
withOptionalAuthApi,
|
|
6
6
|
withPublicApi
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-FH6E36YZ.js";
|
|
8
8
|
import {
|
|
9
9
|
MiddlewareChain
|
|
10
10
|
} from "../chunk-4ODT3Q4A.js";
|
|
@@ -33,15 +33,15 @@ import {
|
|
|
33
33
|
} from "../chunk-FOKAATUQ.js";
|
|
34
34
|
import {
|
|
35
35
|
errorHandlerMiddleware
|
|
36
|
-
} from "../chunk-
|
|
36
|
+
} from "../chunk-5OWZKYWQ.js";
|
|
37
37
|
import {
|
|
38
38
|
initRequestMiddleware
|
|
39
39
|
} from "../chunk-62Q7DN5G.js";
|
|
40
40
|
import "../chunk-XHZ5L4FO.js";
|
|
41
|
+
import "../chunk-MLGO3HLS.js";
|
|
41
42
|
import "../chunk-EEUBKZV4.js";
|
|
42
43
|
import "../chunk-N4YGR5WH.js";
|
|
43
44
|
import "../chunk-KXAWBFJN.js";
|
|
44
|
-
import "../chunk-MLGO3HLS.js";
|
|
45
45
|
import "../chunk-Y3OTJH2S.js";
|
|
46
46
|
import "../chunk-T3LJYAMO.js";
|
|
47
47
|
import "../chunk-AIH3F7JV.js";
|
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
withCustomApi,
|
|
5
5
|
withOptionalAuthApi,
|
|
6
6
|
withPublicApi
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-FH6E36YZ.js";
|
|
8
8
|
import "../chunk-4ODT3Q4A.js";
|
|
9
9
|
import "../chunk-H5I5GWAA.js";
|
|
10
10
|
import "../chunk-KAWVMIRJ.js";
|
|
11
11
|
import "../chunk-WSQMXMTL.js";
|
|
12
12
|
import "../chunk-UXQRU3EM.js";
|
|
13
13
|
import "../chunk-FOKAATUQ.js";
|
|
14
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-5OWZKYWQ.js";
|
|
15
15
|
import "../chunk-62Q7DN5G.js";
|
|
16
16
|
import "../chunk-XHZ5L4FO.js";
|
|
17
|
+
import "../chunk-MLGO3HLS.js";
|
|
17
18
|
import "../chunk-EEUBKZV4.js";
|
|
18
19
|
import "../chunk-N4YGR5WH.js";
|
|
19
20
|
import "../chunk-KXAWBFJN.js";
|
|
20
|
-
import "../chunk-MLGO3HLS.js";
|
|
21
21
|
import "../chunk-Y3OTJH2S.js";
|
|
22
22
|
import "../chunk-T3LJYAMO.js";
|
|
23
23
|
import "../chunk-AIH3F7JV.js";
|