@ceed/ads 0.0.22 → 0.0.23
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/Button/Button.d.ts +22 -5
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/DataTable/DataTable.d.ts +22 -15
- package/dist/components/DataTable/DataTable.js +66 -54
- package/dist/components/DialogFrame/DialogFrame.d.ts +11 -0
- package/dist/components/DialogFrame/DialogFrame.js +44 -0
- package/dist/components/DialogFrame/index.d.ts +3 -0
- package/dist/components/DialogFrame/index.js +3 -0
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/ThemeProvider/ThemeProvider.js +6 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/framer/index.js +3790 -3689
- package/package.json +1 -1
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ButtonProps } from "@mui/joy";
|
|
3
2
|
import { MotionProps } from "framer-motion";
|
|
4
|
-
declare const Button: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
declare const Button: React.ForwardRefExoticComponent<Omit<{
|
|
4
|
+
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
5
|
+
} & import("@mui/joy").ButtonSlotsAndSlotProps & {
|
|
6
|
+
action?: React.Ref<{
|
|
7
|
+
focusVisible(): void;
|
|
8
|
+
}> | undefined;
|
|
9
|
+
color?: import("@mui/types").OverridableStringUnion<import("@mui/joy").ColorPaletteProp, import("@mui/joy").ButtonPropsColorOverrides> | undefined;
|
|
10
|
+
disabled?: boolean | undefined;
|
|
11
|
+
endDecorator?: React.ReactNode;
|
|
12
|
+
focusVisibleClassName?: string | undefined;
|
|
13
|
+
fullWidth?: boolean | undefined;
|
|
14
|
+
size?: import("@mui/types").OverridableStringUnion<"sm" | "md" | "lg", import("@mui/joy").ButtonPropsSizeOverrides> | undefined;
|
|
15
|
+
startDecorator?: React.ReactNode;
|
|
16
|
+
sx?: import("@mui/joy/styles/types").SxProps | undefined;
|
|
17
|
+
tabIndex?: number | undefined;
|
|
18
|
+
variant?: import("@mui/types").OverridableStringUnion<import("@mui/joy").VariantProp, import("@mui/joy").ButtonPropsVariantOverrides> | undefined;
|
|
19
|
+
loading?: boolean | undefined;
|
|
20
|
+
loadingIndicator?: React.ReactNode;
|
|
21
|
+
loadingPosition?: "center" | "end" | "start" | undefined;
|
|
22
|
+
} & Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
23
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
24
|
+
}, "color" | "tabIndex" | "variant" | "sx" | "disabled" | "size" | "component" | keyof import("@mui/joy").ButtonSlotsAndSlotProps | "action" | "endDecorator" | "focusVisibleClassName" | "fullWidth" | "startDecorator" | "loading" | "loadingIndicator" | "loadingPosition"> & MotionProps, "ref"> & React.RefAttributes<unknown>>;
|
|
8
25
|
export { Button };
|
|
@@ -9,11 +9,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import React from "react";
|
|
12
|
+
import React, { forwardRef } from "react";
|
|
13
13
|
import { Button as JoyButton } from "@mui/joy";
|
|
14
14
|
import { motion } from "framer-motion";
|
|
15
15
|
var MotionButton = motion(JoyButton);
|
|
16
|
-
var Button = function (props) {
|
|
16
|
+
var Button = forwardRef(function (props) {
|
|
17
17
|
// prop destruction
|
|
18
18
|
// lib hooks
|
|
19
19
|
// state, ref, querystring hooks
|
|
@@ -23,6 +23,6 @@ var Button = function (props) {
|
|
|
23
23
|
// effects
|
|
24
24
|
// handlers
|
|
25
25
|
return (React.createElement(MotionButton, __assign({}, props)));
|
|
26
|
-
};
|
|
26
|
+
});
|
|
27
27
|
export { Button };
|
|
28
28
|
Button.displayName = "Button";
|
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
import React, { ComponentProps } from "react";
|
|
2
|
-
import { Table
|
|
2
|
+
import { Table } from "../Table";
|
|
3
3
|
type DataTableProps<T extends Record<string, unknown>> = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
rows: T[];
|
|
5
|
+
checkboxSelection?: boolean;
|
|
6
|
+
columns: {
|
|
7
|
+
type?: "number" | "string";
|
|
8
|
+
field: keyof T;
|
|
9
|
+
headerName?: string;
|
|
10
|
+
width?: string;
|
|
11
|
+
minWidth?: string;
|
|
12
|
+
maxWidth?: string;
|
|
13
|
+
}[];
|
|
7
14
|
/**
|
|
8
15
|
* 체크박스가 있는 경우, 체크박스를 클릭했을 때 선택된 row의 index를 지정한다.
|
|
9
16
|
*/
|
|
10
17
|
selectionModel?: string[];
|
|
11
18
|
onSelectionModelChange?: (newSelectionModel: string[]) => void;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
paginationModel?: {
|
|
20
|
+
page: number;
|
|
21
|
+
pageSize: number;
|
|
22
|
+
};
|
|
23
|
+
onPaginationModelChange?: (model: {
|
|
24
|
+
page: number;
|
|
25
|
+
pageSize: number;
|
|
26
|
+
}) => void;
|
|
19
27
|
/**
|
|
20
28
|
* Rows의 총 갯수를 직접 지정 할 수 있다.
|
|
21
|
-
*
|
|
22
|
-
* data lazy loading을 위한 prop
|
|
29
|
+
* 기본적으로는 rows.length를 사용하지만, 이 값을 지정하면 rows.length를 사용하지 않는다.
|
|
23
30
|
*/
|
|
24
|
-
|
|
31
|
+
rowCount?: number;
|
|
25
32
|
slots?: {
|
|
26
33
|
checkbox?: React.ElementType;
|
|
27
34
|
toolbar?: React.ElementType;
|
|
@@ -39,7 +46,7 @@ type DataTableProps<T extends Record<string, unknown>> = {
|
|
|
39
46
|
[key: string]: any;
|
|
40
47
|
}>;
|
|
41
48
|
};
|
|
42
|
-
} & ComponentProps<typeof Table
|
|
49
|
+
} & ComponentProps<typeof Table>;
|
|
43
50
|
declare function DataTable<T extends Record<string, unknown>>(props: DataTableProps<T>): React.JSX.Element;
|
|
44
51
|
declare namespace DataTable {
|
|
45
52
|
var displayName: string;
|
|
@@ -31,22 +31,25 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
31
31
|
};
|
|
32
32
|
import React, { useCallback, useEffect, useMemo, useState, } from "react";
|
|
33
33
|
import Sheet from "../Sheet";
|
|
34
|
-
import { Table
|
|
34
|
+
import { Table } from "../Table";
|
|
35
35
|
import Checkbox from "../Checkbox";
|
|
36
36
|
import Box from "../Box";
|
|
37
37
|
import Stack from "../Stack";
|
|
38
38
|
import Typography from "../Typography";
|
|
39
39
|
import Button from "../Button";
|
|
40
|
+
var numberFormatter = function (value) {
|
|
41
|
+
return "Intl" in window ? new Intl.NumberFormat().format(value) : value;
|
|
42
|
+
};
|
|
40
43
|
function TablePagination(props) {
|
|
41
44
|
// prop destruction
|
|
42
|
-
var
|
|
45
|
+
var _a = props.paginationModel, page = _a.page, pageSize = _a.pageSize, rowCount = props.rowCount, onPageChange = props.onPageChange;
|
|
43
46
|
// lib hooks
|
|
44
47
|
// state, ref, querystring hooks
|
|
45
48
|
// form hooks
|
|
46
49
|
// query hooks
|
|
47
50
|
// calculated values
|
|
48
51
|
var firstPage = 1;
|
|
49
|
-
var lastPage = Math.ceil(
|
|
52
|
+
var lastPage = Math.ceil(rowCount / pageSize);
|
|
50
53
|
var beforePages = [page - 2, page - 1].filter(function (p) { return p > 1; });
|
|
51
54
|
var afterPages = [page + 1, page + 2].filter(function (p) { return p <= lastPage - 1; });
|
|
52
55
|
var isMoreAfterPages = lastPage > 1 && page < lastPage - 3;
|
|
@@ -69,82 +72,76 @@ function TablePagination(props) {
|
|
|
69
72
|
React.createElement(Button, { size: "sm", variant: "plain", color: "neutral", onClick: function () { return onPageChange(page + 1); }, disabled: page === lastPage, "aria-label": "Next page" }, ">"))));
|
|
70
73
|
}
|
|
71
74
|
function useDataTableRenderer(_a) {
|
|
72
|
-
var
|
|
73
|
-
var
|
|
75
|
+
var rows = _a.rows, columns = _a.columns, totalRowsProp = _a.rowCount, paginationModel = _a.paginationModel, onPaginationModelChange = _a.onPaginationModelChange, _b = _a.selectionModel, selectionModel = _b === void 0 ? [] : _b, onSelectionModelChange = _a.onSelectionModelChange;
|
|
76
|
+
var _c = useState((paginationModel === null || paginationModel === void 0 ? void 0 : paginationModel.page) || 1), page = _c[0], setPage = _c[1];
|
|
77
|
+
var pageSize = (paginationModel === null || paginationModel === void 0 ? void 0 : paginationModel.pageSize) || 20;
|
|
74
78
|
var selectedModelSet = useMemo(function () { return new Set(selectionModel); }, [selectionModel]);
|
|
75
|
-
var dataInPage = useMemo(function () {
|
|
76
|
-
return data.slice((page - 1) * rowsPerPage, (page - 1) * rowsPerPage + rowsPerPage);
|
|
77
|
-
}, [data, page, rowsPerPage]);
|
|
79
|
+
var dataInPage = useMemo(function () { return rows.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize); }, [rows, page, pageSize]);
|
|
78
80
|
var isAllSelected = useMemo(function () {
|
|
79
81
|
return dataInPage.length > 0 &&
|
|
80
82
|
dataInPage.every(function (_, i) {
|
|
81
|
-
return selectedModelSet.has("".concat(i + (page - 1) *
|
|
83
|
+
return selectedModelSet.has("".concat(i + (page - 1) * pageSize));
|
|
82
84
|
});
|
|
83
|
-
}, [dataInPage, selectedModelSet, page,
|
|
84
|
-
var
|
|
85
|
-
var isTotalSelected = useMemo(function () { return
|
|
85
|
+
}, [dataInPage, selectedModelSet, page, pageSize]);
|
|
86
|
+
var rowCount = totalRowsProp || rows.length;
|
|
87
|
+
var isTotalSelected = useMemo(function () { return rowCount > 0 && selectionModel.length === rowCount; }, [selectionModel, rowCount]);
|
|
86
88
|
var handlePageChange = useCallback(function (newPage) {
|
|
87
89
|
setPage(newPage);
|
|
88
|
-
|
|
89
|
-
}, [
|
|
90
|
+
onPaginationModelChange === null || onPaginationModelChange === void 0 ? void 0 : onPaginationModelChange({ page: newPage, pageSize: pageSize });
|
|
91
|
+
}, [onPaginationModelChange]);
|
|
90
92
|
useEffect(function () {
|
|
91
93
|
handlePageChange(1);
|
|
92
|
-
}, [
|
|
94
|
+
}, [rowCount]);
|
|
93
95
|
useEffect(function () {
|
|
94
|
-
if (page > Math.ceil(
|
|
95
|
-
handlePageChange(Math.ceil(
|
|
96
|
+
if (page > Math.ceil(rowCount / pageSize)) {
|
|
97
|
+
handlePageChange(Math.ceil(rowCount / pageSize));
|
|
96
98
|
}
|
|
97
|
-
}, [
|
|
99
|
+
}, [rowCount, pageSize]);
|
|
98
100
|
useEffect(function () {
|
|
99
101
|
onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange([]);
|
|
100
102
|
}, [page]);
|
|
101
103
|
return {
|
|
102
|
-
|
|
104
|
+
rowCount: rowCount,
|
|
103
105
|
page: page,
|
|
104
|
-
|
|
106
|
+
pageSize: pageSize,
|
|
107
|
+
onPaginationModelChange: handlePageChange,
|
|
105
108
|
dataInPage: dataInPage,
|
|
106
109
|
isAllSelected: isAllSelected, // all rows are selected on this page
|
|
107
110
|
isTotalSelected: isTotalSelected,
|
|
108
111
|
isSelectedRow: useCallback(function (model) { return selectedModelSet.has(model); }, [selectedModelSet]),
|
|
109
112
|
onAllCheckboxChange: useCallback(function () {
|
|
110
|
-
|
|
113
|
+
onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(isAllSelected
|
|
111
114
|
? []
|
|
112
|
-
: dataInPage.map(function (_, i) { return "".concat(i + (page - 1) *
|
|
115
|
+
: dataInPage.map(function (_, i) { return "".concat(i + (page - 1) * pageSize); }));
|
|
113
116
|
}, [isAllSelected, dataInPage, onSelectionModelChange]),
|
|
114
117
|
onCheckboxChange: useCallback(function (event, selectedModel) {
|
|
115
118
|
if (selectedModelSet.has(selectedModel)) {
|
|
116
119
|
var newSelectionModel = selectionModel.filter(function (model) { return model !== selectedModel; });
|
|
117
120
|
onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel);
|
|
118
|
-
onCheckboxChange === null || onCheckboxChange === void 0 ? void 0 : onCheckboxChange(event, selectedModel);
|
|
119
121
|
}
|
|
120
122
|
else {
|
|
121
|
-
|
|
123
|
+
var newSelectionModel = __spreadArray(__spreadArray([], selectionModel, true), [selectedModel], false);
|
|
124
|
+
onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel);
|
|
122
125
|
}
|
|
123
126
|
}, [selectionModel, onSelectionModelChange]),
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return headCells ||
|
|
127
|
+
columns: useMemo(function () {
|
|
128
|
+
return columns ||
|
|
127
129
|
// fallback
|
|
128
|
-
Object.keys(
|
|
129
|
-
|
|
130
|
+
Object.keys(rows[0] || {}).map(function (key) { return ({
|
|
131
|
+
field: key,
|
|
130
132
|
}); });
|
|
131
|
-
}, [
|
|
133
|
+
}, [rows, columns]),
|
|
132
134
|
onTotalSelect: useCallback(function () {
|
|
133
|
-
onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(isTotalSelected ? [] :
|
|
134
|
-
}, [isTotalSelected,
|
|
135
|
+
onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(isTotalSelected ? [] : rows.map(function (_, i) { return "".concat(i); }));
|
|
136
|
+
}, [isTotalSelected, rows, onSelectionModelChange]),
|
|
135
137
|
};
|
|
136
138
|
}
|
|
137
139
|
function DataTable(props) {
|
|
138
140
|
// prop destruction
|
|
139
|
-
var
|
|
140
|
-
_a = props.
|
|
141
|
-
rowsPerPage = _a === void 0 ? 20 : _a, _page = props.page, // page is used in useDataTableRenderer
|
|
142
|
-
_onPageChange = props.onPageChange, // onPageChange is used in useDataTableRenderer
|
|
143
|
-
_onCheckboxChange = props.onCheckboxChange, // onCheckboxChange is used in useDataTableRenderer
|
|
144
|
-
_b = props.slots, // onCheckboxChange is used in useDataTableRenderer
|
|
145
|
-
_c = _b === void 0 ? {} : _b, _d = _c.checkbox, RenderCheckbox = _d === void 0 ? Checkbox : _d, Toolbar = _c.toolbar, Footer = _c.footer, _e = props.slotProps, _f = _e === void 0 ? {} : _e, _g = _f.checkbox, checkboxProps = _g === void 0 ? {} : _g, toolbarProps = _f.toolbar, _h = _f.background, backgroundProps = _h === void 0 ? {} : _h, innerProps = __rest(props, ["data", "showCheckbox", "headCells", "cellOrder", "selectionModel", "onSelectionModelChange", "totalRows", "rowsPerPage", "page", "onPageChange", "onCheckboxChange", "slots", "slotProps"]);
|
|
141
|
+
var rows = props.rows, checkboxSelection = props.checkboxSelection, selectionModel = props.selectionModel, onSelectionModelChange = props.onSelectionModelChange, _ = props.rowCount, // rowCount is used in useDataTableRenderer
|
|
142
|
+
paginationModel = props.paginationModel, _a = props.slots, _b = _a === void 0 ? {} : _a, _c = _b.checkbox, RenderCheckbox = _c === void 0 ? Checkbox : _c, Toolbar = _b.toolbar, Footer = _b.footer, _d = props.slotProps, _e = _d === void 0 ? {} : _d, _f = _e.checkbox, checkboxProps = _f === void 0 ? {} : _f, toolbarProps = _e.toolbar, _g = _e.background, backgroundProps = _g === void 0 ? {} : _g, innerProps = __rest(props, ["rows", "checkboxSelection", "selectionModel", "onSelectionModelChange", "rowCount", "paginationModel", "slots", "slotProps"]);
|
|
146
143
|
// lib hooks
|
|
147
|
-
var
|
|
144
|
+
var _h = useDataTableRenderer(props), columns = _h.columns, isAllSelected = _h.isAllSelected, isSelectedRow = _h.isSelectedRow, onAllCheckboxChange = _h.onAllCheckboxChange, onCheckboxChange = _h.onCheckboxChange, rowCount = _h.rowCount, page = _h.page, pageSize = _h.pageSize, onPaginationModelChange = _h.onPaginationModelChange, dataInPage = _h.dataInPage, isTotalSelected = _h.isTotalSelected, onTotalSelect = _h.onTotalSelect;
|
|
148
145
|
// state, ref, querystring hooks
|
|
149
146
|
// form hooks
|
|
150
147
|
// query hooks
|
|
@@ -158,21 +155,21 @@ function DataTable(props) {
|
|
|
158
155
|
}, justifyContent: "space-between", alignItems: "center" },
|
|
159
156
|
React.createElement(Stack, { direction: "row", spacing: 1 },
|
|
160
157
|
!isAllSelected && (React.createElement(Typography, { level: "body-xs" },
|
|
161
|
-
(selectionModel === null || selectionModel === void 0 ? void 0 : selectionModel.length) || 0,
|
|
158
|
+
numberFormatter((selectionModel === null || selectionModel === void 0 ? void 0 : selectionModel.length) || 0),
|
|
162
159
|
" items selected")),
|
|
163
160
|
isAllSelected && !isTotalSelected && (React.createElement(Stack, { direction: "row", spacing: 1, alignItems: "center" },
|
|
164
161
|
React.createElement(Typography, { level: "body-xs" },
|
|
165
|
-
"All ",
|
|
166
|
-
selectionModel.length,
|
|
162
|
+
"All ",
|
|
163
|
+
numberFormatter((selectionModel === null || selectionModel === void 0 ? void 0 : selectionModel.length) || 0),
|
|
167
164
|
" items on this page are selected."),
|
|
168
165
|
React.createElement(Button, { size: "sm", variant: "plain", onClick: onTotalSelect },
|
|
169
166
|
"Select all ",
|
|
170
|
-
|
|
167
|
+
numberFormatter(rows.length),
|
|
171
168
|
" items"))),
|
|
172
169
|
isTotalSelected && (React.createElement(Stack, { direction: "row", spacing: 1, alignItems: "center" },
|
|
173
170
|
React.createElement(Typography, { level: "body-xs" },
|
|
174
171
|
"All ",
|
|
175
|
-
|
|
172
|
+
numberFormatter(rows.length),
|
|
176
173
|
" items are selected."),
|
|
177
174
|
React.createElement(Button, { size: "sm", variant: "plain", color: "danger", onClick: onTotalSelect }, "Cancel")))),
|
|
178
175
|
Toolbar && React.createElement(Toolbar, __assign({}, (toolbarProps || {})))),
|
|
@@ -190,14 +187,27 @@ function DataTable(props) {
|
|
|
190
187
|
},
|
|
191
188
|
},
|
|
192
189
|
] }, innerProps),
|
|
193
|
-
React.createElement(
|
|
194
|
-
|
|
195
|
-
|
|
190
|
+
React.createElement("thead", null,
|
|
191
|
+
React.createElement("tr", null,
|
|
192
|
+
checkboxSelection && (React.createElement("th", { style: {
|
|
193
|
+
width: "40px",
|
|
194
|
+
textAlign: "center",
|
|
195
|
+
} },
|
|
196
|
+
React.createElement(RenderCheckbox, __assign({ onChange: onAllCheckboxChange, checked: isAllSelected, indeterminate: (selectionModel || []).length > 0 && !isAllSelected }, checkboxProps)))),
|
|
197
|
+
columns.map(function (column) {
|
|
198
|
+
var _a;
|
|
199
|
+
return (React.createElement("th", { key: column.field, style: {
|
|
200
|
+
width: column.width,
|
|
201
|
+
minWidth: column.minWidth,
|
|
202
|
+
maxWidth: column.maxWidth,
|
|
203
|
+
textAlign: column.type === "number" ? "end" : "start",
|
|
204
|
+
} }, (_a = column.headerName) !== null && _a !== void 0 ? _a : column.field));
|
|
205
|
+
}))),
|
|
196
206
|
React.createElement("tbody", null, dataInPage.map(function (row, rowIndex) {
|
|
197
|
-
var rowId = "".concat(rowIndex + (page - 1) *
|
|
198
|
-
return (React.createElement("tr", { key: rowId, role:
|
|
207
|
+
var rowId = "".concat(rowIndex + (page - 1) * pageSize);
|
|
208
|
+
return (React.createElement("tr", { key: rowId, role: checkboxSelection ? "checkbox" : undefined, tabIndex: checkboxSelection ? -1 : undefined, onClick: checkboxSelection
|
|
199
209
|
? function (e) { return onCheckboxChange(e, rowId); }
|
|
200
|
-
: undefined, "aria-checked":
|
|
210
|
+
: undefined, "aria-checked": checkboxSelection ? isSelectedRow(rowId) : undefined, style: checkboxSelection && isSelectedRow(rowId)
|
|
201
211
|
? {
|
|
202
212
|
"--TableCell-dataBackground": "var(--TableCell-selectedBackground)",
|
|
203
213
|
"--TableCell-headBackground": "var(--TableCell-selectedBackground)",
|
|
@@ -205,14 +215,16 @@ function DataTable(props) {
|
|
|
205
215
|
: {
|
|
206
216
|
"--TableCell-headBackground": "transparent",
|
|
207
217
|
} },
|
|
208
|
-
|
|
218
|
+
checkboxSelection && (React.createElement("th", { scope: "row", style: {
|
|
209
219
|
textAlign: "center",
|
|
210
220
|
} },
|
|
211
221
|
React.createElement(RenderCheckbox, __assign({ onChange: function (e) { return onCheckboxChange(e, rowId); }, checked: isSelectedRow(rowId) }, checkboxProps)))),
|
|
212
|
-
|
|
222
|
+
columns.map(function (column) { return (React.createElement("td", { key: column.field, style: {
|
|
223
|
+
textAlign: column.type === "number" ? "end" : "start",
|
|
224
|
+
} }, row[column.field])); })));
|
|
213
225
|
})),
|
|
214
226
|
Footer && React.createElement(Footer, null))),
|
|
215
|
-
React.createElement(TablePagination, { page: page,
|
|
227
|
+
React.createElement(TablePagination, { paginationModel: { page: page, pageSize: pageSize }, rowCount: rowCount, onPageChange: onPaginationModelChange, onRowsPerPageChange: function () { } })));
|
|
216
228
|
}
|
|
217
229
|
export { DataTable };
|
|
218
230
|
DataTable.displayName = "DataTable";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ModalDialog } from "../Modal";
|
|
3
|
+
declare function DialogFrame(props: {
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
actions: React.ReactNode;
|
|
7
|
+
} & React.ComponentProps<typeof ModalDialog>): React.JSX.Element;
|
|
8
|
+
declare namespace DialogFrame {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
export { DialogFrame };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from "react";
|
|
24
|
+
import DialogTitle from "../DialogTitle";
|
|
25
|
+
import DialogContent from "../DialogContent";
|
|
26
|
+
import { ModalDialog } from "../Modal";
|
|
27
|
+
import DialogActions from "../DialogActions";
|
|
28
|
+
function DialogFrame(props) {
|
|
29
|
+
// prop destruction
|
|
30
|
+
var title = props.title, children = props.children, actions = props.actions, innerProps = __rest(props, ["title", "children", "actions"]);
|
|
31
|
+
// lib hooks
|
|
32
|
+
// state, ref, querystring hooks
|
|
33
|
+
// form hooks
|
|
34
|
+
// query hooks
|
|
35
|
+
// calculated values
|
|
36
|
+
// effects
|
|
37
|
+
// handlers
|
|
38
|
+
return (React.createElement(ModalDialog, __assign({}, innerProps),
|
|
39
|
+
React.createElement(DialogTitle, null, title),
|
|
40
|
+
React.createElement(DialogContent, null, children),
|
|
41
|
+
React.createElement(DialogActions, null, actions)));
|
|
42
|
+
}
|
|
43
|
+
export { DialogFrame };
|
|
44
|
+
DialogFrame.displayName = "DialogFrame";
|
|
@@ -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" | "disableAutoFocus" | "disableEnforceFocus" | "disableEscapeKeyDown" | "disablePortal" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted"> & {
|
|
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;
|
|
@@ -7,6 +7,7 @@ export { DataTable } from "./DataTable";
|
|
|
7
7
|
export { DialogActions } from "./DialogActions";
|
|
8
8
|
export { DialogContent } from "./DialogContent";
|
|
9
9
|
export { DialogTitle } from "./DialogTitle";
|
|
10
|
+
export { DialogFrame } from "./DialogFrame";
|
|
10
11
|
export { Divider } from "./Divider";
|
|
11
12
|
export { InsetDrawer } from "./InsetDrawer";
|
|
12
13
|
export { Dropdown } from "./Dropdown";
|
package/dist/components/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export { DataTable } from "./DataTable";
|
|
|
7
7
|
export { DialogActions } from "./DialogActions";
|
|
8
8
|
export { DialogContent } from "./DialogContent";
|
|
9
9
|
export { DialogTitle } from "./DialogTitle";
|
|
10
|
+
export { DialogFrame } from "./DialogFrame";
|
|
10
11
|
export { Divider } from "./Divider";
|
|
11
12
|
export { InsetDrawer } from "./InsetDrawer";
|
|
12
13
|
export { Dropdown } from "./Dropdown";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { boxClasses, buttonClasses, checkboxClasses, dividerClasses, iconButtonClasses, inputClasses, menuClasses, menuButtonClasses, menuItemClasses, optionClasses, radioClasses, radioGroupClasses, selectClasses, switchClasses, tableClasses, textareaClasses, typographyClasses, formControlClasses, formLabelClasses, formHelperTextClasses, gridClasses, stackClasses, sheetClasses, modalClasses, modalCloseClasses, modalDialogClasses, modalOverflowClasses, dialogTitleClasses, dialogContentClasses, dialogActionsClasses, tooltipClasses, tabsClasses, tabListClasses, tabPanelClasses, accordionClasses, accordionDetailsClasses, accordionGroupClasses as accordionsClasses, accordionSummaryClasses, Avatar, avatarClasses, AvatarGroup, avatarGroupClasses, AspectRatio, aspectRatioClasses, Badge, badgeClasses, Breadcrumbs, breadcrumbsClasses, Card, cardClasses, CardActions, cardActionsClasses, CardContent, cardContentClasses, CardCover, cardCoverClasses, CardOverflow, cardOverflowClasses, Chip, chipClasses, CircularProgress, circularProgressClasses, Drawer, drawerClasses, LinearProgress, linearProgressClasses, List, listClasses, ListDivider, listDividerClasses, ListItem, listItemClasses, ListItemButton, listItemButtonClasses, ListItemContent, listItemContentClasses, ListItemDecorator, listItemDecoratorClasses, ListSubheader, listSubheaderClasses, Link, linkClasses, Slider, sliderClasses, Step, stepClasses, StepButton, stepButtonClasses, StepIndicator, Stepper, stepperClasses, Skeleton, skeletonClasses, } from "@mui/joy";
|
|
2
|
-
export { Accordion, Accordions, AccordionDetails, AccordionSummary, Box, Button, Checkbox, Container, DataTable, DialogActions, DialogContent, DialogTitle, Divider, Dropdown, InsetDrawer, FormControl, FormHelperText, FormLabel, Grid, IconButton, Input, Menu, MenuButton, MenuItem, Modal, ModalClose, ModalDialog, ModalOverflow, ModalFrame, Radio, RadioGroup, RadioList, Select, Option, Sheet, Stack, Switch, Table, TableHead, TableBody, Tabs, Tab, TabList, TabPanel, Textarea, ThemeProvider, Tooltip, Typography, } from "./components";
|
|
2
|
+
export { Accordion, Accordions, AccordionDetails, AccordionSummary, Box, Button, Checkbox, Container, DataTable, DialogActions, DialogContent, DialogTitle, DialogFrame, Divider, Dropdown, InsetDrawer, FormControl, FormHelperText, FormLabel, Grid, IconButton, Input, Menu, MenuButton, MenuItem, Modal, ModalClose, ModalDialog, ModalOverflow, ModalFrame, Radio, RadioGroup, RadioList, Select, Option, Sheet, Stack, Switch, Table, TableHead, TableBody, Tabs, Tab, TabList, TabPanel, Textarea, ThemeProvider, Tooltip, Typography, } from "./components";
|
package/dist/index.js
CHANGED
|
@@ -3,4 +3,4 @@ export {
|
|
|
3
3
|
boxClasses, buttonClasses, checkboxClasses, dividerClasses, iconButtonClasses, inputClasses, menuClasses, menuButtonClasses, menuItemClasses, optionClasses, radioClasses, radioGroupClasses, selectClasses, switchClasses, tableClasses, textareaClasses, typographyClasses, formControlClasses, formLabelClasses, formHelperTextClasses, gridClasses, stackClasses, sheetClasses, modalClasses, modalCloseClasses, modalDialogClasses, modalOverflowClasses, dialogTitleClasses, dialogContentClasses, dialogActionsClasses, tooltipClasses, tabsClasses, tabListClasses, tabPanelClasses,
|
|
4
4
|
// Pure JoyUI
|
|
5
5
|
accordionClasses, accordionDetailsClasses, accordionGroupClasses as accordionsClasses, accordionSummaryClasses, Avatar, avatarClasses, AvatarGroup, avatarGroupClasses, AspectRatio, aspectRatioClasses, Badge, badgeClasses, Breadcrumbs, breadcrumbsClasses, Card, cardClasses, CardActions, cardActionsClasses, CardContent, cardContentClasses, CardCover, cardCoverClasses, CardOverflow, cardOverflowClasses, Chip, chipClasses, CircularProgress, circularProgressClasses, Drawer, drawerClasses, LinearProgress, linearProgressClasses, List, listClasses, ListDivider, listDividerClasses, ListItem, listItemClasses, ListItemButton, listItemButtonClasses, ListItemContent, listItemContentClasses, ListItemDecorator, listItemDecoratorClasses, ListSubheader, listSubheaderClasses, Link, linkClasses, Slider, sliderClasses, Step, stepClasses, StepButton, stepButtonClasses, StepIndicator, Stepper, stepperClasses, Skeleton, skeletonClasses, } from "@mui/joy";
|
|
6
|
-
export { Accordion, Accordions, AccordionDetails, AccordionSummary, Box, Button, Checkbox, Container, DataTable, DialogActions, DialogContent, DialogTitle, Divider, Dropdown, InsetDrawer, FormControl, FormHelperText, FormLabel, Grid, IconButton, Input, Menu, MenuButton, MenuItem, Modal, ModalClose, ModalDialog, ModalOverflow, ModalFrame, Radio, RadioGroup, RadioList, Select, Option, Sheet, Stack, Switch, Table, TableHead, TableBody, Tabs, Tab, TabList, TabPanel, Textarea, ThemeProvider, Tooltip, Typography, } from "./components";
|
|
6
|
+
export { Accordion, Accordions, AccordionDetails, AccordionSummary, Box, Button, Checkbox, Container, DataTable, DialogActions, DialogContent, DialogTitle, DialogFrame, Divider, Dropdown, InsetDrawer, FormControl, FormHelperText, FormLabel, Grid, IconButton, Input, Menu, MenuButton, MenuItem, Modal, ModalClose, ModalDialog, ModalOverflow, ModalFrame, Radio, RadioGroup, RadioList, Select, Option, Sheet, Stack, Switch, Table, TableHead, TableBody, Tabs, Tab, TabList, TabPanel, Textarea, ThemeProvider, Tooltip, Typography, } from "./components";
|