@ceed/ads 0.0.59 → 0.0.60
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/components/DataTable/DataTable.d.ts +8 -1
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/index.js +6 -25
- package/framer/index.js +8864 -7480
- package/package.json +1 -1
|
@@ -21,7 +21,13 @@ type DataTableProps<T extends Record<string, unknown>> = {
|
|
|
21
21
|
* 체크박스가 있는 경우, 체크박스를 클릭했을 때 선택된 row의 index를 지정한다.
|
|
22
22
|
*/
|
|
23
23
|
selectionModel?: string[];
|
|
24
|
-
onSelectionModelChange?: (newSelectionModel: string[]
|
|
24
|
+
onSelectionModelChange?: (newSelectionModel: string[],
|
|
25
|
+
/**
|
|
26
|
+
* Total Select를 클릭한 경우에만 값이 true/false로 들어온다.
|
|
27
|
+
* MUI에는 없는 인터페이스지만 Total Select 기능이 추가되었기 때문에 추가해야했다.
|
|
28
|
+
*/
|
|
29
|
+
isTotalSelected?: boolean) => void;
|
|
30
|
+
paginationMode?: "client" | "server";
|
|
25
31
|
paginationModel?: {
|
|
26
32
|
page: number;
|
|
27
33
|
pageSize: number;
|
|
@@ -33,6 +39,7 @@ type DataTableProps<T extends Record<string, unknown>> = {
|
|
|
33
39
|
/**
|
|
34
40
|
* Rows의 총 갯수를 직접 지정 할 수 있다.
|
|
35
41
|
* 기본적으로는 rows.length를 사용하지만, 이 값을 지정하면 rows.length를 사용하지 않는다.
|
|
42
|
+
* server mode를 사용할 때 유용하다.
|
|
36
43
|
*/
|
|
37
44
|
rowCount?: number;
|
|
38
45
|
slots?: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
declare const Modal: import("framer-motion").CustomDomComponent<Pick<import("@mui/base").ModalOwnProps, "children" | "container" | "open" | "disablePortal" | "keepMounted" | "disableAutoFocus" | "disableEnforceFocus" | "disableRestoreFocus" | "disableEscapeKeyDown" | "disableScrollLock" | "hideBackdrop"> & {
|
|
3
|
-
onClose?: ((event: {}, reason: "
|
|
3
|
+
onClose?: ((event: {}, reason: "escapeKeyDown" | "backdropClick" | "closeClick") => void) | undefined;
|
|
4
4
|
sx?: import("@mui/joy/styles/types").SxProps | undefined;
|
|
5
5
|
} & import("@mui/joy").ModalSlotsAndSlotProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
6
6
|
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1231,11 +1231,11 @@ function useDataTableRenderer({
|
|
|
1231
1231
|
rows,
|
|
1232
1232
|
columns,
|
|
1233
1233
|
rowCount: totalRowsProp,
|
|
1234
|
+
paginationMode,
|
|
1234
1235
|
paginationModel,
|
|
1235
1236
|
onPaginationModelChange,
|
|
1236
1237
|
selectionModel = [],
|
|
1237
|
-
onSelectionModelChange
|
|
1238
|
-
stickyHeader
|
|
1238
|
+
onSelectionModelChange
|
|
1239
1239
|
}) {
|
|
1240
1240
|
const [page, setPage] = useState3(paginationModel?.page || 1);
|
|
1241
1241
|
const pageSize = paginationModel?.pageSize || 20;
|
|
@@ -1244,8 +1244,8 @@ function useDataTableRenderer({
|
|
|
1244
1244
|
[selectionModel]
|
|
1245
1245
|
);
|
|
1246
1246
|
const dataInPage = useMemo3(
|
|
1247
|
-
() => rows.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize),
|
|
1248
|
-
[rows, page, pageSize]
|
|
1247
|
+
() => paginationMode === "server" ? rows : rows.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize),
|
|
1248
|
+
[rows, page, pageSize, paginationMode]
|
|
1249
1249
|
);
|
|
1250
1250
|
const isAllSelected = useMemo3(
|
|
1251
1251
|
() => dataInPage.length > 0 && dataInPage.every(
|
|
@@ -1282,26 +1282,6 @@ function useDataTableRenderer({
|
|
|
1282
1282
|
pageSize,
|
|
1283
1283
|
onPaginationModelChange: handlePageChange,
|
|
1284
1284
|
HeadCell,
|
|
1285
|
-
// HeadCell: useCallback(
|
|
1286
|
-
// (column: Column<any>) => {
|
|
1287
|
-
// const ref = useRef<HTMLTableCellElement>(null);
|
|
1288
|
-
// const style = {
|
|
1289
|
-
// width: column.width,
|
|
1290
|
-
// minWidth: column.minWidth ?? "50px",
|
|
1291
|
-
// maxWidth: column.maxWidth,
|
|
1292
|
-
// textAlign: column.type === "number" ? "end" : "start",
|
|
1293
|
-
// position: stickyHeader ? undefined : "relative",
|
|
1294
|
-
// } as React.CSSProperties;
|
|
1295
|
-
// const resizer = column.resizable ?? true ? Resizer(ref) : null;
|
|
1296
|
-
// return (
|
|
1297
|
-
// <th ref={ref} key={column.field as string} style={style}>
|
|
1298
|
-
// {column.headerName ?? (column.field as string)}
|
|
1299
|
-
// {resizer}
|
|
1300
|
-
// </th>
|
|
1301
|
-
// );
|
|
1302
|
-
// },
|
|
1303
|
-
// [stickyHeader, columns]
|
|
1304
|
-
// ),
|
|
1305
1285
|
dataInPage,
|
|
1306
1286
|
isAllSelected,
|
|
1307
1287
|
// all rows are selected on this page
|
|
@@ -1338,7 +1318,8 @@ function useDataTableRenderer({
|
|
|
1338
1318
|
),
|
|
1339
1319
|
onTotalSelect: useCallback3(() => {
|
|
1340
1320
|
onSelectionModelChange?.(
|
|
1341
|
-
isTotalSelected ? [] : rows.map((_, i) => `${i}`)
|
|
1321
|
+
isTotalSelected ? [] : rows.map((_, i) => `${i}`),
|
|
1322
|
+
isTotalSelected
|
|
1342
1323
|
);
|
|
1343
1324
|
}, [isTotalSelected, rows, onSelectionModelChange])
|
|
1344
1325
|
};
|