@ceed/ads 0.0.17 → 0.0.18

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.
@@ -0,0 +1,66 @@
1
+ import React from "react";
2
+ declare const AccordionSummary: import("framer-motion").CustomDomComponent<{
3
+ children?: React.ReactNode;
4
+ color?: import("@mui/types").OverridableStringUnion<import("@mui/joy").ColorPaletteProp, import("@mui/joy").AccordionSummaryPropsColorOverrides> | undefined;
5
+ indicator?: React.ReactNode;
6
+ variant?: import("@mui/types").OverridableStringUnion<import("@mui/joy").VariantProp, import("@mui/joy").AccordionSummaryPropsVariantOverrides> | undefined;
7
+ sx?: import("@mui/joy/styles/types").SxProps | undefined;
8
+ } & import("@mui/joy").AccordionSummarySlotsAndSlotProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
9
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
10
+ }, "children" | "color" | "indicator" | "variant" | "sx" | keyof import("@mui/joy").AccordionSummarySlotsAndSlotProps>>;
11
+ export { AccordionSummary };
12
+ declare const AccordionDetails: import("framer-motion").CustomDomComponent<{
13
+ children?: React.ReactNode;
14
+ color?: import("@mui/types").OverridableStringUnion<import("@mui/joy").ColorPaletteProp, import("@mui/joy").AccordionDetailsPropsColorOverrides> | undefined;
15
+ variant?: import("@mui/types").OverridableStringUnion<import("@mui/joy").VariantProp, import("@mui/joy").AccordionDetailsPropsVariantOverrides> | undefined;
16
+ sx?: import("@mui/joy/styles/types").SxProps | undefined;
17
+ } & import("@mui/joy").AccordionDetailsSlotsAndSlotProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
18
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
19
+ }, "children" | "color" | "variant" | "sx" | keyof import("@mui/joy").AccordionDetailsSlotsAndSlotProps>>;
20
+ export { AccordionDetails };
21
+ declare const MotionAccordion: import("framer-motion").CustomDomComponent<{
22
+ accordionId?: string | undefined;
23
+ color?: import("@mui/types").OverridableStringUnion<import("@mui/joy").ColorPaletteProp, import("@mui/joy").AccordionPropsColorOverrides> | undefined;
24
+ children?: React.ReactNode;
25
+ defaultExpanded?: boolean | undefined;
26
+ disabled?: boolean | undefined;
27
+ expanded?: boolean | undefined;
28
+ onChange?: ((event: React.SyntheticEvent<Element, Event>, expanded: boolean) => void) | undefined;
29
+ variant?: import("@mui/types").OverridableStringUnion<import("@mui/joy").VariantProp, import("@mui/joy").AccordionPropsVariantOverrides> | undefined;
30
+ sx?: import("@mui/joy/styles/types").SxProps | undefined;
31
+ } & import("@mui/joy").AccordionSlotsAndSlotProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
32
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
33
+ }, "children" | "color" | "onChange" | "variant" | "sx" | "accordionId" | "defaultExpanded" | "disabled" | "expanded" | keyof import("@mui/joy").AccordionSlotsAndSlotProps>>;
34
+ declare function Accordion(props: {
35
+ summary: React.ReactNode;
36
+ details: React.ReactNode;
37
+ index: number;
38
+ } & React.ComponentProps<typeof MotionAccordion>): React.JSX.Element;
39
+ declare namespace Accordion {
40
+ var displayName: string;
41
+ }
42
+ export { Accordion };
43
+ declare const MotionAccordions: import("framer-motion").CustomDomComponent<{
44
+ children?: React.ReactNode;
45
+ color?: import("@mui/types").OverridableStringUnion<import("@mui/joy").ColorPaletteProp, import("@mui/joy").AccordionGroupPropsColorOverrides> | undefined;
46
+ disableDivider?: boolean | undefined;
47
+ size?: import("@mui/types").OverridableStringUnion<"sm" | "md" | "lg", import("@mui/joy").AccordionGroupPropsSizeOverrides> | undefined;
48
+ transition?: string | {
49
+ initial: string;
50
+ expanded: string;
51
+ } | undefined;
52
+ variant?: import("@mui/types").OverridableStringUnion<import("@mui/joy").VariantProp, import("@mui/joy").AccordionGroupPropsVariantOverrides> | undefined;
53
+ sx?: import("@mui/joy/styles/types").SxProps | undefined;
54
+ } & import("@mui/joy").AccordionGroupSlotsAndSlotProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
55
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
56
+ }, "children" | "transition" | "color" | "variant" | "sx" | "disableDivider" | "size" | keyof import("@mui/joy").AccordionGroupSlotsAndSlotProps>>;
57
+ declare function Accordions(props: {
58
+ items: {
59
+ summary: string;
60
+ details: React.ReactNode;
61
+ }[];
62
+ } & React.ComponentProps<typeof MotionAccordions>): React.JSX.Element;
63
+ declare namespace Accordions {
64
+ var displayName: string;
65
+ }
66
+ export { Accordions };
@@ -0,0 +1,66 @@
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 { AccordionGroup as JoyAccordionGroup, Accordion as JoyAccordion, AccordionSummary as JoyAccordionSummary, AccordionDetails as JoyAccordionDetails, } from "@mui/joy";
25
+ import { motion } from "framer-motion";
26
+ var MotionAccordionSummary = motion(JoyAccordionSummary);
27
+ var AccordionSummary = MotionAccordionSummary;
28
+ export { AccordionSummary };
29
+ AccordionSummary.displayName = "AccordionSummary";
30
+ var MotionAccordionDetails = motion(JoyAccordionDetails);
31
+ var AccordionDetails = MotionAccordionDetails;
32
+ export { AccordionDetails };
33
+ AccordionDetails.displayName = "AccordionDetails";
34
+ var MotionAccordion = motion(JoyAccordion);
35
+ function Accordion(props) {
36
+ // prop destruction
37
+ var summary = props.summary, details = props.details, variant = props.variant, color = props.color, innerProps = __rest(props, ["summary", "details", "variant", "color"]);
38
+ // lib hooks
39
+ // state, ref, querystring hooks
40
+ // form hooks
41
+ // query hooks
42
+ // calculated values
43
+ var inheritedVariant = variant === "solid" ? "solid" : undefined;
44
+ // effects
45
+ // handlers
46
+ return (React.createElement(MotionAccordion, __assign({ variant: inheritedVariant, color: color }, innerProps),
47
+ React.createElement(AccordionSummary, { variant: inheritedVariant, color: color }, summary),
48
+ React.createElement(AccordionDetails, { variant: inheritedVariant, color: color }, details)));
49
+ }
50
+ export { Accordion };
51
+ Accordion.displayName = "Accordion";
52
+ var MotionAccordions = motion(JoyAccordionGroup);
53
+ function Accordions(props) {
54
+ // prop destruction
55
+ var variant = props.variant, color = props.color, items = props.items, innerProps = __rest(props, ["variant", "color", "items"]);
56
+ // lib hooks
57
+ // state, ref, querystring hooks
58
+ // form hooks
59
+ // query hooks
60
+ // calculated values
61
+ // effects
62
+ // handlers
63
+ return (React.createElement(MotionAccordions, __assign({ variant: variant, color: color }, innerProps), items.map(function (item, index) { return (React.createElement(Accordion, { summary: item.summary, details: item.details, index: index, variant: variant, color: color })); })));
64
+ }
65
+ export { Accordions };
66
+ Accordions.displayName = "Accordions";
@@ -0,0 +1,3 @@
1
+ import { Accordions } from "./Accordions";
2
+ export * from "./Accordions";
3
+ export default Accordions;
@@ -0,0 +1,3 @@
1
+ import { Accordions } from "./Accordions";
2
+ export * from "./Accordions";
3
+ export default Accordions;
@@ -1,11 +1,31 @@
1
1
  import React, { ComponentProps } from "react";
2
2
  import { Table, TableBody, TableHead } from "../Table";
3
- declare function DataTable<T extends Record<string, unknown>>(props: {
3
+ type DataTableProps<T extends Record<string, unknown>> = {
4
4
  data: T[];
5
5
  showCheckbox?: boolean;
6
+ onCheckboxChange?: (event: any, selectedModel: string) => void;
7
+ /**
8
+ * 체크박스가 있는 경우, 체크박스를 클릭했을 때 선택된 row의 index를 지정한다.
9
+ */
10
+ selectionModel?: string[];
11
+ onSelectionModelChange?: (newSelectionModel: string[]) => void;
12
+ /**
13
+ * 페이지네이션을 위한 prop
14
+ * 별도로 지정하지 않으면, data prop 기반의 페이지네이션을 사용한다.
15
+ */
16
+ page?: number;
17
+ onPageChange?: (newPage: number) => void;
18
+ rowsPerPage?: number;
19
+ /**
20
+ * Rows의 총 갯수를 직접 지정 할 수 있다.
21
+ * 이 값이 주어지면, data prop 기반의 페이지네이션을 사용하지 않는다.
22
+ * data lazy loading을 위한 prop
23
+ */
24
+ totalRows?: number;
6
25
  slots?: {
7
26
  checkbox?: React.ElementType;
8
27
  toolbar?: React.ElementType;
28
+ footer?: React.ElementType;
9
29
  };
10
30
  slotProps?: {
11
31
  checkbox?: Partial<{
@@ -15,8 +35,12 @@ declare function DataTable<T extends Record<string, unknown>>(props: {
15
35
  toolbar?: Partial<{
16
36
  [key: string]: any;
17
37
  }>;
38
+ background?: Partial<{
39
+ [key: string]: any;
40
+ }>;
18
41
  };
19
- } & ComponentProps<typeof Table> & Pick<ComponentProps<typeof TableHead>, "headCells"> & Pick<ComponentProps<typeof TableBody>, "cellOrder">): React.JSX.Element;
42
+ } & ComponentProps<typeof Table> & Pick<ComponentProps<typeof TableHead>, "headCells"> & Pick<ComponentProps<typeof TableBody>, "cellOrder">;
43
+ declare function DataTable<T extends Record<string, unknown>>(props: DataTableProps<T>): React.JSX.Element;
20
44
  declare namespace DataTable {
21
45
  var displayName: string;
22
46
  }
@@ -20,13 +20,110 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import React, { useMemo } from "react";
23
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
24
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
25
+ if (ar || !(i in from)) {
26
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
27
+ ar[i] = from[i];
28
+ }
29
+ }
30
+ return to.concat(ar || Array.prototype.slice.call(from));
31
+ };
32
+ import React, { useCallback, useEffect, useMemo, useState, } from "react";
24
33
  import Sheet from "../Sheet";
25
34
  import { Table, TableHead } from "../Table";
26
35
  import Checkbox from "../Checkbox";
36
+ import Box from "../Box";
37
+ import Stack from "../Stack";
38
+ import Typography from "../Typography";
39
+ import Button from "../Button";
40
+ function TablePagination(props) {
41
+ // prop destruction
42
+ var page = props.page, rowsPerPage = props.rowsPerPage, totalRows = props.totalRows, onPageChange = props.onPageChange;
43
+ // lib hooks
44
+ // state, ref, querystring hooks
45
+ // form hooks
46
+ // query hooks
47
+ // calculated values
48
+ var firstPage = 1;
49
+ var lastPage = Math.ceil(totalRows / rowsPerPage);
50
+ var beforePages = [page - 2, page - 1].filter(function (p) { return p > 1; });
51
+ var afterPages = [page + 1, page + 2].filter(function (p) { return p <= lastPage - 1; });
52
+ var isMoreAfterPages = lastPage > 1 && page < lastPage - 3;
53
+ var isMoreBeforePages = lastPage > 1 && page > 4;
54
+ // effects
55
+ // handlers
56
+ return (React.createElement(Stack, { direction: "row", spacing: 1, sx: {
57
+ pt: 1,
58
+ pb: 1,
59
+ }, justifyContent: "end", alignItems: "center" },
60
+ React.createElement(Stack, { direction: "row", spacing: 0.5, alignItems: "center" },
61
+ React.createElement(Button, { size: "sm", variant: "plain", color: "neutral", onClick: function () { return onPageChange(page - 1); }, disabled: page === firstPage, "aria-label": "Previous page" }, "<"),
62
+ page !== firstPage && (React.createElement(Button, { size: "sm", variant: "plain", color: "neutral", onClick: function () { return onPageChange(firstPage); } }, firstPage)),
63
+ isMoreBeforePages && (React.createElement(Button, { size: "sm", variant: "plain", color: "neutral", onClick: function () { return onPageChange(page - 3); } }, "...")),
64
+ beforePages.map(function (p) { return (React.createElement(Button, { key: p, size: "sm", variant: "plain", color: "neutral", onClick: function () { return onPageChange(p); } }, p)); }),
65
+ React.createElement(Button, { variant: "soft", size: "sm" }, page),
66
+ afterPages.map(function (p) { return (React.createElement(Button, { key: p, size: "sm", variant: "plain", color: "neutral", onClick: function () { return onPageChange(p); } }, p)); }),
67
+ isMoreAfterPages && (React.createElement(Button, { size: "sm", variant: "plain", color: "neutral", onClick: function () { return onPageChange(page + 3); } }, "...")),
68
+ page !== lastPage && (React.createElement(Button, { size: "sm", variant: "plain", color: "neutral", onClick: function () { return onPageChange(lastPage); } }, lastPage)),
69
+ React.createElement(Button, { size: "sm", variant: "plain", color: "neutral", onClick: function () { return onPageChange(page + 1); }, disabled: page === lastPage, "aria-label": "Next page" }, ">"))));
70
+ }
27
71
  function useDataTableRenderer(_a) {
28
- var data = _a.data, cellOrder = _a.cellOrder, headCells = _a.headCells;
72
+ var data = _a.data, cellOrder = _a.cellOrder, headCells = _a.headCells, totalRowsProp = _a.totalRows, _b = _a.page, pageProp = _b === void 0 ? 1 : _b, onPageChange = _a.onPageChange, rowsPerPage = _a.rowsPerPage, _c = _a.selectionModel, selectionModel = _c === void 0 ? [] : _c, onSelectionModelChange = _a.onSelectionModelChange, onCheckboxChange = _a.onCheckboxChange;
73
+ var _d = useState(pageProp), page = _d[0], setPage = _d[1];
74
+ 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]);
78
+ var isAllSelected = useMemo(function () {
79
+ return dataInPage.length > 0 &&
80
+ dataInPage.every(function (_, i) {
81
+ return selectedModelSet.has("".concat(i + (page - 1) * rowsPerPage));
82
+ });
83
+ }, [dataInPage, selectedModelSet, page, rowsPerPage]);
84
+ var totalRows = totalRowsProp || data.length;
85
+ var isTotalSelected = useMemo(function () { return totalRows > 0 && selectionModel.length === totalRows; }, [selectionModel, totalRows]);
86
+ var handlePageChange = useCallback(function (newPage) {
87
+ setPage(newPage);
88
+ onPageChange === null || onPageChange === void 0 ? void 0 : onPageChange(newPage);
89
+ }, [onPageChange]);
90
+ useEffect(function () {
91
+ handlePageChange(1);
92
+ }, [totalRows]);
93
+ useEffect(function () {
94
+ if (page > Math.ceil(totalRows / rowsPerPage)) {
95
+ handlePageChange(Math.ceil(totalRows / rowsPerPage));
96
+ }
97
+ }, [totalRows, rowsPerPage]);
98
+ useEffect(function () {
99
+ onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange([]);
100
+ }, [page]);
29
101
  return {
102
+ totalRows: totalRows,
103
+ page: page,
104
+ onPageChange: handlePageChange,
105
+ dataInPage: dataInPage,
106
+ isAllSelected: isAllSelected, // all rows are selected on this page
107
+ isTotalSelected: isTotalSelected,
108
+ isSelectedRow: useCallback(function (model) { return selectedModelSet.has(model); }, [selectedModelSet]),
109
+ onAllCheckboxChange: useCallback(function () {
110
+ onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(isAllSelected
111
+ ? []
112
+ : dataInPage.map(function (_, i) { return "".concat(i + (page - 1) * rowsPerPage); }));
113
+ onCheckboxChange === null || onCheckboxChange === void 0 ? void 0 : onCheckboxChange(null, '');
114
+ }, [isAllSelected, dataInPage, onSelectionModelChange]),
115
+ onCheckboxChange: useCallback(function (event, selectedModel) {
116
+ if (selectedModelSet.has(selectedModel)) {
117
+ var newSelectionModel = selectionModel.filter(function (model) { return model !== selectedModel; });
118
+ onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel);
119
+ onCheckboxChange === null || onCheckboxChange === void 0 ? void 0 : onCheckboxChange(event, selectedModel);
120
+ }
121
+ else {
122
+ var newSelectionModel = __spreadArray(__spreadArray([], selectionModel, true), [selectedModel], false);
123
+ onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel);
124
+ onCheckboxChange === null || onCheckboxChange === void 0 ? void 0 : onCheckboxChange(event, selectedModel);
125
+ }
126
+ }, [selectionModel, onSelectionModelChange]),
30
127
  renderCellOrder: useMemo(function () { return cellOrder || Object.keys(data[0] || {}); }, [data, cellOrder]),
31
128
  renderHeadCells: useMemo(function () {
32
129
  return headCells ||
@@ -35,59 +132,90 @@ function useDataTableRenderer(_a) {
35
132
  label: key,
36
133
  }); });
37
134
  }, [data, headCells]),
135
+ onTotalSelect: useCallback(function () {
136
+ onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(isTotalSelected ? [] : data.map(function (_, i) { return "".concat(i); }));
137
+ }, [isTotalSelected, data, onSelectionModelChange]),
38
138
  };
39
139
  }
40
140
  function DataTable(props) {
41
141
  // prop destruction
42
- var data = props.data, showCheckbox = props.showCheckbox, headCells = props.headCells, cellOrder = props.cellOrder, _a = props.slots, _b = _a === void 0 ? {} : _a, _c = _b.checkbox, RenderCheckbox = _c === void 0 ? Checkbox : _c, Toolbar = _b.toolbar, _d = props.slotProps, _e = _d === void 0 ? {} : _d, _f = _e.checkbox, checkboxProps = _f === void 0 ? {} : _f, toolbarProps = _e.toolbar, innerProps = __rest(props, ["data", "showCheckbox", "headCells", "cellOrder", "slots", "slotProps"]);
142
+ var data = props.data, showCheckbox = props.showCheckbox, headCells = props.headCells, cellOrder = props.cellOrder, selectionModel = props.selectionModel, onSelectionModelChange = props.onSelectionModelChange, _ = props.totalRows, // totalRows is used in useDataTableRenderer
143
+ _a = props.rowsPerPage, // totalRows is used in useDataTableRenderer
144
+ rowsPerPage = _a === void 0 ? 20 : _a, _page = props.page, // page is used in useDataTableRenderer
145
+ _onPageChange = props.onPageChange, // onPageChange is used in useDataTableRenderer
146
+ _onCheckboxChange = props.onCheckboxChange, // onCheckboxChange is used in useDataTableRenderer
147
+ _b = props.slots, // onCheckboxChange is used in useDataTableRenderer
148
+ _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"]);
43
149
  // lib hooks
44
- var _g = useDataTableRenderer({
45
- data: data,
46
- cellOrder: cellOrder,
47
- headCells: headCells,
48
- }), renderCellOrder = _g.renderCellOrder, renderHeadCells = _g.renderHeadCells;
150
+ var _j = useDataTableRenderer(__assign(__assign({}, props), { rowsPerPage: rowsPerPage })), renderCellOrder = _j.renderCellOrder, renderHeadCells = _j.renderHeadCells, isAllSelected = _j.isAllSelected, isSelectedRow = _j.isSelectedRow, onAllCheckboxChange = _j.onAllCheckboxChange, onCheckboxChange = _j.onCheckboxChange, totalRows = _j.totalRows, page = _j.page, onPageChange = _j.onPageChange, dataInPage = _j.dataInPage, isTotalSelected = _j.isTotalSelected, onTotalSelect = _j.onTotalSelect;
49
151
  // state, ref, querystring hooks
50
152
  // form hooks
51
153
  // query hooks
52
154
  // calculated values
53
155
  // effects
54
156
  // handlers
55
- return (React.createElement(Sheet, { variant: "outlined", sx: {
56
- overflow: "auto",
57
- width: "100%",
58
- boxShadow: "sm",
59
- borderRadius: "sm",
60
- } },
61
- Toolbar && React.createElement(Toolbar, __assign({}, (toolbarProps || {}))),
62
- React.createElement(Table, __assign({ sx: [
63
- showCheckbox
64
- ? {
65
- "& tr > *:first-of-type": {
66
- position: "sticky",
67
- left: 0,
68
- boxShadow: "1px 0 var(--TableCell-borderColor)",
69
- bgcolor: "background.surface",
157
+ return (React.createElement(Box, null,
158
+ React.createElement(Stack, { direction: "row", sx: {
159
+ pt: 1,
160
+ pb: 1,
161
+ }, justifyContent: "space-between", alignItems: "center" },
162
+ React.createElement(Stack, { direction: "row", spacing: 1 },
163
+ !isAllSelected && (React.createElement(Typography, { level: "body-xs" },
164
+ (selectionModel === null || selectionModel === void 0 ? void 0 : selectionModel.length) || 0,
165
+ " items selected")),
166
+ isAllSelected && !isTotalSelected && (React.createElement(Stack, { direction: "row", spacing: 1, alignItems: "center" },
167
+ React.createElement(Typography, { level: "body-xs" },
168
+ "All ", selectionModel === null || selectionModel === void 0 ? void 0 :
169
+ selectionModel.length,
170
+ " items on this page are selected."),
171
+ React.createElement(Button, { size: "sm", variant: "plain", onClick: onTotalSelect },
172
+ "Select all ",
173
+ data.length,
174
+ " items"))),
175
+ isTotalSelected && (React.createElement(Stack, { direction: "row", spacing: 1, alignItems: "center" },
176
+ React.createElement(Typography, { level: "body-xs" },
177
+ "All ",
178
+ data.length,
179
+ " items are selected."),
180
+ React.createElement(Button, { size: "sm", variant: "plain", color: "danger", onClick: onTotalSelect }, "Cancel")))),
181
+ Toolbar && React.createElement(Toolbar, __assign({}, (toolbarProps || {})))),
182
+ React.createElement(Sheet, __assign({ variant: "outlined", sx: {
183
+ overflow: "auto",
184
+ width: "100%",
185
+ boxShadow: "sm",
186
+ borderRadius: "sm",
187
+ } }, backgroundProps),
188
+ React.createElement(Table, __assign({ sx: [
189
+ {
190
+ // "--TableCell-headBackground": "transparent",
191
+ "--TableCell-selectedBackground": function (theme) {
192
+ return theme.vars.palette.neutral.plainActiveBg;
70
193
  },
71
- }
72
- : {},
73
- {
74
- "--TableCell-headBackground": "transparent",
75
- "--TableCell-selectedBackground": function (theme) {
76
- return theme.vars.palette.success.softBg;
77
194
  },
78
- },
79
- ] }, innerProps),
80
- React.createElement(TableHead, { showCheckbox: showCheckbox, headCells: renderHeadCells || [] }),
81
- React.createElement("tbody", null, data.map(function (row, rowIndex) { return (React.createElement("tr", { key: rowIndex },
82
- showCheckbox && (React.createElement("td", { style: {
83
- textAlign: "center",
84
- } },
85
- React.createElement(RenderCheckbox
86
- // onChange={(event: any) =>
87
- // onCheckboxChange?.(event, rowIndex)
88
- // }
89
- , __assign({}, checkboxProps)))),
90
- renderCellOrder.map(function (cellKey) { return (React.createElement("td", { key: cellKey }, row[cellKey])); }))); })))));
195
+ ] }, innerProps),
196
+ React.createElement(TableHead, { showCheckbox: showCheckbox, headCells: renderHeadCells || [], onCheckboxChange: onAllCheckboxChange, slotProps: {
197
+ checkbox: __assign({ checked: isAllSelected, indeterminate: (selectionModel || []).length > 0 && !isAllSelected }, checkboxProps),
198
+ } }),
199
+ React.createElement("tbody", null, dataInPage.map(function (row, rowIndex) {
200
+ var rowId = "".concat(rowIndex + (page - 1) * rowsPerPage);
201
+ return (React.createElement("tr", { key: rowId, role: showCheckbox ? "checkbox" : undefined, tabIndex: showCheckbox ? -1 : undefined, onClick: showCheckbox
202
+ ? function (e) { return onCheckboxChange(e, rowId); }
203
+ : undefined, "aria-checked": showCheckbox ? isSelectedRow(rowId) : undefined, style: showCheckbox && isSelectedRow(rowId)
204
+ ? {
205
+ "--TableCell-dataBackground": "var(--TableCell-selectedBackground)",
206
+ "--TableCell-headBackground": "var(--TableCell-selectedBackground)",
207
+ }
208
+ : {
209
+ "--TableCell-headBackground": "transparent",
210
+ } },
211
+ showCheckbox && (React.createElement("th", { scope: "row", style: {
212
+ textAlign: "center",
213
+ } },
214
+ React.createElement(RenderCheckbox, __assign({ onChange: function (e) { return onCheckboxChange(e, rowId); }, checked: isSelectedRow(rowId) }, checkboxProps)))),
215
+ renderCellOrder.map(function (cellKey) { return (React.createElement("td", { key: cellKey }, row[cellKey])); })));
216
+ })),
217
+ Footer && React.createElement(Footer, null))),
218
+ React.createElement(TablePagination, { page: page, rowsPerPage: rowsPerPage, totalRows: totalRows, onPageChange: onPageChange, onRowsPerPageChange: function () { } })));
91
219
  }
92
220
  export { DataTable };
93
221
  DataTable.displayName = "DataTable";
@@ -7,5 +7,5 @@ declare const DialogTitle: import("framer-motion").CustomDomComponent<{
7
7
  variant?: import("@mui/types").OverridableStringUnion<import("@mui/joy").VariantProp, import("@mui/joy").DialogTitlePropsVariantOverrides> | undefined;
8
8
  } & import("@mui/joy").DialogTitleSlotsAndSlotProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
9
9
  ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
10
- }, "children" | "color" | "sx" | "variant" | "level" | keyof import("@mui/joy").DialogTitleSlotsAndSlotProps>>;
10
+ }, "children" | "color" | "variant" | "sx" | "level" | keyof import("@mui/joy").DialogTitleSlotsAndSlotProps>>;
11
11
  export { DialogTitle };
@@ -3,5 +3,5 @@ declare const Grid: import("framer-motion").CustomDomComponent<import("@mui/syst
3
3
  sx?: import("@mui/joy/styles/types").SxProps | undefined;
4
4
  } & import("@mui/joy/styles/types").SystemProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
5
5
  ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
6
- }, ("p" | "color" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "sx" | keyof import("@mui/system").GridBaseProps | keyof import("@mui/joy").GridSlotsAndSlotProps>>;
6
+ }, "sx" | ("p" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | keyof import("@mui/system").GridBaseProps | keyof import("@mui/joy").GridSlotsAndSlotProps>>;
7
7
  export { Grid };
@@ -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: "backdropClick" | "escapeKeyDown" | "closeClick") => void) | undefined;
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;
@@ -19,7 +19,7 @@ declare const ModalDialog: import("framer-motion").CustomDomComponent<{
19
19
  variant?: import("@mui/types").OverridableStringUnion<import("@mui/joy").VariantProp, import("@mui/joy").ModalDialogPropsVariantOverrides> | undefined;
20
20
  } & import("@mui/joy").ModalDialogSlotsAndSlotProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
21
21
  ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
22
- }, "children" | "layout" | "color" | "maxWidth" | "minWidth" | "sx" | "size" | "variant" | "invertedColors" | "orientation" | keyof import("@mui/joy").ModalDialogSlotsAndSlotProps>>;
22
+ }, "children" | "layout" | "color" | "maxWidth" | "minWidth" | "variant" | "sx" | "size" | "invertedColors" | "orientation" | keyof import("@mui/joy").ModalDialogSlotsAndSlotProps>>;
23
23
  export { ModalDialog };
24
24
  declare const ModalClose: import("framer-motion").CustomDomComponent<{
25
25
  color?: import("@mui/types").OverridableStringUnion<import("@mui/joy").ColorPaletteProp, import("@mui/joy").ModalClosePropsColorOverrides> | undefined;
@@ -28,7 +28,7 @@ declare const ModalClose: import("framer-motion").CustomDomComponent<{
28
28
  variant?: import("@mui/types").OverridableStringUnion<import("@mui/joy").VariantProp, import("@mui/joy").ModalClosePropsVariantOverrides> | undefined;
29
29
  } & import("@mui/joy").ModalCloseSlotsAndSlotProps & Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
30
30
  ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
31
- }, "color" | "sx" | "size" | "variant" | keyof import("@mui/joy").ModalCloseSlotsAndSlotProps>>;
31
+ }, "color" | "variant" | "sx" | "size" | keyof import("@mui/joy").ModalCloseSlotsAndSlotProps>>;
32
32
  export { ModalClose };
33
33
  declare const ModalOverflow: import("framer-motion").CustomDomComponent<{
34
34
  sx?: import("@mui/joy/styles/types").SxProps | undefined;
@@ -14,7 +14,7 @@ declare const Radio: import("framer-motion").CustomDomComponent<import("@mui/bas
14
14
  value?: unknown;
15
15
  } & import("@mui/joy").RadioSlotsAndSlotProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
16
16
  ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
17
- }, "label" | "className" | "color" | "overlay" | "sx" | "size" | "variant" | "name" | "value" | keyof import("@mui/base").UseSwitchParameters | "checkedIcon" | "disableIcon" | "uncheckedIcon" | keyof import("@mui/joy").RadioSlotsAndSlotProps>>;
17
+ }, "label" | "color" | "overlay" | "className" | "variant" | "sx" | "size" | "name" | "value" | keyof import("@mui/base").UseSwitchParameters | "checkedIcon" | "disableIcon" | "uncheckedIcon" | keyof import("@mui/joy").RadioSlotsAndSlotProps>>;
18
18
  export { Radio };
19
19
  declare const RadioGroup: import("framer-motion").CustomDomComponent<{
20
20
  className?: string | undefined;
@@ -32,5 +32,5 @@ declare const RadioGroup: import("framer-motion").CustomDomComponent<{
32
32
  variant?: import("@mui/types").OverridableStringUnion<import("@mui/joy").VariantProp, import("@mui/joy").RadioPropsVariantOverrides> | undefined;
33
33
  } & import("@mui/joy").RadioGroupSlotsAndSlotProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
34
34
  ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
35
- }, "defaultValue" | "className" | "color" | "onChange" | "overlay" | "component" | "sx" | "size" | "variant" | "name" | "value" | "disableIcon" | "orientation" | keyof import("@mui/joy").RadioGroupSlotsAndSlotProps>>;
35
+ }, "color" | "overlay" | "defaultValue" | "className" | "onChange" | "variant" | "sx" | "size" | "component" | "name" | "value" | "disableIcon" | "orientation" | keyof import("@mui/joy").RadioGroupSlotsAndSlotProps>>;
36
36
  export { RadioGroup };
@@ -22,5 +22,5 @@ declare const Option: import("framer-motion").CustomDomComponent<{
22
22
  sx?: import("@mui/joy/styles/types").SxProps | undefined;
23
23
  } & import("@mui/joy").OptionSlotsAndSlotProps & Omit<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
24
24
  ref?: ((instance: HTMLLIElement | null) => void) | React.RefObject<HTMLLIElement> | null | undefined;
25
- }, "label" | "children" | "color" | "sx" | "disabled" | "variant" | "value" | keyof import("@mui/joy").OptionSlotsAndSlotProps>>;
25
+ }, "label" | "children" | "color" | "variant" | "sx" | "disabled" | "value" | keyof import("@mui/joy").OptionSlotsAndSlotProps>>;
26
26
  export { Option };
@@ -7,5 +7,5 @@ declare const Sheet: import("framer-motion").CustomDomComponent<{
7
7
  variant?: import("@mui/types").OverridableStringUnion<import("@mui/joy").VariantProp, import("@mui/joy").SheetPropsVariantOverrides> | undefined;
8
8
  } & import("@mui/joy").SheetSlotsAndSlotProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
9
9
  ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
10
- }, "children" | "color" | "sx" | "variant" | "invertedColors" | keyof import("@mui/joy").SheetSlotsAndSlotProps>>;
10
+ }, "children" | "color" | "variant" | "sx" | "invertedColors" | keyof import("@mui/joy").SheetSlotsAndSlotProps>>;
11
11
  export { Sheet };
@@ -8,5 +8,5 @@ declare const Stack: import("framer-motion").CustomDomComponent<{
8
8
  sx?: import("@mui/joy/styles/types").SxProps | undefined;
9
9
  } & import("@mui/joy").StackSlotsAndSlotProps & import("@mui/joy/styles/types").SystemProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
10
10
  ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
11
- }, "children" | "direction" | ("p" | "color" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "sx" | "spacing" | "divider" | "useFlexGap" | keyof import("@mui/joy").StackSlotsAndSlotProps>>;
11
+ }, "children" | "direction" | "sx" | ("p" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "spacing" | "divider" | "useFlexGap" | keyof import("@mui/joy").StackSlotsAndSlotProps>>;
12
12
  export { Stack };