@ceed/cds 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DataTable/components.d.ts +38 -0
- package/dist/components/DataTable/hooks.d.ts +56 -0
- package/dist/components/DataTable/styled.d.ts +281 -0
- package/dist/components/DataTable/types.d.ts +13 -3
- package/dist/components/DataTable/utils.d.ts +16 -0
- package/dist/index.cjs +1557 -1520
- package/dist/index.js +1122 -1081
- package/framer/index.js +39 -39
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -152,7 +152,7 @@ import {
|
|
|
152
152
|
stepperClasses,
|
|
153
153
|
Skeleton as Skeleton2,
|
|
154
154
|
skeletonClasses,
|
|
155
|
-
styled as
|
|
155
|
+
styled as styled30
|
|
156
156
|
} from "@mui/joy";
|
|
157
157
|
|
|
158
158
|
// src/components/Accordions/Accordions.tsx
|
|
@@ -1846,249 +1846,433 @@ var CurrencyInput = React15.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
1846
1846
|
var CurrencyInput_default = CurrencyInput;
|
|
1847
1847
|
|
|
1848
1848
|
// src/components/DataTable/DataTable.tsx
|
|
1849
|
-
import
|
|
1850
|
-
useCallback as
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
useRef as useRef4,
|
|
1854
|
-
useState as useState6,
|
|
1849
|
+
import React25, {
|
|
1850
|
+
useCallback as useCallback11,
|
|
1851
|
+
useMemo as useMemo10,
|
|
1852
|
+
useRef as useRef6,
|
|
1855
1853
|
useId,
|
|
1856
1854
|
forwardRef as forwardRef7,
|
|
1857
1855
|
useImperativeHandle as useImperativeHandle2,
|
|
1858
|
-
createElement,
|
|
1859
|
-
memo,
|
|
1860
|
-
useLayoutEffect,
|
|
1861
1856
|
Fragment as Fragment2
|
|
1862
1857
|
} from "react";
|
|
1863
1858
|
import { useVirtualizer as useVirtualizer2 } from "@tanstack/react-virtual";
|
|
1864
|
-
import { styled as styled12, LinearProgress, Link, useTheme, buttonClasses, iconButtonClasses } from "@mui/joy";
|
|
1865
|
-
import SortIcon from "@mui/icons-material/ArrowUpwardRounded";
|
|
1866
|
-
|
|
1867
|
-
// src/components/Sheet/Sheet.tsx
|
|
1868
|
-
import { Sheet as JoySheet } from "@mui/joy";
|
|
1869
|
-
import { motion as motion16 } from "framer-motion";
|
|
1870
|
-
var MotionSheet = motion16(JoySheet);
|
|
1871
|
-
var Sheet = MotionSheet;
|
|
1872
|
-
Sheet.displayName = "Sheet";
|
|
1873
1859
|
|
|
1874
|
-
// src/components/
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
headCells,
|
|
1888
|
-
showCheckbox,
|
|
1889
|
-
onCheckboxChange,
|
|
1890
|
-
slots: { checkbox: RenderCheckbox = Checkbox_default } = {},
|
|
1891
|
-
slotProps: { checkbox: checkboxProps = {} } = {}
|
|
1892
|
-
} = props;
|
|
1893
|
-
return /* @__PURE__ */ React16.createElement("thead", null, /* @__PURE__ */ React16.createElement("tr", null, showCheckbox && /* @__PURE__ */ React16.createElement(
|
|
1894
|
-
"th",
|
|
1895
|
-
{
|
|
1896
|
-
style: {
|
|
1897
|
-
width: "40px",
|
|
1898
|
-
textAlign: "center"
|
|
1899
|
-
}
|
|
1900
|
-
},
|
|
1901
|
-
/* @__PURE__ */ React16.createElement(RenderCheckbox, { onChange: onCheckboxChange, ...checkboxProps })
|
|
1902
|
-
), headCells.map((headCell) => /* @__PURE__ */ React16.createElement(
|
|
1903
|
-
"th",
|
|
1904
|
-
{
|
|
1905
|
-
key: headCell.label,
|
|
1906
|
-
style: {
|
|
1907
|
-
width: headCell.width,
|
|
1908
|
-
minWidth: headCell.minWidth,
|
|
1909
|
-
maxWidth: headCell.maxWidth,
|
|
1910
|
-
textAlign: headCell.numeric ? "right" : "left"
|
|
1911
|
-
}
|
|
1912
|
-
},
|
|
1913
|
-
headCell.label
|
|
1914
|
-
))));
|
|
1860
|
+
// src/components/DataTable/utils.ts
|
|
1861
|
+
function extractFieldsFromGroupingModel(items) {
|
|
1862
|
+
const fields = /* @__PURE__ */ new Set();
|
|
1863
|
+
for (const item of items) {
|
|
1864
|
+
if ("groupId" in item) {
|
|
1865
|
+
const children = Array.isArray(item.children) ? item.children : [item.children];
|
|
1866
|
+
const childFields = extractFieldsFromGroupingModel(children);
|
|
1867
|
+
childFields.forEach((field) => fields.add(field));
|
|
1868
|
+
} else {
|
|
1869
|
+
fields.add(item.field);
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
return fields;
|
|
1915
1873
|
}
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
const
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
"td",
|
|
1929
|
-
{
|
|
1930
|
-
style: {
|
|
1931
|
-
textAlign: "center"
|
|
1932
|
-
}
|
|
1933
|
-
},
|
|
1934
|
-
/* @__PURE__ */ React16.createElement(RenderCheckbox, { onChange: (event) => onCheckboxChange?.(event, rowIndex), ...checkboxProps })
|
|
1935
|
-
), cellOrder.map((cellKey) => /* @__PURE__ */ React16.createElement(
|
|
1936
|
-
"td",
|
|
1937
|
-
{
|
|
1938
|
-
key: cellKey,
|
|
1939
|
-
style: {
|
|
1940
|
-
textAlign: rowOptions?.[cellKey]?.numeric ? "right" : "left"
|
|
1874
|
+
function reorderColumnsByGroupingModel(columns, columnGroupingModel) {
|
|
1875
|
+
const fieldsInGroupingModel = extractFieldsFromGroupingModel(columnGroupingModel);
|
|
1876
|
+
const orderedFields = [];
|
|
1877
|
+
function collectFieldsInOrder(items) {
|
|
1878
|
+
for (const item of items) {
|
|
1879
|
+
if ("groupId" in item) {
|
|
1880
|
+
const children = Array.isArray(item.children) ? item.children : [item.children];
|
|
1881
|
+
collectFieldsInOrder(children);
|
|
1882
|
+
} else {
|
|
1883
|
+
if (!orderedFields.includes(item.field)) {
|
|
1884
|
+
orderedFields.push(item.field);
|
|
1885
|
+
}
|
|
1941
1886
|
}
|
|
1942
|
-
},
|
|
1943
|
-
row[cellKey]
|
|
1944
|
-
)))));
|
|
1945
|
-
}
|
|
1946
|
-
TableBody.displayName = "TableBody";
|
|
1947
|
-
|
|
1948
|
-
// src/components/DatePicker/DatePicker.tsx
|
|
1949
|
-
import React17, { forwardRef as forwardRef6, useCallback as useCallback7, useEffect as useEffect3, useImperativeHandle, useRef as useRef3, useState as useState5 } from "react";
|
|
1950
|
-
import { IMaskInput, IMask } from "react-imask";
|
|
1951
|
-
import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
|
|
1952
|
-
import { styled as styled9, useThemeProps as useThemeProps4 } from "@mui/joy";
|
|
1953
|
-
import { FocusTrap, ClickAwayListener, Popper as Popper2 } from "@mui/base";
|
|
1954
|
-
|
|
1955
|
-
// src/components/DialogActions/DialogActions.tsx
|
|
1956
|
-
import { DialogActions as JoyDialogActions, styled as styled8 } from "@mui/joy";
|
|
1957
|
-
import { motion as motion17 } from "framer-motion";
|
|
1958
|
-
var MotionDialogActions = motion17(JoyDialogActions);
|
|
1959
|
-
var StyledDialogActions = styled8(MotionDialogActions)(({ theme }) => ({
|
|
1960
|
-
padding: theme.spacing(2),
|
|
1961
|
-
gap: theme.spacing(2),
|
|
1962
|
-
flexDirection: "row",
|
|
1963
|
-
justifyContent: "flex-end"
|
|
1964
|
-
}));
|
|
1965
|
-
var DialogActions = StyledDialogActions;
|
|
1966
|
-
DialogActions.displayName = "DialogActions";
|
|
1967
|
-
|
|
1968
|
-
// src/components/DialogActions/index.ts
|
|
1969
|
-
var DialogActions_default = DialogActions;
|
|
1970
|
-
|
|
1971
|
-
// src/components/DatePicker/DatePicker.tsx
|
|
1972
|
-
var CalendarButton = styled9(IconButton_default, {
|
|
1973
|
-
name: "DatePicker",
|
|
1974
|
-
slot: "calendarButton"
|
|
1975
|
-
})(({ theme }) => ({
|
|
1976
|
-
"&:focus": {
|
|
1977
|
-
"--Icon-color": "currentColor",
|
|
1978
|
-
outlineOffset: `${theme.getCssVar("focus-thickness")}`,
|
|
1979
|
-
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar("palette-focusVisible")}`
|
|
1980
|
-
}
|
|
1981
|
-
}));
|
|
1982
|
-
var StyledPopper = styled9(Popper2, {
|
|
1983
|
-
name: "DatePicker",
|
|
1984
|
-
slot: "popper"
|
|
1985
|
-
})(({ theme }) => ({
|
|
1986
|
-
zIndex: theme.zIndex.tooltip
|
|
1987
|
-
}));
|
|
1988
|
-
var CalendarSheet = styled9(Sheet_default, {
|
|
1989
|
-
name: "DatePicker",
|
|
1990
|
-
slot: "sheet",
|
|
1991
|
-
overridesResolver: (props, styles) => styles.root
|
|
1992
|
-
})(({ theme }) => ({
|
|
1993
|
-
width: "264px",
|
|
1994
|
-
boxShadow: theme.shadow.md,
|
|
1995
|
-
borderRadius: theme.radius.md
|
|
1996
|
-
}));
|
|
1997
|
-
var DatePickerRoot = styled9("div", {
|
|
1998
|
-
name: "DatePicker",
|
|
1999
|
-
slot: "root",
|
|
2000
|
-
overridesResolver: (props, styles) => styles.root
|
|
2001
|
-
})({
|
|
2002
|
-
width: "100%"
|
|
2003
|
-
});
|
|
2004
|
-
var validValueFormat = (value, format) => {
|
|
2005
|
-
try {
|
|
2006
|
-
const parsedValue = parseDate(value, format);
|
|
2007
|
-
if (parsedValue.toString() === "Invalid Date") {
|
|
2008
|
-
return false;
|
|
2009
1887
|
}
|
|
2010
|
-
|
|
2011
|
-
|
|
1888
|
+
}
|
|
1889
|
+
collectFieldsInOrder(columnGroupingModel);
|
|
1890
|
+
const columnMap = new Map(columns.map((col) => [col.field, col]));
|
|
1891
|
+
const reorderedColumns = [];
|
|
1892
|
+
for (const field of orderedFields) {
|
|
1893
|
+
const column = columnMap.get(field);
|
|
1894
|
+
if (column) {
|
|
1895
|
+
reorderedColumns.push(column);
|
|
2012
1896
|
}
|
|
2013
|
-
const regex = new RegExp(`^${format.replace(/Y/g, "\\d").replace(/M/g, "\\d").replace(/D/g, "\\d")}$`);
|
|
2014
|
-
return regex.test(value);
|
|
2015
|
-
} catch (e) {
|
|
2016
|
-
return false;
|
|
2017
1897
|
}
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
const year = date.getFullYear();
|
|
2023
|
-
if (Number(day) < 10) day = "0" + day;
|
|
2024
|
-
if (Number(month) < 10) month = "0" + month;
|
|
2025
|
-
return format.replace(/YYYY/g, year.toString()).replace(/MM/g, month).replace(/DD/g, day);
|
|
2026
|
-
};
|
|
2027
|
-
function parseDate(dateString, format) {
|
|
2028
|
-
const formatParts = format.split(/[-./\s]/);
|
|
2029
|
-
const dateParts = dateString.split(/[-./\s]/);
|
|
2030
|
-
if (formatParts.length !== dateParts.length) {
|
|
2031
|
-
throw new Error("Invalid date string or format");
|
|
1898
|
+
for (const column of columns) {
|
|
1899
|
+
if (!fieldsInGroupingModel.has(column.field)) {
|
|
1900
|
+
reorderedColumns.push(column);
|
|
1901
|
+
}
|
|
2032
1902
|
}
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
1903
|
+
return reorderedColumns;
|
|
1904
|
+
}
|
|
1905
|
+
function flattenColumnGroups(items, groupPath = [], columnIndex = { current: 0 }) {
|
|
1906
|
+
const result = [];
|
|
1907
|
+
for (const item of items) {
|
|
1908
|
+
if ("groupId" in item) {
|
|
1909
|
+
const newPath = [...groupPath, item.groupId];
|
|
1910
|
+
const children = Array.isArray(item.children) ? item.children : [item.children];
|
|
1911
|
+
result.push(...flattenColumnGroups(children, newPath, columnIndex));
|
|
1912
|
+
} else {
|
|
1913
|
+
result.push({
|
|
1914
|
+
...item,
|
|
1915
|
+
groupPath,
|
|
1916
|
+
columnIndex: columnIndex.current++
|
|
1917
|
+
});
|
|
2046
1918
|
}
|
|
2047
1919
|
}
|
|
2048
|
-
const result = new Date(year, month, day);
|
|
2049
1920
|
return result;
|
|
2050
1921
|
}
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
const
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
}
|
|
2091
|
-
|
|
1922
|
+
function calculateColumnGroups(columnGroupingModel, columns) {
|
|
1923
|
+
const fieldsInGroupingModel = extractFieldsFromGroupingModel(columnGroupingModel);
|
|
1924
|
+
const flattenedColumns = flattenColumnGroups(columnGroupingModel);
|
|
1925
|
+
const columnIndexMap = new Map(flattenedColumns.map((col) => [col.field, col.columnIndex]));
|
|
1926
|
+
const processedGroups = /* @__PURE__ */ new Map();
|
|
1927
|
+
const groupsByLevel = [];
|
|
1928
|
+
let maxLevel = 0;
|
|
1929
|
+
function processGroup(items, level, parentGroupId) {
|
|
1930
|
+
let minIndex = Infinity;
|
|
1931
|
+
let maxIndex = -Infinity;
|
|
1932
|
+
for (const item of items) {
|
|
1933
|
+
if ("groupId" in item) {
|
|
1934
|
+
const groupKey = parentGroupId ? `${parentGroupId}.${item.groupId}` : item.groupId;
|
|
1935
|
+
if (!processedGroups.has(groupKey)) {
|
|
1936
|
+
const children = Array.isArray(item.children) ? item.children : [item.children];
|
|
1937
|
+
const { startIndex, colspan } = processGroup(children, level + 1, groupKey);
|
|
1938
|
+
const group = {
|
|
1939
|
+
groupId: item.groupId,
|
|
1940
|
+
headerName: item.headerName,
|
|
1941
|
+
headerClassName: item.headerClassName,
|
|
1942
|
+
colspan,
|
|
1943
|
+
level,
|
|
1944
|
+
startIndex
|
|
1945
|
+
};
|
|
1946
|
+
processedGroups.set(groupKey, group);
|
|
1947
|
+
if (!groupsByLevel[level]) {
|
|
1948
|
+
groupsByLevel[level] = [];
|
|
1949
|
+
}
|
|
1950
|
+
groupsByLevel[level].push(group);
|
|
1951
|
+
maxLevel = Math.max(maxLevel, level);
|
|
1952
|
+
minIndex = Math.min(minIndex, startIndex);
|
|
1953
|
+
maxIndex = Math.max(maxIndex, startIndex + colspan - 1);
|
|
1954
|
+
}
|
|
1955
|
+
} else {
|
|
1956
|
+
const columnIndex = columnIndexMap.get(item.field);
|
|
1957
|
+
if (columnIndex !== void 0) {
|
|
1958
|
+
minIndex = Math.min(minIndex, columnIndex);
|
|
1959
|
+
maxIndex = Math.max(maxIndex, columnIndex);
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
return {
|
|
1964
|
+
startIndex: minIndex === Infinity ? 0 : minIndex,
|
|
1965
|
+
colspan: maxIndex === -Infinity ? 0 : maxIndex - minIndex + 1
|
|
1966
|
+
};
|
|
1967
|
+
}
|
|
1968
|
+
processGroup(columnGroupingModel, 0);
|
|
1969
|
+
groupsByLevel.forEach((level) => {
|
|
1970
|
+
level.sort((a, b) => a.startIndex - b.startIndex);
|
|
1971
|
+
});
|
|
1972
|
+
return { groups: groupsByLevel, maxLevel, fieldsInGroupingModel };
|
|
1973
|
+
}
|
|
1974
|
+
function getTextAlign(props) {
|
|
1975
|
+
return !props.editMode && ["number", "date", "currency"].includes(props.type || "") ? "end" : "start";
|
|
1976
|
+
}
|
|
1977
|
+
var numberFormatter = (value) => "Intl" in window ? new Intl.NumberFormat().format(value) : value;
|
|
1978
|
+
|
|
1979
|
+
// src/components/DataTable/styled.tsx
|
|
1980
|
+
import React16 from "react";
|
|
1981
|
+
import { styled as styled8, LinearProgress, buttonClasses, iconButtonClasses } from "@mui/joy";
|
|
1982
|
+
import { motion as motion16 } from "framer-motion";
|
|
1983
|
+
import SortIcon from "@mui/icons-material/ArrowUpwardRounded";
|
|
1984
|
+
var EllipsisDiv = styled8("div", {
|
|
1985
|
+
name: "DataTable",
|
|
1986
|
+
slot: "textEllipsis"
|
|
1987
|
+
})({
|
|
1988
|
+
overflow: "hidden",
|
|
1989
|
+
textOverflow: "ellipsis",
|
|
1990
|
+
whiteSpace: "nowrap"
|
|
1991
|
+
});
|
|
1992
|
+
var OverlayWrapper = styled8("tr", {
|
|
1993
|
+
name: "DataTable",
|
|
1994
|
+
slot: "overlayWrapper"
|
|
1995
|
+
})({
|
|
1996
|
+
position: "sticky",
|
|
1997
|
+
top: `calc(var(--unstable_TableCell-height, 32px))`,
|
|
1998
|
+
left: 0,
|
|
1999
|
+
right: 0,
|
|
2000
|
+
zIndex: 1,
|
|
2001
|
+
"& > td": {
|
|
2002
|
+
height: 0,
|
|
2003
|
+
padding: 0,
|
|
2004
|
+
border: "none !important"
|
|
2005
|
+
}
|
|
2006
|
+
});
|
|
2007
|
+
var VirtualizedTableBody = styled8("tbody", {
|
|
2008
|
+
name: "DataTable",
|
|
2009
|
+
slot: "tableBody"
|
|
2010
|
+
})({
|
|
2011
|
+
"&::after": {
|
|
2012
|
+
content: "''",
|
|
2013
|
+
display: "block",
|
|
2014
|
+
height: "0.01em"
|
|
2015
|
+
},
|
|
2016
|
+
[`& .${buttonClasses.root}`]: {
|
|
2017
|
+
"--Button-minHeight": "26px",
|
|
2018
|
+
"--Button-paddingBlock": "0.25rem",
|
|
2019
|
+
lineHeight: 1,
|
|
2020
|
+
marginTop: "-2px",
|
|
2021
|
+
marginBottom: "-2px"
|
|
2022
|
+
},
|
|
2023
|
+
[`& .${iconButtonClasses.root}`]: {
|
|
2024
|
+
"--IconButton-size": "26px",
|
|
2025
|
+
verticalAlign: "middle",
|
|
2026
|
+
marginTop: "-2px",
|
|
2027
|
+
marginBottom: "-2px"
|
|
2028
|
+
}
|
|
2029
|
+
});
|
|
2030
|
+
var StyledTableRow = styled8("tr", {
|
|
2031
|
+
name: "DataTable",
|
|
2032
|
+
slot: "tableRow",
|
|
2033
|
+
shouldForwardProp: (prop) => prop !== "striped"
|
|
2034
|
+
})(({ striped }) => ({
|
|
2035
|
+
...striped && {
|
|
2036
|
+
backgroundColor: "var(--TableRow-stripeBackground, var(--ceed-palette-background-level2))",
|
|
2037
|
+
color: "var(--ceed-palette-text-primary)",
|
|
2038
|
+
"& td": {
|
|
2039
|
+
backgroundColor: "background.surface"
|
|
2040
|
+
}
|
|
2041
|
+
},
|
|
2042
|
+
"&:hover": {
|
|
2043
|
+
backgroundColor: "var(--TableRow-hoverBackground, var(--ceed-palette-background-level3))",
|
|
2044
|
+
"& td": {
|
|
2045
|
+
backgroundColor: "var(--TableRow-hoverBackground, var(--ceed-palette-background-level3))"
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
}));
|
|
2049
|
+
var Asterisk = styled8("span", {
|
|
2050
|
+
name: "DataTable",
|
|
2051
|
+
slot: "headCellAsterisk"
|
|
2052
|
+
})(({ theme }) => ({
|
|
2053
|
+
color: "var(--ceed-palette-danger-500)",
|
|
2054
|
+
marginLeft: theme.spacing(0.5)
|
|
2055
|
+
}));
|
|
2056
|
+
var StyledTh = styled8(motion16.th)(({ theme }) => ({
|
|
2057
|
+
boxShadow: "1px 0 var(--TableCell-borderColor)"
|
|
2058
|
+
}));
|
|
2059
|
+
var StyledTd = styled8("td")(({ theme }) => ({
|
|
2060
|
+
transition: `box-shadow 0.3s`,
|
|
2061
|
+
"&:not(.is-last-left):not(.is-last-right)": {
|
|
2062
|
+
boxShadow: "1px 0 var(--TableCell-borderColor)"
|
|
2063
|
+
},
|
|
2064
|
+
".ScrollableRight &": {
|
|
2065
|
+
"&.is-last-left": {
|
|
2066
|
+
boxShadow: `1px 0 var(--TableCell-borderColor), ${theme.shadow.md}`
|
|
2067
|
+
}
|
|
2068
|
+
},
|
|
2069
|
+
".ScrollableLeft &": {
|
|
2070
|
+
"&.is-last-right": {
|
|
2071
|
+
boxShadow: `1px 0 var(--TableCell-borderColor), ${theme.shadow.md}`
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
}));
|
|
2075
|
+
var MotionSortIcon = motion16(SortIcon);
|
|
2076
|
+
var DefaultLoadingOverlay = () => /* @__PURE__ */ React16.createElement(LinearProgress, { value: 8, variant: "plain" });
|
|
2077
|
+
var Resizer = (ref, targetRef = ref) => /* @__PURE__ */ React16.createElement(
|
|
2078
|
+
Box_default,
|
|
2079
|
+
{
|
|
2080
|
+
sx: {
|
|
2081
|
+
position: "absolute",
|
|
2082
|
+
top: 0,
|
|
2083
|
+
right: 0,
|
|
2084
|
+
bottom: 0,
|
|
2085
|
+
width: "4px",
|
|
2086
|
+
cursor: "col-resize"
|
|
2087
|
+
},
|
|
2088
|
+
onClick: (e) => e.stopPropagation(),
|
|
2089
|
+
onMouseDown: (e) => {
|
|
2090
|
+
const initialX = e.clientX;
|
|
2091
|
+
const initialWidth = ref.current?.getBoundingClientRect().width;
|
|
2092
|
+
const onMouseMove = (e2) => {
|
|
2093
|
+
if (initialWidth && initialX) {
|
|
2094
|
+
ref.current.style.width = `${initialWidth + (e2.clientX - initialX)}px`;
|
|
2095
|
+
targetRef.current.style.width = `${initialWidth + (e2.clientX - initialX)}px`;
|
|
2096
|
+
}
|
|
2097
|
+
};
|
|
2098
|
+
const onMouseUp = () => {
|
|
2099
|
+
document.removeEventListener("mousemove", onMouseMove);
|
|
2100
|
+
document.removeEventListener("mouseup", onMouseUp);
|
|
2101
|
+
};
|
|
2102
|
+
document.addEventListener("mousemove", onMouseMove);
|
|
2103
|
+
document.addEventListener("mouseup", onMouseUp);
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
);
|
|
2107
|
+
|
|
2108
|
+
// src/components/DataTable/components.tsx
|
|
2109
|
+
import React22, {
|
|
2110
|
+
useRef as useRef4,
|
|
2111
|
+
useState as useState6,
|
|
2112
|
+
useLayoutEffect,
|
|
2113
|
+
useMemo as useMemo8,
|
|
2114
|
+
useCallback as useCallback8,
|
|
2115
|
+
useEffect as useEffect4,
|
|
2116
|
+
memo,
|
|
2117
|
+
createElement
|
|
2118
|
+
} from "react";
|
|
2119
|
+
import { styled as styled12, useTheme } from "@mui/joy";
|
|
2120
|
+
import { AnimatePresence as AnimatePresence2 } from "framer-motion";
|
|
2121
|
+
|
|
2122
|
+
// src/components/DatePicker/DatePicker.tsx
|
|
2123
|
+
import React17, { forwardRef as forwardRef6, useCallback as useCallback7, useEffect as useEffect3, useImperativeHandle, useRef as useRef3, useState as useState5 } from "react";
|
|
2124
|
+
import { IMaskInput, IMask } from "react-imask";
|
|
2125
|
+
import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
|
|
2126
|
+
import { styled as styled10, useThemeProps as useThemeProps4 } from "@mui/joy";
|
|
2127
|
+
import { FocusTrap, ClickAwayListener, Popper as Popper2 } from "@mui/base";
|
|
2128
|
+
|
|
2129
|
+
// src/components/Sheet/Sheet.tsx
|
|
2130
|
+
import { Sheet as JoySheet } from "@mui/joy";
|
|
2131
|
+
import { motion as motion17 } from "framer-motion";
|
|
2132
|
+
var MotionSheet = motion17(JoySheet);
|
|
2133
|
+
var Sheet = MotionSheet;
|
|
2134
|
+
Sheet.displayName = "Sheet";
|
|
2135
|
+
|
|
2136
|
+
// src/components/Sheet/index.ts
|
|
2137
|
+
var Sheet_default = Sheet;
|
|
2138
|
+
|
|
2139
|
+
// src/components/DialogActions/DialogActions.tsx
|
|
2140
|
+
import { DialogActions as JoyDialogActions, styled as styled9 } from "@mui/joy";
|
|
2141
|
+
import { motion as motion18 } from "framer-motion";
|
|
2142
|
+
var MotionDialogActions = motion18(JoyDialogActions);
|
|
2143
|
+
var StyledDialogActions = styled9(MotionDialogActions)(({ theme }) => ({
|
|
2144
|
+
padding: theme.spacing(2),
|
|
2145
|
+
gap: theme.spacing(2),
|
|
2146
|
+
flexDirection: "row",
|
|
2147
|
+
justifyContent: "flex-end"
|
|
2148
|
+
}));
|
|
2149
|
+
var DialogActions = StyledDialogActions;
|
|
2150
|
+
DialogActions.displayName = "DialogActions";
|
|
2151
|
+
|
|
2152
|
+
// src/components/DialogActions/index.ts
|
|
2153
|
+
var DialogActions_default = DialogActions;
|
|
2154
|
+
|
|
2155
|
+
// src/components/DatePicker/DatePicker.tsx
|
|
2156
|
+
var CalendarButton = styled10(IconButton_default, {
|
|
2157
|
+
name: "DatePicker",
|
|
2158
|
+
slot: "calendarButton"
|
|
2159
|
+
})(({ theme }) => ({
|
|
2160
|
+
"&:focus": {
|
|
2161
|
+
"--Icon-color": "currentColor",
|
|
2162
|
+
outlineOffset: `${theme.getCssVar("focus-thickness")}`,
|
|
2163
|
+
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar("palette-focusVisible")}`
|
|
2164
|
+
}
|
|
2165
|
+
}));
|
|
2166
|
+
var StyledPopper = styled10(Popper2, {
|
|
2167
|
+
name: "DatePicker",
|
|
2168
|
+
slot: "popper"
|
|
2169
|
+
})(({ theme }) => ({
|
|
2170
|
+
zIndex: theme.zIndex.tooltip
|
|
2171
|
+
}));
|
|
2172
|
+
var CalendarSheet = styled10(Sheet_default, {
|
|
2173
|
+
name: "DatePicker",
|
|
2174
|
+
slot: "sheet",
|
|
2175
|
+
overridesResolver: (props, styles) => styles.root
|
|
2176
|
+
})(({ theme }) => ({
|
|
2177
|
+
width: "264px",
|
|
2178
|
+
boxShadow: theme.shadow.md,
|
|
2179
|
+
borderRadius: theme.radius.md
|
|
2180
|
+
}));
|
|
2181
|
+
var DatePickerRoot = styled10("div", {
|
|
2182
|
+
name: "DatePicker",
|
|
2183
|
+
slot: "root",
|
|
2184
|
+
overridesResolver: (props, styles) => styles.root
|
|
2185
|
+
})({
|
|
2186
|
+
width: "100%"
|
|
2187
|
+
});
|
|
2188
|
+
var validValueFormat = (value, format) => {
|
|
2189
|
+
try {
|
|
2190
|
+
const parsedValue = parseDate(value, format);
|
|
2191
|
+
if (parsedValue.toString() === "Invalid Date") {
|
|
2192
|
+
return false;
|
|
2193
|
+
}
|
|
2194
|
+
if (value !== formatValueString(parsedValue, format)) {
|
|
2195
|
+
return false;
|
|
2196
|
+
}
|
|
2197
|
+
const regex = new RegExp(`^${format.replace(/Y/g, "\\d").replace(/M/g, "\\d").replace(/D/g, "\\d")}$`);
|
|
2198
|
+
return regex.test(value);
|
|
2199
|
+
} catch (e) {
|
|
2200
|
+
return false;
|
|
2201
|
+
}
|
|
2202
|
+
};
|
|
2203
|
+
var formatValueString = (date, format) => {
|
|
2204
|
+
let day = `${date.getDate()}`;
|
|
2205
|
+
let month = `${date.getMonth() + 1}`;
|
|
2206
|
+
const year = date.getFullYear();
|
|
2207
|
+
if (Number(day) < 10) day = "0" + day;
|
|
2208
|
+
if (Number(month) < 10) month = "0" + month;
|
|
2209
|
+
return format.replace(/YYYY/g, year.toString()).replace(/MM/g, month).replace(/DD/g, day);
|
|
2210
|
+
};
|
|
2211
|
+
function parseDate(dateString, format) {
|
|
2212
|
+
const formatParts = format.split(/[-./\s]/);
|
|
2213
|
+
const dateParts = dateString.split(/[-./\s]/);
|
|
2214
|
+
if (formatParts.length !== dateParts.length) {
|
|
2215
|
+
throw new Error("Invalid date string or format");
|
|
2216
|
+
}
|
|
2217
|
+
let day, month, year;
|
|
2218
|
+
for (let i = 0; i < formatParts.length; i++) {
|
|
2219
|
+
const value = parseInt(dateParts[i], 10);
|
|
2220
|
+
switch (formatParts[i]) {
|
|
2221
|
+
case "DD":
|
|
2222
|
+
day = value;
|
|
2223
|
+
break;
|
|
2224
|
+
case "MM":
|
|
2225
|
+
month = value - 1;
|
|
2226
|
+
break;
|
|
2227
|
+
case "YYYY":
|
|
2228
|
+
year = value;
|
|
2229
|
+
break;
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
const result = new Date(year, month, day);
|
|
2233
|
+
return result;
|
|
2234
|
+
}
|
|
2235
|
+
var formatToPattern = (format) => {
|
|
2236
|
+
return format.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
2237
|
+
};
|
|
2238
|
+
var TextMaskAdapter3 = React17.forwardRef(function TextMaskAdapter4(props, ref) {
|
|
2239
|
+
const { onChange, format, ...other } = props;
|
|
2240
|
+
return /* @__PURE__ */ React17.createElement(
|
|
2241
|
+
IMaskInput,
|
|
2242
|
+
{
|
|
2243
|
+
...other,
|
|
2244
|
+
inputRef: ref,
|
|
2245
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
2246
|
+
mask: Date,
|
|
2247
|
+
pattern: formatToPattern(format),
|
|
2248
|
+
blocks: {
|
|
2249
|
+
D: {
|
|
2250
|
+
mask: IMask.MaskedRange,
|
|
2251
|
+
from: 1,
|
|
2252
|
+
to: 31,
|
|
2253
|
+
maxLength: 2
|
|
2254
|
+
},
|
|
2255
|
+
M: {
|
|
2256
|
+
mask: IMask.MaskedRange,
|
|
2257
|
+
from: 1,
|
|
2258
|
+
to: 12,
|
|
2259
|
+
maxLength: 2
|
|
2260
|
+
},
|
|
2261
|
+
Y: {
|
|
2262
|
+
mask: IMask.MaskedRange,
|
|
2263
|
+
from: 1900,
|
|
2264
|
+
to: 9999,
|
|
2265
|
+
maxLength: 4
|
|
2266
|
+
}
|
|
2267
|
+
},
|
|
2268
|
+
format: (date) => formatValueString(date, format),
|
|
2269
|
+
parse: (str) => parseDate(str, format),
|
|
2270
|
+
autofix: "pad",
|
|
2271
|
+
overwrite: true
|
|
2272
|
+
}
|
|
2273
|
+
);
|
|
2274
|
+
});
|
|
2275
|
+
var DatePicker = forwardRef6((inProps, ref) => {
|
|
2092
2276
|
const props = useThemeProps4({ props: inProps, name: "DatePicker" });
|
|
2093
2277
|
const {
|
|
2094
2278
|
onChange,
|
|
@@ -2301,458 +2485,197 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2301
2485
|
},
|
|
2302
2486
|
"Clear"
|
|
2303
2487
|
)
|
|
2304
|
-
))
|
|
2305
|
-
)))));
|
|
2306
|
-
});
|
|
2307
|
-
|
|
2308
|
-
// src/components/DatePicker/index.ts
|
|
2309
|
-
var DatePicker_default = DatePicker;
|
|
2310
|
-
|
|
2311
|
-
// src/components/Textarea/Textarea.tsx
|
|
2312
|
-
import React18 from "react";
|
|
2313
|
-
import { Textarea as JoyTextarea } from "@mui/joy";
|
|
2314
|
-
import { motion as
|
|
2315
|
-
var MotionTextarea =
|
|
2316
|
-
var Textarea = (props) => {
|
|
2317
|
-
const {
|
|
2318
|
-
label,
|
|
2319
|
-
error,
|
|
2320
|
-
helperText,
|
|
2321
|
-
color,
|
|
2322
|
-
size,
|
|
2323
|
-
disabled,
|
|
2324
|
-
required,
|
|
2325
|
-
minRows = 2,
|
|
2326
|
-
maxRows = 4,
|
|
2327
|
-
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
2328
|
-
sx,
|
|
2329
|
-
className,
|
|
2330
|
-
...innerProps
|
|
2331
|
-
} = props;
|
|
2332
|
-
const textarea = /* @__PURE__ */ React18.createElement(
|
|
2333
|
-
MotionTextarea,
|
|
2334
|
-
{
|
|
2335
|
-
required,
|
|
2336
|
-
disabled,
|
|
2337
|
-
color: error ? "danger" : color,
|
|
2338
|
-
size,
|
|
2339
|
-
minRows,
|
|
2340
|
-
maxRows,
|
|
2341
|
-
...innerProps
|
|
2342
|
-
}
|
|
2343
|
-
);
|
|
2344
|
-
return /* @__PURE__ */ React18.createElement(
|
|
2345
|
-
FormControl_default,
|
|
2346
|
-
{
|
|
2347
|
-
required,
|
|
2348
|
-
disabled,
|
|
2349
|
-
color,
|
|
2350
|
-
size,
|
|
2351
|
-
error,
|
|
2352
|
-
sx,
|
|
2353
|
-
className
|
|
2354
|
-
},
|
|
2355
|
-
label && /* @__PURE__ */ React18.createElement(FormLabel_default, null, label),
|
|
2356
|
-
textarea,
|
|
2357
|
-
helperText && /* @__PURE__ */ React18.createElement(FormHelperText_default, null, helperText)
|
|
2358
|
-
);
|
|
2359
|
-
};
|
|
2360
|
-
Textarea.displayName = "Textarea";
|
|
2361
|
-
|
|
2362
|
-
// src/components/Textarea/index.ts
|
|
2363
|
-
var Textarea_default = Textarea;
|
|
2364
|
-
|
|
2365
|
-
// src/components/Select/Select.tsx
|
|
2366
|
-
import React19, { useMemo as useMemo7 } from "react";
|
|
2367
|
-
import { Select as JoySelect, Option as JoyOption } from "@mui/joy";
|
|
2368
|
-
import { motion as motion19 } from "framer-motion";
|
|
2369
|
-
var MotionOption = motion19(JoyOption);
|
|
2370
|
-
var Option = MotionOption;
|
|
2371
|
-
Option.displayName = "Option";
|
|
2372
|
-
function Select(props) {
|
|
2373
|
-
const {
|
|
2374
|
-
label,
|
|
2375
|
-
helperText,
|
|
2376
|
-
error,
|
|
2377
|
-
size,
|
|
2378
|
-
color,
|
|
2379
|
-
disabled,
|
|
2380
|
-
required,
|
|
2381
|
-
onChange,
|
|
2382
|
-
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
2383
|
-
sx,
|
|
2384
|
-
className,
|
|
2385
|
-
...innerProps
|
|
2386
|
-
} = props;
|
|
2387
|
-
const options = useMemo7(
|
|
2388
|
-
() => props.options.map((option) => {
|
|
2389
|
-
if (option.hasOwnProperty("value") && option.hasOwnProperty("label")) {
|
|
2390
|
-
return option;
|
|
2391
|
-
}
|
|
2392
|
-
return {
|
|
2393
|
-
value: option,
|
|
2394
|
-
label: option
|
|
2395
|
-
};
|
|
2396
|
-
}),
|
|
2397
|
-
[props.options]
|
|
2398
|
-
);
|
|
2399
|
-
const handleChange = (event, newValue) => {
|
|
2400
|
-
const _event = event || { target: {} };
|
|
2401
|
-
const newEvent = {
|
|
2402
|
-
..._event,
|
|
2403
|
-
target: {
|
|
2404
|
-
..._event.target,
|
|
2405
|
-
// @ts-expect-error target에 name이 있을 수 있다.
|
|
2406
|
-
name: _event.target?.name || props.name,
|
|
2407
|
-
value: newValue
|
|
2408
|
-
}
|
|
2409
|
-
};
|
|
2410
|
-
onChange?.(newEvent, newValue);
|
|
2411
|
-
};
|
|
2412
|
-
const select = /* @__PURE__ */ React19.createElement(
|
|
2413
|
-
JoySelect,
|
|
2414
|
-
{
|
|
2415
|
-
...innerProps,
|
|
2416
|
-
required,
|
|
2417
|
-
disabled,
|
|
2418
|
-
size,
|
|
2419
|
-
color: error ? "danger" : color,
|
|
2420
|
-
onChange: handleChange
|
|
2421
|
-
},
|
|
2422
|
-
options.map((option) => /* @__PURE__ */ React19.createElement(Option, { key: option.value, value: option.value }, option.label))
|
|
2423
|
-
);
|
|
2424
|
-
return /* @__PURE__ */ React19.createElement(
|
|
2425
|
-
FormControl_default,
|
|
2426
|
-
{
|
|
2427
|
-
required,
|
|
2428
|
-
disabled,
|
|
2429
|
-
size,
|
|
2430
|
-
color,
|
|
2431
|
-
error,
|
|
2432
|
-
sx,
|
|
2433
|
-
className
|
|
2434
|
-
},
|
|
2435
|
-
label && /* @__PURE__ */ React19.createElement(FormLabel_default, null, label),
|
|
2436
|
-
select,
|
|
2437
|
-
helperText && /* @__PURE__ */ React19.createElement(FormHelperText_default, null, helperText)
|
|
2438
|
-
);
|
|
2439
|
-
}
|
|
2440
|
-
Select.displayName = "Select";
|
|
2441
|
-
|
|
2442
|
-
// src/components/Select/index.ts
|
|
2443
|
-
var Select_default = Select;
|
|
2444
|
-
|
|
2445
|
-
// src/components/Tooltip/Tooltip.tsx
|
|
2446
|
-
import React20 from "react";
|
|
2447
|
-
import { Tooltip as JoyTooltip } from "@mui/joy";
|
|
2448
|
-
import { motion as motion20 } from "framer-motion";
|
|
2449
|
-
var MotionTooltip = motion20(JoyTooltip);
|
|
2450
|
-
var Tooltip = (props) => {
|
|
2451
|
-
return /* @__PURE__ */ React20.createElement(MotionTooltip, { ...props });
|
|
2452
|
-
};
|
|
2453
|
-
Tooltip.displayName = "Tooltip";
|
|
2454
|
-
|
|
2455
|
-
// src/components/Tooltip/index.ts
|
|
2456
|
-
var Tooltip_default = Tooltip;
|
|
2457
|
-
|
|
2458
|
-
// src/components/DataTable/DataTable.tsx
|
|
2459
|
-
import { motion as motion21, AnimatePresence as AnimatePresence2 } from "framer-motion";
|
|
2460
|
-
|
|
2461
|
-
// src/components/Pagination/Pagination.tsx
|
|
2462
|
-
import React21, { useCallback as useCallback8, useEffect as useEffect4 } from "react";
|
|
2463
|
-
import PreviousIcon from "@mui/icons-material/ChevronLeft";
|
|
2464
|
-
import NextIcon from "@mui/icons-material/ChevronRight";
|
|
2465
|
-
import { styled as styled10 } from "@mui/joy";
|
|
2466
|
-
var PaginationButton = styled10(Button_default, {
|
|
2467
|
-
name: "Pagination",
|
|
2468
|
-
slot: "button"
|
|
2469
|
-
})(({ theme, active, size }) => ({
|
|
2470
|
-
"--Button-size": {
|
|
2471
|
-
sm: "32px",
|
|
2472
|
-
md: "40px",
|
|
2473
|
-
lg: "48px"
|
|
2474
|
-
}[size],
|
|
2475
|
-
width: "var(--Button-size)",
|
|
2476
|
-
height: "var(--Button-size)",
|
|
2477
|
-
backgroundColor: active ? theme.vars.palette.primary.softHoverBg : "transparent",
|
|
2478
|
-
color: active ? theme.vars.palette.primary.softColor : theme.vars.palette.neutral.plainColor,
|
|
2479
|
-
"&:hover": {
|
|
2480
|
-
color: active ? theme.vars.palette.primary.softColor : theme.vars.palette.neutral.softColor,
|
|
2481
|
-
backgroundColor: active ? theme.vars.palette.primary.softActiveBg : theme.vars.palette.neutral.softHoverBg
|
|
2482
|
-
}
|
|
2483
|
-
}));
|
|
2484
|
-
var PaginationIconButton = styled10(IconButton_default, {
|
|
2485
|
-
name: "Pagination",
|
|
2486
|
-
slot: "button"
|
|
2487
|
-
})(({ theme, size }) => ({
|
|
2488
|
-
"--IconButton-size": {
|
|
2489
|
-
sm: "32px",
|
|
2490
|
-
md: "40px",
|
|
2491
|
-
lg: "48px"
|
|
2492
|
-
}[size],
|
|
2493
|
-
"--Icon-fontSize": "20px",
|
|
2494
|
-
width: "var(--IconButton-size)",
|
|
2495
|
-
height: "var(--IconButton-size)",
|
|
2496
|
-
color: theme.vars.palette.neutral.plainColor,
|
|
2497
|
-
"&:hover": {
|
|
2498
|
-
color: theme.vars.palette.neutral.softColor,
|
|
2499
|
-
backgroundColor: theme.vars.palette.neutral.softHoverBg
|
|
2500
|
-
}
|
|
2501
|
-
}));
|
|
2502
|
-
var PaginationRoot = styled10(Stack_default, {
|
|
2503
|
-
name: "Pagination",
|
|
2504
|
-
slot: "root"
|
|
2505
|
-
})({});
|
|
2506
|
-
var PaginationContainer = styled10(Stack_default, {
|
|
2507
|
-
name: "Pagination",
|
|
2508
|
-
slot: "container"
|
|
2509
|
-
})(({ theme, size }) => ({
|
|
2510
|
-
gap: {
|
|
2511
|
-
sm: theme.spacing(1),
|
|
2512
|
-
md: theme.spacing(1.5),
|
|
2513
|
-
lg: theme.spacing(2)
|
|
2514
|
-
}[size]
|
|
2515
|
-
}));
|
|
2516
|
-
function Pagination(props) {
|
|
2488
|
+
))
|
|
2489
|
+
)))));
|
|
2490
|
+
});
|
|
2491
|
+
|
|
2492
|
+
// src/components/DatePicker/index.ts
|
|
2493
|
+
var DatePicker_default = DatePicker;
|
|
2494
|
+
|
|
2495
|
+
// src/components/Textarea/Textarea.tsx
|
|
2496
|
+
import React18 from "react";
|
|
2497
|
+
import { Textarea as JoyTextarea } from "@mui/joy";
|
|
2498
|
+
import { motion as motion19 } from "framer-motion";
|
|
2499
|
+
var MotionTextarea = motion19(JoyTextarea);
|
|
2500
|
+
var Textarea = (props) => {
|
|
2517
2501
|
const {
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
size
|
|
2502
|
+
label,
|
|
2503
|
+
error,
|
|
2504
|
+
helperText,
|
|
2505
|
+
color,
|
|
2506
|
+
size,
|
|
2507
|
+
disabled,
|
|
2508
|
+
required,
|
|
2509
|
+
minRows = 2,
|
|
2510
|
+
maxRows = 4,
|
|
2511
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
2512
|
+
sx,
|
|
2513
|
+
className,
|
|
2523
2514
|
...innerProps
|
|
2524
2515
|
} = props;
|
|
2525
|
-
const
|
|
2526
|
-
|
|
2527
|
-
defaultPaginationModel,
|
|
2528
|
-
useCallback8(
|
|
2529
|
-
(newPage) => {
|
|
2530
|
-
onPageChange(newPage.page);
|
|
2531
|
-
},
|
|
2532
|
-
[onPageChange]
|
|
2533
|
-
)
|
|
2534
|
-
);
|
|
2535
|
-
const handlePageChange = (newPage) => {
|
|
2536
|
-
setPaginationModel({ ...paginationModel, page: newPage });
|
|
2537
|
-
};
|
|
2538
|
-
const firstPage = 1;
|
|
2539
|
-
const lastPage = Math.max(firstPage, Math.ceil(rowCount / paginationModel.pageSize));
|
|
2540
|
-
const beforePages = [paginationModel.page - 2, paginationModel.page - 1].filter((p) => p > 1);
|
|
2541
|
-
const afterPages = [paginationModel.page + 1, paginationModel.page + 2].filter((p) => p <= lastPage - 1);
|
|
2542
|
-
const isMoreAfterPages = lastPage > 1 && paginationModel.page < lastPage - 3;
|
|
2543
|
-
const isMoreBeforePages = lastPage > 1 && paginationModel.page > 4;
|
|
2544
|
-
useEffect4(() => {
|
|
2545
|
-
if (paginationModel.page > lastPage) {
|
|
2546
|
-
setPaginationModel({ ...paginationModel, page: lastPage });
|
|
2547
|
-
}
|
|
2548
|
-
}, [rowCount, paginationModel, lastPage, setPaginationModel]);
|
|
2549
|
-
return /* @__PURE__ */ React21.createElement(PaginationRoot, { ...innerProps }, /* @__PURE__ */ React21.createElement(PaginationContainer, { direction: "row", size, alignItems: "center" }, /* @__PURE__ */ React21.createElement(
|
|
2550
|
-
PaginationIconButton,
|
|
2551
|
-
{
|
|
2552
|
-
size,
|
|
2553
|
-
variant: "plain",
|
|
2554
|
-
color: "neutral",
|
|
2555
|
-
onClick: () => handlePageChange(paginationModel.page - 1),
|
|
2556
|
-
disabled: paginationModel.page === firstPage,
|
|
2557
|
-
"aria-label": "Previous page"
|
|
2558
|
-
},
|
|
2559
|
-
/* @__PURE__ */ React21.createElement(PreviousIcon, null)
|
|
2560
|
-
), paginationModel.page !== firstPage && /* @__PURE__ */ React21.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(firstPage) }, firstPage), isMoreBeforePages && /* @__PURE__ */ React21.createElement(
|
|
2561
|
-
PaginationButton,
|
|
2562
|
-
{
|
|
2563
|
-
size,
|
|
2564
|
-
variant: "plain",
|
|
2565
|
-
color: "neutral",
|
|
2566
|
-
onClick: () => handlePageChange(paginationModel.page - 3),
|
|
2567
|
-
"aria-label": "More previous pages"
|
|
2568
|
-
},
|
|
2569
|
-
"..."
|
|
2570
|
-
), beforePages.map((p) => /* @__PURE__ */ React21.createElement(PaginationButton, { key: p, size, variant: "plain", color: "neutral", onClick: () => handlePageChange(p) }, p)), /* @__PURE__ */ React21.createElement(PaginationButton, { active: "active", size, "aria-current": "page" }, paginationModel.page), afterPages.map((p) => /* @__PURE__ */ React21.createElement(PaginationButton, { key: p, size, variant: "plain", color: "neutral", onClick: () => handlePageChange(p) }, p)), isMoreAfterPages && /* @__PURE__ */ React21.createElement(
|
|
2571
|
-
PaginationButton,
|
|
2516
|
+
const textarea = /* @__PURE__ */ React18.createElement(
|
|
2517
|
+
MotionTextarea,
|
|
2572
2518
|
{
|
|
2519
|
+
required,
|
|
2520
|
+
disabled,
|
|
2521
|
+
color: error ? "danger" : color,
|
|
2573
2522
|
size,
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
PaginationIconButton,
|
|
2523
|
+
minRows,
|
|
2524
|
+
maxRows,
|
|
2525
|
+
...innerProps
|
|
2526
|
+
}
|
|
2527
|
+
);
|
|
2528
|
+
return /* @__PURE__ */ React18.createElement(
|
|
2529
|
+
FormControl_default,
|
|
2582
2530
|
{
|
|
2531
|
+
required,
|
|
2532
|
+
disabled,
|
|
2533
|
+
color,
|
|
2583
2534
|
size,
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
disabled: paginationModel.page === lastPage,
|
|
2588
|
-
"aria-label": "Next page"
|
|
2589
|
-
},
|
|
2590
|
-
/* @__PURE__ */ React21.createElement(NextIcon, null)
|
|
2591
|
-
)));
|
|
2592
|
-
}
|
|
2593
|
-
Pagination.displayName = "Pagination";
|
|
2594
|
-
|
|
2595
|
-
// src/components/Pagination/index.ts
|
|
2596
|
-
var Pagination_default = Pagination;
|
|
2597
|
-
|
|
2598
|
-
// src/components/InfoSign/InfoSign.tsx
|
|
2599
|
-
import React22 from "react";
|
|
2600
|
-
import { styled as styled11, tooltipClasses } from "@mui/joy";
|
|
2601
|
-
import MuiInfoIcon from "@mui/icons-material/Info";
|
|
2602
|
-
var InfoIcon = styled11(MuiInfoIcon, {
|
|
2603
|
-
name: "InfoSign",
|
|
2604
|
-
slot: "InfoSign"
|
|
2605
|
-
})(({ theme }) => ({
|
|
2606
|
-
color: theme.palette.text.icon,
|
|
2607
|
-
width: "14px",
|
|
2608
|
-
height: "14px"
|
|
2609
|
-
}));
|
|
2610
|
-
function InfoSign(props) {
|
|
2611
|
-
const { message, placement } = props;
|
|
2612
|
-
return /* @__PURE__ */ React22.createElement(
|
|
2613
|
-
Tooltip_default,
|
|
2614
|
-
{
|
|
2615
|
-
arrow: true,
|
|
2616
|
-
placement,
|
|
2617
|
-
sx: {
|
|
2618
|
-
[`&.${tooltipClasses.root}`]: {
|
|
2619
|
-
maxWidth: "320px"
|
|
2620
|
-
}
|
|
2621
|
-
},
|
|
2622
|
-
title: message?.split("\n").map((line, i) => /* @__PURE__ */ React22.createElement("div", { key: `info-sign-${i}` }, line))
|
|
2535
|
+
error,
|
|
2536
|
+
sx,
|
|
2537
|
+
className
|
|
2623
2538
|
},
|
|
2624
|
-
/* @__PURE__ */
|
|
2539
|
+
label && /* @__PURE__ */ React18.createElement(FormLabel_default, null, label),
|
|
2540
|
+
textarea,
|
|
2541
|
+
helperText && /* @__PURE__ */ React18.createElement(FormHelperText_default, null, helperText)
|
|
2625
2542
|
);
|
|
2626
|
-
}
|
|
2543
|
+
};
|
|
2544
|
+
Textarea.displayName = "Textarea";
|
|
2627
2545
|
|
|
2628
|
-
// src/components/
|
|
2629
|
-
var
|
|
2546
|
+
// src/components/Textarea/index.ts
|
|
2547
|
+
var Textarea_default = Textarea;
|
|
2630
2548
|
|
|
2631
|
-
// src/components/
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
}
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
return reorderedColumns;
|
|
2675
|
-
}
|
|
2676
|
-
function flattenColumnGroups(items, groupPath = [], columnIndex = { current: 0 }) {
|
|
2677
|
-
const result = [];
|
|
2678
|
-
for (const item of items) {
|
|
2679
|
-
if ("groupId" in item) {
|
|
2680
|
-
const newPath = [...groupPath, item.groupId];
|
|
2681
|
-
const children = Array.isArray(item.children) ? item.children : [item.children];
|
|
2682
|
-
result.push(...flattenColumnGroups(children, newPath, columnIndex));
|
|
2683
|
-
} else {
|
|
2684
|
-
result.push({
|
|
2685
|
-
...item,
|
|
2686
|
-
groupPath,
|
|
2687
|
-
columnIndex: columnIndex.current++
|
|
2688
|
-
});
|
|
2689
|
-
}
|
|
2690
|
-
}
|
|
2691
|
-
return result;
|
|
2692
|
-
}
|
|
2693
|
-
function calculateColumnGroups(columnGroupingModel, columns) {
|
|
2694
|
-
const fieldsInGroupingModel = extractFieldsFromGroupingModel(columnGroupingModel);
|
|
2695
|
-
const flattenedColumns = flattenColumnGroups(columnGroupingModel);
|
|
2696
|
-
const columnIndexMap = new Map(flattenedColumns.map((col) => [col.field, col.columnIndex]));
|
|
2697
|
-
const processedGroups = /* @__PURE__ */ new Map();
|
|
2698
|
-
const groupsByLevel = [];
|
|
2699
|
-
let maxLevel = 0;
|
|
2700
|
-
function processGroup(items, level, parentGroupId) {
|
|
2701
|
-
let minIndex = Infinity;
|
|
2702
|
-
let maxIndex = -Infinity;
|
|
2703
|
-
for (const item of items) {
|
|
2704
|
-
if ("groupId" in item) {
|
|
2705
|
-
const groupKey = parentGroupId ? `${parentGroupId}.${item.groupId}` : item.groupId;
|
|
2706
|
-
if (!processedGroups.has(groupKey)) {
|
|
2707
|
-
const children = Array.isArray(item.children) ? item.children : [item.children];
|
|
2708
|
-
const { startIndex, colspan } = processGroup(children, level + 1, groupKey);
|
|
2709
|
-
const group = {
|
|
2710
|
-
groupId: item.groupId,
|
|
2711
|
-
headerName: item.headerName,
|
|
2712
|
-
colspan,
|
|
2713
|
-
level,
|
|
2714
|
-
startIndex
|
|
2715
|
-
};
|
|
2716
|
-
processedGroups.set(groupKey, group);
|
|
2717
|
-
if (!groupsByLevel[level]) {
|
|
2718
|
-
groupsByLevel[level] = [];
|
|
2719
|
-
}
|
|
2720
|
-
groupsByLevel[level].push(group);
|
|
2721
|
-
maxLevel = Math.max(maxLevel, level);
|
|
2722
|
-
minIndex = Math.min(minIndex, startIndex);
|
|
2723
|
-
maxIndex = Math.max(maxIndex, startIndex + colspan - 1);
|
|
2724
|
-
}
|
|
2725
|
-
} else {
|
|
2726
|
-
const columnIndex = columnIndexMap.get(item.field);
|
|
2727
|
-
if (columnIndex !== void 0) {
|
|
2728
|
-
minIndex = Math.min(minIndex, columnIndex);
|
|
2729
|
-
maxIndex = Math.max(maxIndex, columnIndex);
|
|
2730
|
-
}
|
|
2549
|
+
// src/components/Select/Select.tsx
|
|
2550
|
+
import React19, { useMemo as useMemo7 } from "react";
|
|
2551
|
+
import { Select as JoySelect, Option as JoyOption } from "@mui/joy";
|
|
2552
|
+
import { motion as motion20 } from "framer-motion";
|
|
2553
|
+
var MotionOption = motion20(JoyOption);
|
|
2554
|
+
var Option = MotionOption;
|
|
2555
|
+
Option.displayName = "Option";
|
|
2556
|
+
function Select(props) {
|
|
2557
|
+
const {
|
|
2558
|
+
label,
|
|
2559
|
+
helperText,
|
|
2560
|
+
error,
|
|
2561
|
+
size,
|
|
2562
|
+
color,
|
|
2563
|
+
disabled,
|
|
2564
|
+
required,
|
|
2565
|
+
onChange,
|
|
2566
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
2567
|
+
sx,
|
|
2568
|
+
className,
|
|
2569
|
+
...innerProps
|
|
2570
|
+
} = props;
|
|
2571
|
+
const options = useMemo7(
|
|
2572
|
+
() => props.options.map((option) => {
|
|
2573
|
+
if (option.hasOwnProperty("value") && option.hasOwnProperty("label")) {
|
|
2574
|
+
return option;
|
|
2575
|
+
}
|
|
2576
|
+
return {
|
|
2577
|
+
value: option,
|
|
2578
|
+
label: option
|
|
2579
|
+
};
|
|
2580
|
+
}),
|
|
2581
|
+
[props.options]
|
|
2582
|
+
);
|
|
2583
|
+
const handleChange = (event, newValue) => {
|
|
2584
|
+
const _event = event || { target: {} };
|
|
2585
|
+
const newEvent = {
|
|
2586
|
+
..._event,
|
|
2587
|
+
target: {
|
|
2588
|
+
..._event.target,
|
|
2589
|
+
// @ts-expect-error target에 name이 있을 수 있다.
|
|
2590
|
+
name: _event.target?.name || props.name,
|
|
2591
|
+
value: newValue
|
|
2731
2592
|
}
|
|
2732
|
-
}
|
|
2733
|
-
return {
|
|
2734
|
-
startIndex: minIndex === Infinity ? 0 : minIndex,
|
|
2735
|
-
colspan: maxIndex === -Infinity ? 0 : maxIndex - minIndex + 1
|
|
2736
2593
|
};
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2594
|
+
onChange?.(newEvent, newValue);
|
|
2595
|
+
};
|
|
2596
|
+
const select = /* @__PURE__ */ React19.createElement(
|
|
2597
|
+
JoySelect,
|
|
2598
|
+
{
|
|
2599
|
+
...innerProps,
|
|
2600
|
+
required,
|
|
2601
|
+
disabled,
|
|
2602
|
+
size,
|
|
2603
|
+
color: error ? "danger" : color,
|
|
2604
|
+
onChange: handleChange
|
|
2605
|
+
},
|
|
2606
|
+
options.map((option) => /* @__PURE__ */ React19.createElement(Option, { key: option.value, value: option.value }, option.label))
|
|
2607
|
+
);
|
|
2608
|
+
return /* @__PURE__ */ React19.createElement(
|
|
2609
|
+
FormControl_default,
|
|
2610
|
+
{
|
|
2611
|
+
required,
|
|
2612
|
+
disabled,
|
|
2613
|
+
size,
|
|
2614
|
+
color,
|
|
2615
|
+
error,
|
|
2616
|
+
sx,
|
|
2617
|
+
className
|
|
2618
|
+
},
|
|
2619
|
+
label && /* @__PURE__ */ React19.createElement(FormLabel_default, null, label),
|
|
2620
|
+
select,
|
|
2621
|
+
helperText && /* @__PURE__ */ React19.createElement(FormHelperText_default, null, helperText)
|
|
2622
|
+
);
|
|
2743
2623
|
}
|
|
2744
|
-
|
|
2745
|
-
|
|
2624
|
+
Select.displayName = "Select";
|
|
2625
|
+
|
|
2626
|
+
// src/components/Select/index.ts
|
|
2627
|
+
var Select_default = Select;
|
|
2628
|
+
|
|
2629
|
+
// src/components/DataTable/components.tsx
|
|
2630
|
+
import { Link } from "@mui/joy";
|
|
2631
|
+
|
|
2632
|
+
// src/components/Tooltip/Tooltip.tsx
|
|
2633
|
+
import React20 from "react";
|
|
2634
|
+
import { Tooltip as JoyTooltip } from "@mui/joy";
|
|
2635
|
+
import { motion as motion21 } from "framer-motion";
|
|
2636
|
+
var MotionTooltip = motion21(JoyTooltip);
|
|
2637
|
+
var Tooltip = (props) => {
|
|
2638
|
+
return /* @__PURE__ */ React20.createElement(MotionTooltip, { ...props });
|
|
2639
|
+
};
|
|
2640
|
+
Tooltip.displayName = "Tooltip";
|
|
2641
|
+
|
|
2642
|
+
// src/components/Tooltip/index.ts
|
|
2643
|
+
var Tooltip_default = Tooltip;
|
|
2644
|
+
|
|
2645
|
+
// src/components/InfoSign/InfoSign.tsx
|
|
2646
|
+
import React21 from "react";
|
|
2647
|
+
import { styled as styled11, tooltipClasses } from "@mui/joy";
|
|
2648
|
+
import MuiInfoIcon from "@mui/icons-material/Info";
|
|
2649
|
+
var InfoIcon = styled11(MuiInfoIcon, {
|
|
2650
|
+
name: "InfoSign",
|
|
2651
|
+
slot: "InfoSign"
|
|
2652
|
+
})(({ theme }) => ({
|
|
2653
|
+
color: theme.palette.text.icon,
|
|
2654
|
+
width: "14px",
|
|
2655
|
+
height: "14px"
|
|
2656
|
+
}));
|
|
2657
|
+
function InfoSign(props) {
|
|
2658
|
+
const { message, placement } = props;
|
|
2659
|
+
return /* @__PURE__ */ React21.createElement(
|
|
2660
|
+
Tooltip_default,
|
|
2661
|
+
{
|
|
2662
|
+
arrow: true,
|
|
2663
|
+
placement,
|
|
2664
|
+
sx: {
|
|
2665
|
+
[`&.${tooltipClasses.root}`]: {
|
|
2666
|
+
maxWidth: "320px"
|
|
2667
|
+
}
|
|
2668
|
+
},
|
|
2669
|
+
title: message?.split("\n").map((line, i) => /* @__PURE__ */ React21.createElement("div", { key: `info-sign-${i}` }, line))
|
|
2670
|
+
},
|
|
2671
|
+
/* @__PURE__ */ React21.createElement(InfoIcon, null)
|
|
2672
|
+
);
|
|
2746
2673
|
}
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
overflow: "hidden",
|
|
2753
|
-
textOverflow: "ellipsis",
|
|
2754
|
-
whiteSpace: "nowrap"
|
|
2755
|
-
});
|
|
2674
|
+
|
|
2675
|
+
// src/components/InfoSign/index.ts
|
|
2676
|
+
var InfoSign_default = InfoSign;
|
|
2677
|
+
|
|
2678
|
+
// src/components/DataTable/components.tsx
|
|
2756
2679
|
var TextEllipsis = ({ children }) => {
|
|
2757
2680
|
const textRef = useRef4(null);
|
|
2758
2681
|
const [showTooltip, setShowTooltip] = useState6(false);
|
|
@@ -2763,9 +2686,9 @@ var TextEllipsis = ({ children }) => {
|
|
|
2763
2686
|
setShowTooltip(isTextTruncated);
|
|
2764
2687
|
}
|
|
2765
2688
|
}, [children]);
|
|
2766
|
-
const content = /* @__PURE__ */
|
|
2689
|
+
const content = /* @__PURE__ */ React22.createElement(EllipsisDiv, { ref: textRef }, children);
|
|
2767
2690
|
if (showTooltip) {
|
|
2768
|
-
return /* @__PURE__ */
|
|
2691
|
+
return /* @__PURE__ */ React22.createElement(Tooltip_default, { title: children, placement: "top", onClick: (e) => e.stopPropagation() }, content);
|
|
2769
2692
|
}
|
|
2770
2693
|
return content;
|
|
2771
2694
|
};
|
|
@@ -2779,9 +2702,9 @@ var CellTextEllipsis = ({ children }) => {
|
|
|
2779
2702
|
setShowTooltip(isTextTruncated);
|
|
2780
2703
|
}
|
|
2781
2704
|
}, [children]);
|
|
2782
|
-
const content = /* @__PURE__ */
|
|
2705
|
+
const content = /* @__PURE__ */ React22.createElement(EllipsisDiv, { ref: textRef }, children);
|
|
2783
2706
|
if (showTooltip) {
|
|
2784
|
-
return /* @__PURE__ */
|
|
2707
|
+
return /* @__PURE__ */ React22.createElement(
|
|
2785
2708
|
Tooltip_default,
|
|
2786
2709
|
{
|
|
2787
2710
|
title: children,
|
|
@@ -2795,130 +2718,6 @@ var CellTextEllipsis = ({ children }) => {
|
|
|
2795
2718
|
}
|
|
2796
2719
|
return content;
|
|
2797
2720
|
};
|
|
2798
|
-
var OverlayWrapper = styled12("tr", {
|
|
2799
|
-
name: "DataTable",
|
|
2800
|
-
slot: "overlayWrapper"
|
|
2801
|
-
})({
|
|
2802
|
-
position: "sticky",
|
|
2803
|
-
top: `calc(var(--unstable_TableCell-height, 32px))`,
|
|
2804
|
-
left: 0,
|
|
2805
|
-
right: 0,
|
|
2806
|
-
zIndex: 1,
|
|
2807
|
-
"& > td": {
|
|
2808
|
-
height: 0,
|
|
2809
|
-
padding: 0,
|
|
2810
|
-
border: "none !important"
|
|
2811
|
-
}
|
|
2812
|
-
});
|
|
2813
|
-
var numberFormatter = (value) => "Intl" in window ? new Intl.NumberFormat().format(value) : value;
|
|
2814
|
-
var Resizer = (ref, targetRef = ref) => /* @__PURE__ */ React23.createElement(
|
|
2815
|
-
Box_default,
|
|
2816
|
-
{
|
|
2817
|
-
sx: {
|
|
2818
|
-
position: "absolute",
|
|
2819
|
-
top: 0,
|
|
2820
|
-
right: 0,
|
|
2821
|
-
bottom: 0,
|
|
2822
|
-
width: "4px",
|
|
2823
|
-
cursor: "col-resize"
|
|
2824
|
-
},
|
|
2825
|
-
onClick: (e) => e.stopPropagation(),
|
|
2826
|
-
onMouseDown: (e) => {
|
|
2827
|
-
const initialX = e.clientX;
|
|
2828
|
-
const initialWidth = ref.current?.getBoundingClientRect().width;
|
|
2829
|
-
const onMouseMove = (e2) => {
|
|
2830
|
-
if (initialWidth && initialX) {
|
|
2831
|
-
ref.current.style.width = `${initialWidth + (e2.clientX - initialX)}px`;
|
|
2832
|
-
targetRef.current.style.width = `${initialWidth + (e2.clientX - initialX)}px`;
|
|
2833
|
-
}
|
|
2834
|
-
};
|
|
2835
|
-
const onMouseUp = () => {
|
|
2836
|
-
document.removeEventListener("mousemove", onMouseMove);
|
|
2837
|
-
document.removeEventListener("mouseup", onMouseUp);
|
|
2838
|
-
};
|
|
2839
|
-
document.addEventListener("mousemove", onMouseMove);
|
|
2840
|
-
document.addEventListener("mouseup", onMouseUp);
|
|
2841
|
-
}
|
|
2842
|
-
}
|
|
2843
|
-
);
|
|
2844
|
-
var VirtualizedTableBody = styled12("tbody", {
|
|
2845
|
-
name: "DataTable",
|
|
2846
|
-
slot: "tableBody"
|
|
2847
|
-
})({
|
|
2848
|
-
// HACK: for virtualization: tbody의 height를 렌더링 된 tr의 총 높이 보다 높은 값으로 지정하고도 tr의 size를 유지하기 위한 꼼수
|
|
2849
|
-
"&::after": {
|
|
2850
|
-
content: "''",
|
|
2851
|
-
display: "block",
|
|
2852
|
-
height: "0.01em"
|
|
2853
|
-
},
|
|
2854
|
-
// NOTE: 테이블 안에 버튼을 넣을 때 버튼의 높이가 테이블의 높이를 넘어가지 않도록 설정
|
|
2855
|
-
[`& .${buttonClasses.root}`]: {
|
|
2856
|
-
"--Button-minHeight": "26px",
|
|
2857
|
-
"--Button-paddingBlock": "0.25rem",
|
|
2858
|
-
lineHeight: 1,
|
|
2859
|
-
marginTop: "-2px",
|
|
2860
|
-
marginBottom: "-2px"
|
|
2861
|
-
},
|
|
2862
|
-
[`& .${iconButtonClasses.root}`]: {
|
|
2863
|
-
"--IconButton-size": "26px",
|
|
2864
|
-
verticalAlign: "middle",
|
|
2865
|
-
marginTop: "-2px",
|
|
2866
|
-
marginBottom: "-2px"
|
|
2867
|
-
}
|
|
2868
|
-
});
|
|
2869
|
-
var StyledTableRow = styled12("tr", {
|
|
2870
|
-
name: "DataTable",
|
|
2871
|
-
slot: "tableRow",
|
|
2872
|
-
shouldForwardProp: (prop) => prop !== "striped"
|
|
2873
|
-
})(({ striped }) => ({
|
|
2874
|
-
...striped && {
|
|
2875
|
-
backgroundColor: "var(--TableRow-stripeBackground, var(--ceed-palette-background-level2))",
|
|
2876
|
-
color: "var(--ceed-palette-text-primary)",
|
|
2877
|
-
"& td": {
|
|
2878
|
-
backgroundColor: "background.surface"
|
|
2879
|
-
}
|
|
2880
|
-
},
|
|
2881
|
-
"&:hover": {
|
|
2882
|
-
backgroundColor: "var(--TableRow-hoverBackground, var(--ceed-palette-background-level3))",
|
|
2883
|
-
"& td": {
|
|
2884
|
-
backgroundColor: "var(--TableRow-hoverBackground, var(--ceed-palette-background-level3))"
|
|
2885
|
-
}
|
|
2886
|
-
}
|
|
2887
|
-
}));
|
|
2888
|
-
var VirtualizedTableRow = memo(StyledTableRow, (prevProps, nextProps) => {
|
|
2889
|
-
return prevProps.striped === nextProps.striped && prevProps.style?.height === nextProps.style?.height && prevProps.style?.transform === nextProps.style?.transform && // @ts-ignore
|
|
2890
|
-
prevProps["data-row-id"] === nextProps["data-row-id"] && // @ts-ignore
|
|
2891
|
-
prevProps["data-index"] === nextProps["data-index"] && prevProps.tabIndex === nextProps.tabIndex && prevProps["aria-checked"] === nextProps["aria-checked"] && // Include children check to handle isCellEditable changes
|
|
2892
|
-
prevProps.children === nextProps.children;
|
|
2893
|
-
});
|
|
2894
|
-
var Asterisk = styled12("span", {
|
|
2895
|
-
name: "DataTable",
|
|
2896
|
-
slot: "headCellAsterisk"
|
|
2897
|
-
})(({ theme }) => ({
|
|
2898
|
-
color: "var(--ceed-palette-danger-500)",
|
|
2899
|
-
marginLeft: theme.spacing(0.5)
|
|
2900
|
-
}));
|
|
2901
|
-
var StyledTh = styled12(motion21.th)(({ theme }) => ({
|
|
2902
|
-
boxShadow: "1px 0 var(--TableCell-borderColor)"
|
|
2903
|
-
// border 대신 box-shadow를 사용하여 stickyHeader와 함께 사용할 때 border가 겹치는 문제를 해결
|
|
2904
|
-
}));
|
|
2905
|
-
var StyledTd = styled12("td")(({ theme }) => ({
|
|
2906
|
-
transition: `box-shadow 0.3s`,
|
|
2907
|
-
"&:not(.is-last-left):not(.is-last-right)": {
|
|
2908
|
-
boxShadow: "1px 0 var(--TableCell-borderColor)"
|
|
2909
|
-
},
|
|
2910
|
-
".ScrollableRight &": {
|
|
2911
|
-
"&.is-last-left": {
|
|
2912
|
-
boxShadow: `1px 0 var(--TableCell-borderColor), ${theme.shadow.md}`
|
|
2913
|
-
}
|
|
2914
|
-
},
|
|
2915
|
-
".ScrollableLeft &": {
|
|
2916
|
-
"&.is-last-right": {
|
|
2917
|
-
boxShadow: `1px 0 var(--TableCell-borderColor), ${theme.shadow.md}`
|
|
2918
|
-
}
|
|
2919
|
-
}
|
|
2920
|
-
}));
|
|
2921
|
-
var MotionSortIcon = motion21(SortIcon);
|
|
2922
2721
|
var HeadCell = (props) => {
|
|
2923
2722
|
const {
|
|
2924
2723
|
width,
|
|
@@ -2941,7 +2740,8 @@ var HeadCell = (props) => {
|
|
|
2941
2740
|
pinnedStartPosition,
|
|
2942
2741
|
pinnedEndPosition,
|
|
2943
2742
|
headerRef,
|
|
2944
|
-
tableColRef
|
|
2743
|
+
tableColRef,
|
|
2744
|
+
headerClassName
|
|
2945
2745
|
} = props;
|
|
2946
2746
|
const theme = useTheme();
|
|
2947
2747
|
const ref = headerRef;
|
|
@@ -2974,7 +2774,7 @@ var HeadCell = (props) => {
|
|
|
2974
2774
|
const sortIcon = useMemo8(() => {
|
|
2975
2775
|
const isSorted = !!sort;
|
|
2976
2776
|
const isVisible = sortable && (isSorted || isHovered);
|
|
2977
|
-
return /* @__PURE__ */
|
|
2777
|
+
return /* @__PURE__ */ React22.createElement(AnimatePresence2, { mode: "wait" }, isVisible && /* @__PURE__ */ React22.createElement(
|
|
2978
2778
|
MotionSortIcon,
|
|
2979
2779
|
{
|
|
2980
2780
|
key: "sort-icon",
|
|
@@ -3003,10 +2803,20 @@ var HeadCell = (props) => {
|
|
|
3003
2803
|
));
|
|
3004
2804
|
}, [headId, initialSort, sort, sortable, isHovered]);
|
|
3005
2805
|
const infoSign = useMemo8(
|
|
3006
|
-
() => description ? /* @__PURE__ */
|
|
2806
|
+
() => description ? /* @__PURE__ */ React22.createElement(InfoSign_default, { message: description, placement: "bottom" }) : null,
|
|
3007
2807
|
[description]
|
|
3008
2808
|
);
|
|
3009
|
-
|
|
2809
|
+
const params = useMemo8(
|
|
2810
|
+
() => ({
|
|
2811
|
+
field
|
|
2812
|
+
}),
|
|
2813
|
+
[field]
|
|
2814
|
+
);
|
|
2815
|
+
const computedHeaderClassName = useMemo8(
|
|
2816
|
+
() => (typeof headerClassName === "function" ? headerClassName(params) : headerClassName) || void 0,
|
|
2817
|
+
[headerClassName, params]
|
|
2818
|
+
);
|
|
2819
|
+
return /* @__PURE__ */ React22.createElement(
|
|
3010
2820
|
StyledTh,
|
|
3011
2821
|
{
|
|
3012
2822
|
id: headId,
|
|
@@ -3015,16 +2825,17 @@ var HeadCell = (props) => {
|
|
|
3015
2825
|
ref,
|
|
3016
2826
|
key: field,
|
|
3017
2827
|
style,
|
|
3018
|
-
onClick:
|
|
2828
|
+
onClick: useCallback8(
|
|
3019
2829
|
(e) => sortable && onSortChange?.({ field, currentSort: sort, multiple: e.shiftKey }),
|
|
3020
2830
|
[field, onSortChange, sort, sortable]
|
|
3021
2831
|
),
|
|
3022
2832
|
onMouseEnter: () => setIsHovered(true),
|
|
3023
2833
|
onMouseLeave: () => setIsHovered(false),
|
|
3024
2834
|
whileHover: "hover",
|
|
3025
|
-
initial: "initial"
|
|
2835
|
+
initial: "initial",
|
|
2836
|
+
className: computedHeaderClassName
|
|
3026
2837
|
},
|
|
3027
|
-
/* @__PURE__ */
|
|
2838
|
+
/* @__PURE__ */ React22.createElement(Stack_default, { gap: 1, direction: "row", justifyContent: textAlign, alignItems: "center" }, textAlign === "end" && sortIcon, textAlign === "end" && infoSign, /* @__PURE__ */ React22.createElement(TextEllipsis, null, headerName ?? field, editMode && required && /* @__PURE__ */ React22.createElement(Asterisk, null, "*")), textAlign === "start" && infoSign, textAlign === "start" && sortIcon),
|
|
3028
2839
|
resizer
|
|
3029
2840
|
);
|
|
3030
2841
|
};
|
|
@@ -3139,18 +2950,18 @@ var BodyCell = (props) => {
|
|
|
3139
2950
|
return createElement(memo(renderEditCell), params);
|
|
3140
2951
|
}
|
|
3141
2952
|
return {
|
|
3142
|
-
date: /* @__PURE__ */
|
|
3143
|
-
currency: /* @__PURE__ */
|
|
2953
|
+
date: /* @__PURE__ */ React22.createElement(DatePicker_default, { value, ...editModeComponentProps }),
|
|
2954
|
+
currency: /* @__PURE__ */ React22.createElement(
|
|
3144
2955
|
CurrencyInput_default,
|
|
3145
2956
|
{
|
|
3146
2957
|
value,
|
|
3147
2958
|
...editModeComponentProps
|
|
3148
2959
|
}
|
|
3149
2960
|
),
|
|
3150
|
-
number: /* @__PURE__ */
|
|
3151
|
-
text: /* @__PURE__ */
|
|
3152
|
-
longText: /* @__PURE__ */
|
|
3153
|
-
autocomplete: /* @__PURE__ */
|
|
2961
|
+
number: /* @__PURE__ */ React22.createElement(Input_default, { value, type: "number", ...editModeComponentProps }),
|
|
2962
|
+
text: /* @__PURE__ */ React22.createElement(Input_default, { value, type: "text", ...editModeComponentProps }),
|
|
2963
|
+
longText: /* @__PURE__ */ React22.createElement(Textarea_default, { value, ...editModeComponentProps }),
|
|
2964
|
+
autocomplete: /* @__PURE__ */ React22.createElement(
|
|
3154
2965
|
Autocomplete_default,
|
|
3155
2966
|
{
|
|
3156
2967
|
value,
|
|
@@ -3158,7 +2969,7 @@ var BodyCell = (props) => {
|
|
|
3158
2969
|
...editModeComponentProps
|
|
3159
2970
|
}
|
|
3160
2971
|
),
|
|
3161
|
-
select: /* @__PURE__ */
|
|
2972
|
+
select: /* @__PURE__ */ React22.createElement(
|
|
3162
2973
|
Select_default,
|
|
3163
2974
|
{
|
|
3164
2975
|
value,
|
|
@@ -3175,7 +2986,7 @@ var BodyCell = (props) => {
|
|
|
3175
2986
|
}
|
|
3176
2987
|
const innerText = value;
|
|
3177
2988
|
const typedComponent = {
|
|
3178
|
-
link:
|
|
2989
|
+
link: React22.createElement(linkComponentFromProps || Link, {
|
|
3179
2990
|
children: innerText,
|
|
3180
2991
|
...componentProps
|
|
3181
2992
|
})
|
|
@@ -3185,7 +2996,7 @@ var BodyCell = (props) => {
|
|
|
3185
2996
|
const getActions = props.getActions;
|
|
3186
2997
|
const CellComponent = useMemo8(() => {
|
|
3187
2998
|
if (type === "actions") {
|
|
3188
|
-
return /* @__PURE__ */
|
|
2999
|
+
return /* @__PURE__ */ React22.createElement(Stack_default, { direction: "row", gap: 1, justifyContent: "center", alignItems: "center" }, getActions?.(params));
|
|
3189
3000
|
}
|
|
3190
3001
|
return editMode && EditModeComponent ? EditModeComponent : ReadModeComponent;
|
|
3191
3002
|
}, [type, getActions, params, editMode, EditModeComponent, ReadModeComponent]);
|
|
@@ -3195,10 +3006,10 @@ var BodyCell = (props) => {
|
|
|
3195
3006
|
() => (typeof cellClassName === "function" ? cellClassName(params) : cellClassName) || "",
|
|
3196
3007
|
[cellClassName, params]
|
|
3197
3008
|
);
|
|
3198
|
-
|
|
3009
|
+
useEffect4(() => {
|
|
3199
3010
|
setValue(row[field]);
|
|
3200
3011
|
}, [row, field]);
|
|
3201
|
-
return /* @__PURE__ */
|
|
3012
|
+
return /* @__PURE__ */ React22.createElement(
|
|
3202
3013
|
StyledTd,
|
|
3203
3014
|
{
|
|
3204
3015
|
ref: cellRef,
|
|
@@ -3216,7 +3027,7 @@ var BodyCell = (props) => {
|
|
|
3216
3027
|
className: [isLastStartPinnedColumn && "is-last-left", isLastEndPinnedColumn && "is-last-right", computedCellClassName].filter(Boolean).join(" ") || ""
|
|
3217
3028
|
},
|
|
3218
3029
|
useMemo8(
|
|
3219
|
-
() => showTooltip ? /* @__PURE__ */
|
|
3030
|
+
() => showTooltip ? /* @__PURE__ */ React22.createElement(CellTextEllipsis, null, CellComponent) : CellComponent,
|
|
3220
3031
|
[CellComponent, showTooltip]
|
|
3221
3032
|
)
|
|
3222
3033
|
);
|
|
@@ -3224,7 +3035,7 @@ var BodyCell = (props) => {
|
|
|
3224
3035
|
var BodyRow = memo(
|
|
3225
3036
|
(props) => {
|
|
3226
3037
|
const { tableId, columns, rowId, editMode, noWrap, row } = props;
|
|
3227
|
-
return /* @__PURE__ */
|
|
3038
|
+
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, columns.map((column, i) => /* @__PURE__ */ React22.createElement(
|
|
3228
3039
|
BodyCell,
|
|
3229
3040
|
{
|
|
3230
3041
|
key: `${rowId}_${column.field.toString()}_${i}`,
|
|
@@ -3237,11 +3048,39 @@ var BodyRow = memo(
|
|
|
3237
3048
|
}
|
|
3238
3049
|
)));
|
|
3239
3050
|
}
|
|
3240
|
-
);
|
|
3051
|
+
);
|
|
3052
|
+
var StyledTableRow2 = styled12("tr", {
|
|
3053
|
+
name: "DataTable",
|
|
3054
|
+
slot: "tableRow",
|
|
3055
|
+
shouldForwardProp: (prop) => prop !== "striped"
|
|
3056
|
+
})(({ striped }) => ({
|
|
3057
|
+
...striped && {
|
|
3058
|
+
backgroundColor: "var(--TableRow-stripeBackground, var(--ceed-palette-background-level2))",
|
|
3059
|
+
color: "var(--ceed-palette-text-primary)",
|
|
3060
|
+
"& td": {
|
|
3061
|
+
backgroundColor: "background.surface"
|
|
3062
|
+
}
|
|
3063
|
+
},
|
|
3064
|
+
"&:hover": {
|
|
3065
|
+
backgroundColor: "var(--TableRow-hoverBackground, var(--ceed-palette-background-level3))",
|
|
3066
|
+
"& td": {
|
|
3067
|
+
backgroundColor: "var(--TableRow-hoverBackground, var(--ceed-palette-background-level3))"
|
|
3068
|
+
}
|
|
3069
|
+
}
|
|
3070
|
+
}));
|
|
3071
|
+
var VirtualizedTableRow = memo(StyledTableRow2, (prevProps, nextProps) => {
|
|
3072
|
+
return prevProps.striped === nextProps.striped && prevProps.style?.height === nextProps.style?.height && prevProps.style?.transform === nextProps.style?.transform && // @ts-ignore
|
|
3073
|
+
prevProps["data-row-id"] === nextProps["data-row-id"] && // @ts-ignore
|
|
3074
|
+
prevProps["data-index"] === nextProps["data-index"] && prevProps.tabIndex === nextProps.tabIndex && prevProps["aria-checked"] === nextProps["aria-checked"] && // Include children check to handle isCellEditable changes
|
|
3075
|
+
prevProps.children === nextProps.children;
|
|
3076
|
+
});
|
|
3077
|
+
|
|
3078
|
+
// src/components/DataTable/hooks.ts
|
|
3079
|
+
import { useState as useState7, useLayoutEffect as useLayoutEffect2, useRef as useRef5, useMemo as useMemo9, useCallback as useCallback9, useEffect as useEffect5, createRef } from "react";
|
|
3241
3080
|
function useColumnWidths(columnsByField) {
|
|
3242
|
-
const [widths, setWidths] =
|
|
3243
|
-
const roRef =
|
|
3244
|
-
|
|
3081
|
+
const [widths, setWidths] = useState7({});
|
|
3082
|
+
const roRef = useRef5();
|
|
3083
|
+
useLayoutEffect2(() => {
|
|
3245
3084
|
if (roRef.current) roRef.current.disconnect();
|
|
3246
3085
|
roRef.current = new ResizeObserver((entries) => {
|
|
3247
3086
|
let changed = false;
|
|
@@ -3289,33 +3128,32 @@ function useDataTableRenderer({
|
|
|
3289
3128
|
isTotalSelected: _isTotalSelected,
|
|
3290
3129
|
isRowSelectable,
|
|
3291
3130
|
columnGroupingModel
|
|
3292
|
-
// Add this prop
|
|
3293
3131
|
}) {
|
|
3294
3132
|
if (pinnedColumns && columnGroupingModel) {
|
|
3295
3133
|
throw new Error(
|
|
3296
3134
|
"You cannot use both `pinnedColumns` and `columnGroupingModel` at the same time. Please choose one of them."
|
|
3297
3135
|
);
|
|
3298
3136
|
}
|
|
3299
|
-
const onSelectionModelChangeRef =
|
|
3137
|
+
const onSelectionModelChangeRef = useRef5(onSelectionModelChange);
|
|
3300
3138
|
onSelectionModelChangeRef.current = onSelectionModelChange;
|
|
3301
|
-
const [focusedRowId, setFocusedRowId] =
|
|
3139
|
+
const [focusedRowId, setFocusedRowId] = useState7(null);
|
|
3302
3140
|
const [sortModel, setSortModel] = useControlledState(
|
|
3303
3141
|
controlledSortModel,
|
|
3304
3142
|
initialState?.sorting?.sortModel ?? [],
|
|
3305
3143
|
useCallback9((sortModel2) => onSortModelChange?.(sortModel2), [onSortModelChange])
|
|
3306
3144
|
);
|
|
3307
|
-
const reorderedColumns =
|
|
3145
|
+
const reorderedColumns = useMemo9(() => {
|
|
3308
3146
|
if (!columnGroupingModel) return columnsProp;
|
|
3309
3147
|
return reorderColumnsByGroupingModel(columnsProp, columnGroupingModel);
|
|
3310
3148
|
}, [columnsProp, columnGroupingModel]);
|
|
3311
|
-
const columnsByField =
|
|
3149
|
+
const columnsByField = useMemo9(
|
|
3312
3150
|
() => reorderedColumns.reduce(
|
|
3313
3151
|
(acc, curr) => ({
|
|
3314
3152
|
...acc,
|
|
3315
3153
|
[curr.field]: {
|
|
3316
3154
|
...curr,
|
|
3317
|
-
headerRef:
|
|
3318
|
-
tableColRef:
|
|
3155
|
+
headerRef: createRef(),
|
|
3156
|
+
tableColRef: createRef()
|
|
3319
3157
|
}
|
|
3320
3158
|
}),
|
|
3321
3159
|
{}
|
|
@@ -3350,47 +3188,42 @@ function useDataTableRenderer({
|
|
|
3350
3188
|
},
|
|
3351
3189
|
[sortModel, columnsByField]
|
|
3352
3190
|
);
|
|
3353
|
-
const rows =
|
|
3191
|
+
const rows = useMemo9(
|
|
3354
3192
|
() => sortModel.length ? [..._rows].sort(sortComparator) : _rows,
|
|
3355
3193
|
[_rows, sortModel, sortComparator]
|
|
3356
3194
|
);
|
|
3357
|
-
const sortOrder =
|
|
3358
|
-
// NOTE: default value를 props destructuring에서 할당하면 렌더링 시점에 초기화가 되어버린다.
|
|
3195
|
+
const sortOrder = useMemo9(
|
|
3359
3196
|
() => Array.from(new Set(_sortOrder || ["asc", "desc", null])),
|
|
3360
3197
|
[_sortOrder]
|
|
3361
3198
|
);
|
|
3362
|
-
const [page, setPage] =
|
|
3199
|
+
const [page, setPage] = useState7(paginationModel?.page || 1);
|
|
3363
3200
|
const pageSize = paginationModel?.pageSize || 20;
|
|
3364
3201
|
const getId = useCallback9(
|
|
3365
3202
|
(row, index) => _getId?.(row) ?? row.id ?? `${(index || 0) + (page - 1) * pageSize}`,
|
|
3366
3203
|
[_getId, page, pageSize]
|
|
3367
3204
|
);
|
|
3368
|
-
const selectedModelSet =
|
|
3369
|
-
|
|
3370
|
-
() => new Set(selectionModel || []),
|
|
3371
|
-
[selectionModel]
|
|
3372
|
-
);
|
|
3373
|
-
const dataInPage = useMemo8(
|
|
3205
|
+
const selectedModelSet = useMemo9(() => new Set(selectionModel || []), [selectionModel]);
|
|
3206
|
+
const dataInPage = useMemo9(
|
|
3374
3207
|
() => !pagination || paginationMode === "server" ? rows : rows.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize),
|
|
3375
3208
|
[rows, page, pageSize, paginationMode, pagination]
|
|
3376
3209
|
);
|
|
3377
|
-
const selectableDataInPage =
|
|
3210
|
+
const selectableDataInPage = useMemo9(
|
|
3378
3211
|
() => dataInPage.filter((row, i) => {
|
|
3379
3212
|
if (!isRowSelectable) return true;
|
|
3380
3213
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
3381
3214
|
}),
|
|
3382
3215
|
[dataInPage, isRowSelectable, getId]
|
|
3383
3216
|
);
|
|
3384
|
-
const isAllSelected =
|
|
3217
|
+
const isAllSelected = useMemo9(
|
|
3385
3218
|
() => selectableDataInPage.length > 0 && selectableDataInPage.every((row, i) => selectedModelSet.has(getId(row, i))),
|
|
3386
3219
|
[selectableDataInPage, selectedModelSet, getId]
|
|
3387
3220
|
);
|
|
3388
3221
|
const rowCount = totalRowsProp || rows.length;
|
|
3389
|
-
const selectableRowCount =
|
|
3222
|
+
const selectableRowCount = useMemo9(() => {
|
|
3390
3223
|
if (!isRowSelectable) return rowCount;
|
|
3391
3224
|
return rows.filter((row, i) => isRowSelectable({ row, id: getId(row, i) })).length;
|
|
3392
3225
|
}, [rows, isRowSelectable, getId, rowCount]);
|
|
3393
|
-
const isTotalSelected =
|
|
3226
|
+
const isTotalSelected = useMemo9(
|
|
3394
3227
|
() => _isTotalSelected ?? (selectableRowCount > 0 && (selectionModel?.length || 0) === selectableRowCount),
|
|
3395
3228
|
[_isTotalSelected, selectionModel, selectableRowCount]
|
|
3396
3229
|
);
|
|
@@ -3400,17 +3233,14 @@ function useDataTableRenderer({
|
|
|
3400
3233
|
columnsByField[f].minWidth ?? 0,
|
|
3401
3234
|
[columnWidths, columnsByField]
|
|
3402
3235
|
);
|
|
3403
|
-
const processedColumnGroups =
|
|
3236
|
+
const processedColumnGroups = useMemo9(() => {
|
|
3404
3237
|
if (!columnGroupingModel) return null;
|
|
3405
3238
|
return calculateColumnGroups(columnGroupingModel, reorderedColumns);
|
|
3406
3239
|
}, [columnGroupingModel, reorderedColumns]);
|
|
3407
|
-
const columns =
|
|
3408
|
-
const baseColumns = reorderedColumns.length > 0 ? reorderedColumns : (
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
field: key
|
|
3412
|
-
}))
|
|
3413
|
-
);
|
|
3240
|
+
const columns = useMemo9(() => {
|
|
3241
|
+
const baseColumns = reorderedColumns.length > 0 ? reorderedColumns : Object.keys(rows[0] || {}).map((key) => ({
|
|
3242
|
+
field: key
|
|
3243
|
+
}));
|
|
3414
3244
|
return baseColumns.map((column) => {
|
|
3415
3245
|
const isLeftPinned = pinnedColumns?.left?.includes(column.field);
|
|
3416
3246
|
const isRightPinned = pinnedColumns?.right?.includes(column.field);
|
|
@@ -3425,7 +3255,6 @@ function useDataTableRenderer({
|
|
|
3425
3255
|
isPinned,
|
|
3426
3256
|
isLastStartPinnedColumn: isLeftPinned && [...pinnedColumns?.left || []].pop() === column.field,
|
|
3427
3257
|
isLastEndPinnedColumn: isRightPinned && (pinnedColumns?.right?.[0] ?? null) === column.field,
|
|
3428
|
-
// pinned 관련 계산부
|
|
3429
3258
|
pinnedStartPosition: pinnedColumns?.left?.slice(0, isLeftPinned ? pinnedColumns.left.indexOf(column.field) : pinnedColumns.left.length).reduce((acc, curr) => acc + getWidth(curr), 0),
|
|
3430
3259
|
pinnedEndPosition: pinnedColumns?.right?.slice(isRightPinned ? pinnedColumns.right.indexOf(column.field) + 1 : 0).reduce((acc, curr) => acc + getWidth(curr), 0)
|
|
3431
3260
|
};
|
|
@@ -3497,7 +3326,6 @@ function useDataTableRenderer({
|
|
|
3497
3326
|
dataInPage,
|
|
3498
3327
|
handleSortChange,
|
|
3499
3328
|
isAllSelected,
|
|
3500
|
-
// all rows are selected on this page
|
|
3501
3329
|
isTotalSelected,
|
|
3502
3330
|
isSelectedRow: useCallback9((model) => selectedModelSet.has(model), [selectedModelSet]),
|
|
3503
3331
|
isRowSelectable: useCallback9(
|
|
@@ -3537,6 +3365,216 @@ function useDataTableRenderer({
|
|
|
3537
3365
|
}, [isTotalSelected, rows, onSelectionModelChange, getId, isRowSelectable])
|
|
3538
3366
|
};
|
|
3539
3367
|
}
|
|
3368
|
+
|
|
3369
|
+
// src/components/Table/Table.tsx
|
|
3370
|
+
import React23 from "react";
|
|
3371
|
+
import { Table as JoyTable } from "@mui/joy";
|
|
3372
|
+
var Table = (props) => {
|
|
3373
|
+
const { children, ...inheritProps } = props;
|
|
3374
|
+
return /* @__PURE__ */ React23.createElement(JoyTable, { ...inheritProps }, children);
|
|
3375
|
+
};
|
|
3376
|
+
Table.displayName = "Table";
|
|
3377
|
+
function TableHead(props) {
|
|
3378
|
+
const {
|
|
3379
|
+
headCells,
|
|
3380
|
+
showCheckbox,
|
|
3381
|
+
onCheckboxChange,
|
|
3382
|
+
slots: { checkbox: RenderCheckbox = Checkbox_default } = {},
|
|
3383
|
+
slotProps: { checkbox: checkboxProps = {} } = {}
|
|
3384
|
+
} = props;
|
|
3385
|
+
return /* @__PURE__ */ React23.createElement("thead", null, /* @__PURE__ */ React23.createElement("tr", null, showCheckbox && /* @__PURE__ */ React23.createElement(
|
|
3386
|
+
"th",
|
|
3387
|
+
{
|
|
3388
|
+
style: {
|
|
3389
|
+
width: "40px",
|
|
3390
|
+
textAlign: "center"
|
|
3391
|
+
}
|
|
3392
|
+
},
|
|
3393
|
+
/* @__PURE__ */ React23.createElement(RenderCheckbox, { onChange: onCheckboxChange, ...checkboxProps })
|
|
3394
|
+
), headCells.map((headCell) => /* @__PURE__ */ React23.createElement(
|
|
3395
|
+
"th",
|
|
3396
|
+
{
|
|
3397
|
+
key: headCell.label,
|
|
3398
|
+
style: {
|
|
3399
|
+
width: headCell.width,
|
|
3400
|
+
minWidth: headCell.minWidth,
|
|
3401
|
+
maxWidth: headCell.maxWidth,
|
|
3402
|
+
textAlign: headCell.numeric ? "right" : "left"
|
|
3403
|
+
}
|
|
3404
|
+
},
|
|
3405
|
+
headCell.label
|
|
3406
|
+
))));
|
|
3407
|
+
}
|
|
3408
|
+
TableHead.displayName = "TableHead";
|
|
3409
|
+
function TableBody(props) {
|
|
3410
|
+
const {
|
|
3411
|
+
rows,
|
|
3412
|
+
cellOrder,
|
|
3413
|
+
rowOptions,
|
|
3414
|
+
showCheckbox,
|
|
3415
|
+
onCheckboxChange,
|
|
3416
|
+
slots: { checkbox: RenderCheckbox = Checkbox_default } = {},
|
|
3417
|
+
slotProps: { checkbox: checkboxProps = {} } = {}
|
|
3418
|
+
} = props;
|
|
3419
|
+
return /* @__PURE__ */ React23.createElement("tbody", null, rows.map((row, rowIndex) => /* @__PURE__ */ React23.createElement("tr", { key: `table-row-${rowIndex}` }, showCheckbox && /* @__PURE__ */ React23.createElement(
|
|
3420
|
+
"td",
|
|
3421
|
+
{
|
|
3422
|
+
style: {
|
|
3423
|
+
textAlign: "center"
|
|
3424
|
+
}
|
|
3425
|
+
},
|
|
3426
|
+
/* @__PURE__ */ React23.createElement(RenderCheckbox, { onChange: (event) => onCheckboxChange?.(event, rowIndex), ...checkboxProps })
|
|
3427
|
+
), cellOrder.map((cellKey) => /* @__PURE__ */ React23.createElement(
|
|
3428
|
+
"td",
|
|
3429
|
+
{
|
|
3430
|
+
key: cellKey,
|
|
3431
|
+
style: {
|
|
3432
|
+
textAlign: rowOptions?.[cellKey]?.numeric ? "right" : "left"
|
|
3433
|
+
}
|
|
3434
|
+
},
|
|
3435
|
+
row[cellKey]
|
|
3436
|
+
)))));
|
|
3437
|
+
}
|
|
3438
|
+
TableBody.displayName = "TableBody";
|
|
3439
|
+
|
|
3440
|
+
// src/components/Pagination/Pagination.tsx
|
|
3441
|
+
import React24, { useCallback as useCallback10, useEffect as useEffect6 } from "react";
|
|
3442
|
+
import PreviousIcon from "@mui/icons-material/ChevronLeft";
|
|
3443
|
+
import NextIcon from "@mui/icons-material/ChevronRight";
|
|
3444
|
+
import { styled as styled13 } from "@mui/joy";
|
|
3445
|
+
var PaginationButton = styled13(Button_default, {
|
|
3446
|
+
name: "Pagination",
|
|
3447
|
+
slot: "button"
|
|
3448
|
+
})(({ theme, active, size }) => ({
|
|
3449
|
+
"--Button-size": {
|
|
3450
|
+
sm: "32px",
|
|
3451
|
+
md: "40px",
|
|
3452
|
+
lg: "48px"
|
|
3453
|
+
}[size],
|
|
3454
|
+
width: "var(--Button-size)",
|
|
3455
|
+
height: "var(--Button-size)",
|
|
3456
|
+
backgroundColor: active ? theme.vars.palette.primary.softHoverBg : "transparent",
|
|
3457
|
+
color: active ? theme.vars.palette.primary.softColor : theme.vars.palette.neutral.plainColor,
|
|
3458
|
+
"&:hover": {
|
|
3459
|
+
color: active ? theme.vars.palette.primary.softColor : theme.vars.palette.neutral.softColor,
|
|
3460
|
+
backgroundColor: active ? theme.vars.palette.primary.softActiveBg : theme.vars.palette.neutral.softHoverBg
|
|
3461
|
+
}
|
|
3462
|
+
}));
|
|
3463
|
+
var PaginationIconButton = styled13(IconButton_default, {
|
|
3464
|
+
name: "Pagination",
|
|
3465
|
+
slot: "button"
|
|
3466
|
+
})(({ theme, size }) => ({
|
|
3467
|
+
"--IconButton-size": {
|
|
3468
|
+
sm: "32px",
|
|
3469
|
+
md: "40px",
|
|
3470
|
+
lg: "48px"
|
|
3471
|
+
}[size],
|
|
3472
|
+
"--Icon-fontSize": "20px",
|
|
3473
|
+
width: "var(--IconButton-size)",
|
|
3474
|
+
height: "var(--IconButton-size)",
|
|
3475
|
+
color: theme.vars.palette.neutral.plainColor,
|
|
3476
|
+
"&:hover": {
|
|
3477
|
+
color: theme.vars.palette.neutral.softColor,
|
|
3478
|
+
backgroundColor: theme.vars.palette.neutral.softHoverBg
|
|
3479
|
+
}
|
|
3480
|
+
}));
|
|
3481
|
+
var PaginationRoot = styled13(Stack_default, {
|
|
3482
|
+
name: "Pagination",
|
|
3483
|
+
slot: "root"
|
|
3484
|
+
})({});
|
|
3485
|
+
var PaginationContainer = styled13(Stack_default, {
|
|
3486
|
+
name: "Pagination",
|
|
3487
|
+
slot: "container"
|
|
3488
|
+
})(({ theme, size }) => ({
|
|
3489
|
+
gap: {
|
|
3490
|
+
sm: theme.spacing(1),
|
|
3491
|
+
md: theme.spacing(1.5),
|
|
3492
|
+
lg: theme.spacing(2)
|
|
3493
|
+
}[size]
|
|
3494
|
+
}));
|
|
3495
|
+
function Pagination(props) {
|
|
3496
|
+
const {
|
|
3497
|
+
paginationModel: _paginationModel,
|
|
3498
|
+
defaultPaginationModel = { page: 1, pageSize: 25 },
|
|
3499
|
+
onPageChange,
|
|
3500
|
+
rowCount,
|
|
3501
|
+
size = "md",
|
|
3502
|
+
...innerProps
|
|
3503
|
+
} = props;
|
|
3504
|
+
const [paginationModel, setPaginationModel] = useControlledState(
|
|
3505
|
+
_paginationModel,
|
|
3506
|
+
defaultPaginationModel,
|
|
3507
|
+
useCallback10(
|
|
3508
|
+
(newPage) => {
|
|
3509
|
+
onPageChange(newPage.page);
|
|
3510
|
+
},
|
|
3511
|
+
[onPageChange]
|
|
3512
|
+
)
|
|
3513
|
+
);
|
|
3514
|
+
const handlePageChange = (newPage) => {
|
|
3515
|
+
setPaginationModel({ ...paginationModel, page: newPage });
|
|
3516
|
+
};
|
|
3517
|
+
const firstPage = 1;
|
|
3518
|
+
const lastPage = Math.max(firstPage, Math.ceil(rowCount / paginationModel.pageSize));
|
|
3519
|
+
const beforePages = [paginationModel.page - 2, paginationModel.page - 1].filter((p) => p > 1);
|
|
3520
|
+
const afterPages = [paginationModel.page + 1, paginationModel.page + 2].filter((p) => p <= lastPage - 1);
|
|
3521
|
+
const isMoreAfterPages = lastPage > 1 && paginationModel.page < lastPage - 3;
|
|
3522
|
+
const isMoreBeforePages = lastPage > 1 && paginationModel.page > 4;
|
|
3523
|
+
useEffect6(() => {
|
|
3524
|
+
if (paginationModel.page > lastPage) {
|
|
3525
|
+
setPaginationModel({ ...paginationModel, page: lastPage });
|
|
3526
|
+
}
|
|
3527
|
+
}, [rowCount, paginationModel, lastPage, setPaginationModel]);
|
|
3528
|
+
return /* @__PURE__ */ React24.createElement(PaginationRoot, { ...innerProps }, /* @__PURE__ */ React24.createElement(PaginationContainer, { direction: "row", size, alignItems: "center" }, /* @__PURE__ */ React24.createElement(
|
|
3529
|
+
PaginationIconButton,
|
|
3530
|
+
{
|
|
3531
|
+
size,
|
|
3532
|
+
variant: "plain",
|
|
3533
|
+
color: "neutral",
|
|
3534
|
+
onClick: () => handlePageChange(paginationModel.page - 1),
|
|
3535
|
+
disabled: paginationModel.page === firstPage,
|
|
3536
|
+
"aria-label": "Previous page"
|
|
3537
|
+
},
|
|
3538
|
+
/* @__PURE__ */ React24.createElement(PreviousIcon, null)
|
|
3539
|
+
), paginationModel.page !== firstPage && /* @__PURE__ */ React24.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(firstPage) }, firstPage), isMoreBeforePages && /* @__PURE__ */ React24.createElement(
|
|
3540
|
+
PaginationButton,
|
|
3541
|
+
{
|
|
3542
|
+
size,
|
|
3543
|
+
variant: "plain",
|
|
3544
|
+
color: "neutral",
|
|
3545
|
+
onClick: () => handlePageChange(paginationModel.page - 3),
|
|
3546
|
+
"aria-label": "More previous pages"
|
|
3547
|
+
},
|
|
3548
|
+
"..."
|
|
3549
|
+
), beforePages.map((p) => /* @__PURE__ */ React24.createElement(PaginationButton, { key: p, size, variant: "plain", color: "neutral", onClick: () => handlePageChange(p) }, p)), /* @__PURE__ */ React24.createElement(PaginationButton, { active: "active", size, "aria-current": "page" }, paginationModel.page), afterPages.map((p) => /* @__PURE__ */ React24.createElement(PaginationButton, { key: p, size, variant: "plain", color: "neutral", onClick: () => handlePageChange(p) }, p)), isMoreAfterPages && /* @__PURE__ */ React24.createElement(
|
|
3550
|
+
PaginationButton,
|
|
3551
|
+
{
|
|
3552
|
+
size,
|
|
3553
|
+
variant: "plain",
|
|
3554
|
+
color: "neutral",
|
|
3555
|
+
"aria-label": "More next pages",
|
|
3556
|
+
onClick: () => handlePageChange(paginationModel.page + 3)
|
|
3557
|
+
},
|
|
3558
|
+
"..."
|
|
3559
|
+
), paginationModel.page !== lastPage && /* @__PURE__ */ React24.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(lastPage) }, lastPage), /* @__PURE__ */ React24.createElement(
|
|
3560
|
+
PaginationIconButton,
|
|
3561
|
+
{
|
|
3562
|
+
size,
|
|
3563
|
+
variant: "plain",
|
|
3564
|
+
color: "neutral",
|
|
3565
|
+
onClick: () => handlePageChange(paginationModel.page + 1),
|
|
3566
|
+
disabled: paginationModel.page === lastPage,
|
|
3567
|
+
"aria-label": "Next page"
|
|
3568
|
+
},
|
|
3569
|
+
/* @__PURE__ */ React24.createElement(NextIcon, null)
|
|
3570
|
+
)));
|
|
3571
|
+
}
|
|
3572
|
+
Pagination.displayName = "Pagination";
|
|
3573
|
+
|
|
3574
|
+
// src/components/Pagination/index.ts
|
|
3575
|
+
var Pagination_default = Pagination;
|
|
3576
|
+
|
|
3577
|
+
// src/components/DataTable/DataTable.tsx
|
|
3540
3578
|
function Component(props, apiRef) {
|
|
3541
3579
|
const {
|
|
3542
3580
|
rows,
|
|
@@ -3584,8 +3622,8 @@ function Component(props, apiRef) {
|
|
|
3584
3622
|
...innerProps
|
|
3585
3623
|
} = props;
|
|
3586
3624
|
const tableId = useId();
|
|
3587
|
-
const parentRef =
|
|
3588
|
-
const tableBodyRef =
|
|
3625
|
+
const parentRef = useRef6(null);
|
|
3626
|
+
const tableBodyRef = useRef6(null);
|
|
3589
3627
|
const {
|
|
3590
3628
|
columns,
|
|
3591
3629
|
processedColumnGroups,
|
|
@@ -3616,29 +3654,29 @@ function Component(props, apiRef) {
|
|
|
3616
3654
|
measureElement: (element) => element.clientHeight,
|
|
3617
3655
|
overscan: 10
|
|
3618
3656
|
});
|
|
3619
|
-
const paginationModel =
|
|
3657
|
+
const paginationModel = useMemo10(() => ({ page, pageSize }), [page, pageSize]);
|
|
3620
3658
|
const totalSize = virtualizer.getTotalSize();
|
|
3621
3659
|
const virtualizedItems = virtualizer.getVirtualItems();
|
|
3622
|
-
const getRowClickHandler =
|
|
3660
|
+
const getRowClickHandler = useCallback11(
|
|
3623
3661
|
(row, rowId) => (e) => {
|
|
3624
3662
|
onRowClick?.({ row, rowId }, e);
|
|
3625
3663
|
checkboxSelection && !disableSelectionOnClick && isRowSelectableCheck(rowId, row) && onCheckboxChange(e, rowId);
|
|
3626
3664
|
},
|
|
3627
3665
|
[onRowClick, checkboxSelection, disableSelectionOnClick, onCheckboxChange, isRowSelectableCheck]
|
|
3628
3666
|
);
|
|
3629
|
-
const getRowFocusHandler =
|
|
3667
|
+
const getRowFocusHandler = useCallback11(
|
|
3630
3668
|
(rowId) => () => {
|
|
3631
3669
|
onRowFocus(rowId);
|
|
3632
3670
|
},
|
|
3633
3671
|
[onRowFocus]
|
|
3634
3672
|
);
|
|
3635
|
-
const getCheckboxClickHandler =
|
|
3673
|
+
const getCheckboxClickHandler = useCallback11(
|
|
3636
3674
|
() => (e) => {
|
|
3637
3675
|
e.stopPropagation();
|
|
3638
3676
|
},
|
|
3639
3677
|
[]
|
|
3640
3678
|
);
|
|
3641
|
-
const getCheckboxChangeHandler =
|
|
3679
|
+
const getCheckboxChangeHandler = useCallback11(
|
|
3642
3680
|
(rowId, row) => (e) => {
|
|
3643
3681
|
if (isRowSelectableCheck(rowId, row)) {
|
|
3644
3682
|
onCheckboxChange(e, rowId);
|
|
@@ -3662,7 +3700,7 @@ function Component(props, apiRef) {
|
|
|
3662
3700
|
});
|
|
3663
3701
|
}
|
|
3664
3702
|
}));
|
|
3665
|
-
return /* @__PURE__ */
|
|
3703
|
+
return /* @__PURE__ */ React25.createElement(
|
|
3666
3704
|
Box_default,
|
|
3667
3705
|
{
|
|
3668
3706
|
sx: {
|
|
@@ -3672,7 +3710,7 @@ function Component(props, apiRef) {
|
|
|
3672
3710
|
flexDirection: "column"
|
|
3673
3711
|
}
|
|
3674
3712
|
},
|
|
3675
|
-
(!!checkboxSelection || !!Toolbar) && /* @__PURE__ */
|
|
3713
|
+
(!!checkboxSelection || !!Toolbar) && /* @__PURE__ */ React25.createElement(
|
|
3676
3714
|
Stack_default,
|
|
3677
3715
|
{
|
|
3678
3716
|
direction: "row",
|
|
@@ -3682,10 +3720,10 @@ function Component(props, apiRef) {
|
|
|
3682
3720
|
justifyContent: "space-between",
|
|
3683
3721
|
alignItems: "center"
|
|
3684
3722
|
},
|
|
3685
|
-
!!checkboxSelection && /* @__PURE__ */
|
|
3686
|
-
Toolbar && /* @__PURE__ */
|
|
3723
|
+
!!checkboxSelection && /* @__PURE__ */ React25.createElement(Stack_default, { direction: "row", spacing: 1 }, !isAllSelected && /* @__PURE__ */ React25.createElement(Typography_default, { level: "body-xs" }, numberFormatter(selectionModel?.length || 0), " items selected"), isAllSelected && !isTotalSelected && /* @__PURE__ */ React25.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React25.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectionModel?.length || 0), " items on this page are selected."), /* @__PURE__ */ React25.createElement(Button_default, { size: "sm", variant: "plain", onClick: onTotalSelect }, "Select all ", numberFormatter(selectableRowCount), " items")), isTotalSelected && /* @__PURE__ */ React25.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React25.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectableRowCount), " items are selected."), /* @__PURE__ */ React25.createElement(Button_default, { size: "sm", variant: "plain", color: "danger", onClick: onTotalSelect }, "Cancel"))),
|
|
3724
|
+
Toolbar && /* @__PURE__ */ React25.createElement(Toolbar, { ...toolbarProps || {} })
|
|
3687
3725
|
),
|
|
3688
|
-
/* @__PURE__ */
|
|
3726
|
+
/* @__PURE__ */ React25.createElement(
|
|
3689
3727
|
Sheet_default,
|
|
3690
3728
|
{
|
|
3691
3729
|
variant: "outlined",
|
|
@@ -3706,14 +3744,14 @@ function Component(props, apiRef) {
|
|
|
3706
3744
|
ref: parentRef,
|
|
3707
3745
|
...backgroundProps
|
|
3708
3746
|
},
|
|
3709
|
-
/* @__PURE__ */
|
|
3747
|
+
/* @__PURE__ */ React25.createElement(Table, { ...innerProps }, /* @__PURE__ */ React25.createElement("colgroup", null, checkboxSelection && /* @__PURE__ */ React25.createElement(
|
|
3710
3748
|
"col",
|
|
3711
3749
|
{
|
|
3712
3750
|
style: {
|
|
3713
3751
|
width: "40px"
|
|
3714
3752
|
}
|
|
3715
3753
|
}
|
|
3716
|
-
), columns.map((c) => /* @__PURE__ */
|
|
3754
|
+
), columns.map((c) => /* @__PURE__ */ React25.createElement(
|
|
3717
3755
|
"col",
|
|
3718
3756
|
{
|
|
3719
3757
|
ref: c.tableColRef,
|
|
@@ -3722,7 +3760,7 @@ function Component(props, apiRef) {
|
|
|
3722
3760
|
width: c.width
|
|
3723
3761
|
}
|
|
3724
3762
|
}
|
|
3725
|
-
))), /* @__PURE__ */
|
|
3763
|
+
))), /* @__PURE__ */ React25.createElement("thead", null, processedColumnGroups && processedColumnGroups.groups.map((levelGroups, level) => /* @__PURE__ */ React25.createElement("tr", { key: `group-level-${level}` }, checkboxSelection && level === 0 && /* @__PURE__ */ React25.createElement(
|
|
3726
3764
|
"th",
|
|
3727
3765
|
{
|
|
3728
3766
|
rowSpan: processedColumnGroups.maxLevel + 2,
|
|
@@ -3732,7 +3770,7 @@ function Component(props, apiRef) {
|
|
|
3732
3770
|
verticalAlign: "middle"
|
|
3733
3771
|
}
|
|
3734
3772
|
},
|
|
3735
|
-
/* @__PURE__ */
|
|
3773
|
+
/* @__PURE__ */ React25.createElement(
|
|
3736
3774
|
RenderCheckbox,
|
|
3737
3775
|
{
|
|
3738
3776
|
onChange: onAllCheckboxChange,
|
|
@@ -3742,10 +3780,12 @@ function Component(props, apiRef) {
|
|
|
3742
3780
|
...checkboxProps
|
|
3743
3781
|
}
|
|
3744
3782
|
)
|
|
3745
|
-
), level > 0 && Array.from({ length: levelGroups[0]?.startIndex || 0 }).map((_2, i) => /* @__PURE__ */
|
|
3783
|
+
), level > 0 && Array.from({ length: levelGroups[0]?.startIndex || 0 }).map((_2, i) => /* @__PURE__ */ React25.createElement("th", { key: `empty-${level}-${i}` })), levelGroups.map((group, groupIndex) => {
|
|
3746
3784
|
const nextGroup = levelGroups[groupIndex + 1];
|
|
3747
3785
|
const emptyCells = nextGroup ? nextGroup.startIndex - (group.startIndex + group.colspan) : columns.length - (group.startIndex + group.colspan);
|
|
3748
|
-
|
|
3786
|
+
const params = { groupId: group.groupId };
|
|
3787
|
+
const computedHeaderClassName = group.headerClassName ? typeof group.headerClassName === "function" ? group.headerClassName(params) : group.headerClassName : void 0;
|
|
3788
|
+
return /* @__PURE__ */ React25.createElement(Fragment2, { key: group.groupId }, /* @__PURE__ */ React25.createElement(
|
|
3749
3789
|
"th",
|
|
3750
3790
|
{
|
|
3751
3791
|
colSpan: group.colspan,
|
|
@@ -3753,11 +3793,12 @@ function Component(props, apiRef) {
|
|
|
3753
3793
|
textAlign: "center",
|
|
3754
3794
|
fontWeight: "bold",
|
|
3755
3795
|
verticalAlign: "middle"
|
|
3756
|
-
}
|
|
3796
|
+
},
|
|
3797
|
+
className: computedHeaderClassName
|
|
3757
3798
|
},
|
|
3758
3799
|
group.headerName ?? group.groupId
|
|
3759
|
-
), emptyCells > 0 && Array.from({ length: emptyCells }).map((_2, i) => /* @__PURE__ */
|
|
3760
|
-
}))), /* @__PURE__ */
|
|
3800
|
+
), emptyCells > 0 && Array.from({ length: emptyCells }).map((_2, i) => /* @__PURE__ */ React25.createElement("th", { key: `empty-between-${level}-${groupIndex}-${i}`, colSpan: 1 })));
|
|
3801
|
+
}))), /* @__PURE__ */ React25.createElement("tr", null, !processedColumnGroups && checkboxSelection && /* @__PURE__ */ React25.createElement(
|
|
3761
3802
|
"th",
|
|
3762
3803
|
{
|
|
3763
3804
|
style: {
|
|
@@ -3765,7 +3806,7 @@ function Component(props, apiRef) {
|
|
|
3765
3806
|
textAlign: "center"
|
|
3766
3807
|
}
|
|
3767
3808
|
},
|
|
3768
|
-
/* @__PURE__ */
|
|
3809
|
+
/* @__PURE__ */ React25.createElement(
|
|
3769
3810
|
RenderCheckbox,
|
|
3770
3811
|
{
|
|
3771
3812
|
onChange: onAllCheckboxChange,
|
|
@@ -3777,7 +3818,7 @@ function Component(props, apiRef) {
|
|
|
3777
3818
|
)
|
|
3778
3819
|
), columns.map((c, i) => (
|
|
3779
3820
|
// @ts-ignore
|
|
3780
|
-
/* @__PURE__ */
|
|
3821
|
+
/* @__PURE__ */ React25.createElement(
|
|
3781
3822
|
HeadCell2,
|
|
3782
3823
|
{
|
|
3783
3824
|
tableId,
|
|
@@ -3788,7 +3829,7 @@ function Component(props, apiRef) {
|
|
|
3788
3829
|
...c
|
|
3789
3830
|
}
|
|
3790
3831
|
)
|
|
3791
|
-
)))), /* @__PURE__ */
|
|
3832
|
+
)))), /* @__PURE__ */ React25.createElement(
|
|
3792
3833
|
VirtualizedTableBody,
|
|
3793
3834
|
{
|
|
3794
3835
|
ref: tableBodyRef,
|
|
@@ -3798,7 +3839,7 @@ function Component(props, apiRef) {
|
|
|
3798
3839
|
role: "rowgroup",
|
|
3799
3840
|
"aria-label": "DataTableBody"
|
|
3800
3841
|
},
|
|
3801
|
-
!!loading && /* @__PURE__ */
|
|
3842
|
+
!!loading && /* @__PURE__ */ React25.createElement(OverlayWrapper, null, /* @__PURE__ */ React25.createElement(
|
|
3802
3843
|
"td",
|
|
3803
3844
|
{
|
|
3804
3845
|
style: {
|
|
@@ -3807,7 +3848,7 @@ function Component(props, apiRef) {
|
|
|
3807
3848
|
overflow: "visible"
|
|
3808
3849
|
}
|
|
3809
3850
|
},
|
|
3810
|
-
/* @__PURE__ */
|
|
3851
|
+
/* @__PURE__ */ React25.createElement(
|
|
3811
3852
|
Box_default,
|
|
3812
3853
|
{
|
|
3813
3854
|
sx: {
|
|
@@ -3817,7 +3858,7 @@ function Component(props, apiRef) {
|
|
|
3817
3858
|
right: 0
|
|
3818
3859
|
}
|
|
3819
3860
|
},
|
|
3820
|
-
/* @__PURE__ */
|
|
3861
|
+
/* @__PURE__ */ React25.createElement(LoadingOverlay, null)
|
|
3821
3862
|
)
|
|
3822
3863
|
)),
|
|
3823
3864
|
virtualizedItems.map((virtualizedRow, index) => {
|
|
@@ -3825,7 +3866,7 @@ function Component(props, apiRef) {
|
|
|
3825
3866
|
const row = dataInPage[rowIndex];
|
|
3826
3867
|
const rowId = getId(row, rowIndex);
|
|
3827
3868
|
const striped = stripe && (stripe === "even" && (rowIndex + 1) % 2 === 0 || stripe === "odd" && (rowIndex + 1) % 2 === 1);
|
|
3828
|
-
return /* @__PURE__ */
|
|
3869
|
+
return /* @__PURE__ */ React25.createElement(
|
|
3829
3870
|
VirtualizedTableRow,
|
|
3830
3871
|
{
|
|
3831
3872
|
key: virtualizedRow.key,
|
|
@@ -3843,7 +3884,7 @@ function Component(props, apiRef) {
|
|
|
3843
3884
|
transform: `translateY(${virtualizedRow.start - index * virtualizedRow.size}px)`
|
|
3844
3885
|
}
|
|
3845
3886
|
},
|
|
3846
|
-
checkboxSelection && /* @__PURE__ */
|
|
3887
|
+
checkboxSelection && /* @__PURE__ */ React25.createElement(
|
|
3847
3888
|
"th",
|
|
3848
3889
|
{
|
|
3849
3890
|
scope: "row",
|
|
@@ -3851,7 +3892,7 @@ function Component(props, apiRef) {
|
|
|
3851
3892
|
textAlign: "center"
|
|
3852
3893
|
}
|
|
3853
3894
|
},
|
|
3854
|
-
/* @__PURE__ */
|
|
3895
|
+
/* @__PURE__ */ React25.createElement(
|
|
3855
3896
|
RenderCheckbox,
|
|
3856
3897
|
{
|
|
3857
3898
|
onClick: getCheckboxClickHandler(),
|
|
@@ -3862,7 +3903,7 @@ function Component(props, apiRef) {
|
|
|
3862
3903
|
}
|
|
3863
3904
|
)
|
|
3864
3905
|
),
|
|
3865
|
-
/* @__PURE__ */
|
|
3906
|
+
/* @__PURE__ */ React25.createElement(
|
|
3866
3907
|
BodyRow2,
|
|
3867
3908
|
{
|
|
3868
3909
|
tableId,
|
|
@@ -3875,9 +3916,9 @@ function Component(props, apiRef) {
|
|
|
3875
3916
|
)
|
|
3876
3917
|
);
|
|
3877
3918
|
})
|
|
3878
|
-
), Footer && /* @__PURE__ */
|
|
3919
|
+
), Footer && /* @__PURE__ */ React25.createElement(Footer, null))
|
|
3879
3920
|
),
|
|
3880
|
-
pagination && /* @__PURE__ */
|
|
3921
|
+
pagination && /* @__PURE__ */ React25.createElement(
|
|
3881
3922
|
Pagination_default,
|
|
3882
3923
|
{
|
|
3883
3924
|
pt: 2,
|
|
@@ -3894,12 +3935,12 @@ var DataTable = forwardRef7(Component);
|
|
|
3894
3935
|
DataTable.displayName = "DataTable";
|
|
3895
3936
|
|
|
3896
3937
|
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
3897
|
-
import
|
|
3938
|
+
import React26, { forwardRef as forwardRef8, useCallback as useCallback12, useEffect as useEffect7, useImperativeHandle as useImperativeHandle3, useMemo as useMemo11, useRef as useRef7, useState as useState8 } from "react";
|
|
3898
3939
|
import { IMaskInput as IMaskInput2, IMask as IMask2 } from "react-imask";
|
|
3899
3940
|
import CalendarTodayIcon2 from "@mui/icons-material/CalendarToday";
|
|
3900
|
-
import { styled as
|
|
3941
|
+
import { styled as styled14, useThemeProps as useThemeProps5 } from "@mui/joy";
|
|
3901
3942
|
import { FocusTrap as FocusTrap2, ClickAwayListener as ClickAwayListener2, Popper as Popper3 } from "@mui/base";
|
|
3902
|
-
var CalendarButton2 =
|
|
3943
|
+
var CalendarButton2 = styled14(IconButton_default, {
|
|
3903
3944
|
name: "DateRangePicker",
|
|
3904
3945
|
slot: "calendarButton"
|
|
3905
3946
|
})(({ theme }) => ({
|
|
@@ -3909,13 +3950,13 @@ var CalendarButton2 = styled13(IconButton_default, {
|
|
|
3909
3950
|
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar("palette-focusVisible")}`
|
|
3910
3951
|
}
|
|
3911
3952
|
}));
|
|
3912
|
-
var StyledPopper2 =
|
|
3953
|
+
var StyledPopper2 = styled14(Popper3, {
|
|
3913
3954
|
name: "DateRangePicker",
|
|
3914
3955
|
slot: "popper"
|
|
3915
3956
|
})(({ theme }) => ({
|
|
3916
3957
|
zIndex: theme.zIndex.tooltip
|
|
3917
3958
|
}));
|
|
3918
|
-
var CalendarSheet2 =
|
|
3959
|
+
var CalendarSheet2 = styled14(Sheet_default, {
|
|
3919
3960
|
name: "DateRangePicker",
|
|
3920
3961
|
slot: "sheet",
|
|
3921
3962
|
overridesResolver: (props, styles) => styles.root
|
|
@@ -3925,7 +3966,7 @@ var CalendarSheet2 = styled13(Sheet_default, {
|
|
|
3925
3966
|
boxShadow: theme.shadow.md,
|
|
3926
3967
|
borderRadius: theme.radius.md
|
|
3927
3968
|
}));
|
|
3928
|
-
var DateRangePickerRoot =
|
|
3969
|
+
var DateRangePickerRoot = styled14("div", {
|
|
3929
3970
|
name: "DateRangePicker",
|
|
3930
3971
|
slot: "root",
|
|
3931
3972
|
overridesResolver: (props, styles) => styles.root
|
|
@@ -3995,9 +4036,9 @@ var parseDates = (str, format) => {
|
|
|
3995
4036
|
var formatToPattern2 = (format) => {
|
|
3996
4037
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
3997
4038
|
};
|
|
3998
|
-
var TextMaskAdapter5 =
|
|
4039
|
+
var TextMaskAdapter5 = React26.forwardRef(function TextMaskAdapter6(props, ref) {
|
|
3999
4040
|
const { onChange, format, ...other } = props;
|
|
4000
|
-
return /* @__PURE__ */
|
|
4041
|
+
return /* @__PURE__ */ React26.createElement(
|
|
4001
4042
|
IMaskInput2,
|
|
4002
4043
|
{
|
|
4003
4044
|
...other,
|
|
@@ -4055,23 +4096,23 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4055
4096
|
readOnly,
|
|
4056
4097
|
...innerProps
|
|
4057
4098
|
} = props;
|
|
4058
|
-
const innerRef =
|
|
4059
|
-
const buttonRef =
|
|
4099
|
+
const innerRef = useRef7(null);
|
|
4100
|
+
const buttonRef = useRef7(null);
|
|
4060
4101
|
const [value, setValue] = useControlledState(
|
|
4061
4102
|
props.value,
|
|
4062
4103
|
props.defaultValue || "",
|
|
4063
|
-
|
|
4104
|
+
useCallback12((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
4064
4105
|
);
|
|
4065
|
-
const [displayValue, setDisplayValue] =
|
|
4106
|
+
const [displayValue, setDisplayValue] = useState8(
|
|
4066
4107
|
() => value ? formatValueString2(parseDates(value, format), displayFormat) : ""
|
|
4067
4108
|
);
|
|
4068
|
-
const [anchorEl, setAnchorEl] =
|
|
4109
|
+
const [anchorEl, setAnchorEl] = useState8(null);
|
|
4069
4110
|
const open = Boolean(anchorEl);
|
|
4070
|
-
const calendarValue =
|
|
4111
|
+
const calendarValue = useMemo11(
|
|
4071
4112
|
() => value ? parseDates(value, format) : void 0,
|
|
4072
4113
|
[value, format]
|
|
4073
4114
|
);
|
|
4074
|
-
|
|
4115
|
+
useEffect7(() => {
|
|
4075
4116
|
if (value) {
|
|
4076
4117
|
try {
|
|
4077
4118
|
const dates = parseDates(value, format);
|
|
@@ -4083,13 +4124,13 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4083
4124
|
setDisplayValue("");
|
|
4084
4125
|
}
|
|
4085
4126
|
}, [displayFormat, value, format]);
|
|
4086
|
-
|
|
4127
|
+
useEffect7(() => {
|
|
4087
4128
|
if (!anchorEl) {
|
|
4088
4129
|
innerRef.current?.blur();
|
|
4089
4130
|
}
|
|
4090
4131
|
}, [anchorEl, innerRef]);
|
|
4091
4132
|
useImperativeHandle3(ref, () => innerRef.current, [innerRef]);
|
|
4092
|
-
const handleChange =
|
|
4133
|
+
const handleChange = useCallback12(
|
|
4093
4134
|
(event) => {
|
|
4094
4135
|
const value2 = event.target.value;
|
|
4095
4136
|
setDisplayValue(value2 ? formatValueString2(parseDates(value2, format), displayFormat) : value2);
|
|
@@ -4097,7 +4138,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4097
4138
|
},
|
|
4098
4139
|
[displayFormat, format, setValue]
|
|
4099
4140
|
);
|
|
4100
|
-
const handleDisplayInputChange =
|
|
4141
|
+
const handleDisplayInputChange = useCallback12(
|
|
4101
4142
|
(event) => {
|
|
4102
4143
|
if (event.target.value === "") {
|
|
4103
4144
|
handleChange({
|
|
@@ -4122,14 +4163,14 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4122
4163
|
},
|
|
4123
4164
|
[displayFormat, format, handleChange, props.name]
|
|
4124
4165
|
);
|
|
4125
|
-
const handleCalendarToggle =
|
|
4166
|
+
const handleCalendarToggle = useCallback12(
|
|
4126
4167
|
(event) => {
|
|
4127
4168
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4128
4169
|
innerRef.current?.focus();
|
|
4129
4170
|
},
|
|
4130
4171
|
[anchorEl, setAnchorEl, innerRef]
|
|
4131
4172
|
);
|
|
4132
|
-
const handleCalendarChange =
|
|
4173
|
+
const handleCalendarChange = useCallback12(
|
|
4133
4174
|
([date1, date2]) => {
|
|
4134
4175
|
if (!date1 || !date2) return;
|
|
4135
4176
|
const formattedValue = formatValueString2([date1, date2], format);
|
|
@@ -4143,7 +4184,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4143
4184
|
},
|
|
4144
4185
|
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat]
|
|
4145
4186
|
);
|
|
4146
|
-
const handleInputMouseDown =
|
|
4187
|
+
const handleInputMouseDown = useCallback12(
|
|
4147
4188
|
(event) => {
|
|
4148
4189
|
if (inputReadOnly) {
|
|
4149
4190
|
event.preventDefault();
|
|
@@ -4152,7 +4193,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4152
4193
|
},
|
|
4153
4194
|
[inputReadOnly, buttonRef]
|
|
4154
4195
|
);
|
|
4155
|
-
return /* @__PURE__ */
|
|
4196
|
+
return /* @__PURE__ */ React26.createElement(DateRangePickerRoot, null, /* @__PURE__ */ React26.createElement(FocusTrap2, { open: true }, /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(
|
|
4156
4197
|
Input_default,
|
|
4157
4198
|
{
|
|
4158
4199
|
...innerProps,
|
|
@@ -4180,7 +4221,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4180
4221
|
error,
|
|
4181
4222
|
className,
|
|
4182
4223
|
sx,
|
|
4183
|
-
endDecorator: /* @__PURE__ */
|
|
4224
|
+
endDecorator: /* @__PURE__ */ React26.createElement(
|
|
4184
4225
|
CalendarButton2,
|
|
4185
4226
|
{
|
|
4186
4227
|
ref: buttonRef,
|
|
@@ -4192,13 +4233,13 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4192
4233
|
"aria-expanded": open,
|
|
4193
4234
|
disabled
|
|
4194
4235
|
},
|
|
4195
|
-
/* @__PURE__ */
|
|
4236
|
+
/* @__PURE__ */ React26.createElement(CalendarTodayIcon2, null)
|
|
4196
4237
|
),
|
|
4197
4238
|
label,
|
|
4198
4239
|
helperText,
|
|
4199
4240
|
readOnly: readOnly || inputReadOnly
|
|
4200
4241
|
}
|
|
4201
|
-
), open && /* @__PURE__ */
|
|
4242
|
+
), open && /* @__PURE__ */ React26.createElement(ClickAwayListener2, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React26.createElement(
|
|
4202
4243
|
StyledPopper2,
|
|
4203
4244
|
{
|
|
4204
4245
|
id: "date-range-picker-popper",
|
|
@@ -4217,7 +4258,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4217
4258
|
"aria-label": "Calendar Tooltip",
|
|
4218
4259
|
"aria-expanded": open
|
|
4219
4260
|
},
|
|
4220
|
-
/* @__PURE__ */
|
|
4261
|
+
/* @__PURE__ */ React26.createElement(CalendarSheet2, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React26.createElement(
|
|
4221
4262
|
Calendar_default,
|
|
4222
4263
|
{
|
|
4223
4264
|
rangeSelection: true,
|
|
@@ -4228,14 +4269,14 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4228
4269
|
disableFuture,
|
|
4229
4270
|
disablePast
|
|
4230
4271
|
}
|
|
4231
|
-
), !hideClearButton && /* @__PURE__ */
|
|
4272
|
+
), !hideClearButton && /* @__PURE__ */ React26.createElement(
|
|
4232
4273
|
DialogActions_default,
|
|
4233
4274
|
{
|
|
4234
4275
|
sx: {
|
|
4235
4276
|
p: 1
|
|
4236
4277
|
}
|
|
4237
4278
|
},
|
|
4238
|
-
/* @__PURE__ */
|
|
4279
|
+
/* @__PURE__ */ React26.createElement(
|
|
4239
4280
|
Button_default,
|
|
4240
4281
|
{
|
|
4241
4282
|
size,
|
|
@@ -4255,11 +4296,11 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4255
4296
|
DateRangePicker.displayName = "DateRangePicker";
|
|
4256
4297
|
|
|
4257
4298
|
// src/components/Drawer/Drawer.tsx
|
|
4258
|
-
import
|
|
4259
|
-
import { Drawer as JoyDrawer, styled as
|
|
4299
|
+
import React27 from "react";
|
|
4300
|
+
import { Drawer as JoyDrawer, styled as styled15, drawerClasses } from "@mui/joy";
|
|
4260
4301
|
import { motion as motion22 } from "framer-motion";
|
|
4261
4302
|
var MotionDrawer = motion22(JoyDrawer);
|
|
4262
|
-
var StyledDrawer =
|
|
4303
|
+
var StyledDrawer = styled15(MotionDrawer)(({ theme, size = "md" }) => ({
|
|
4263
4304
|
"--Drawer-horizontalSize": {
|
|
4264
4305
|
sm: "360px",
|
|
4265
4306
|
md: "600px",
|
|
@@ -4273,15 +4314,15 @@ var StyledDrawer = styled14(MotionDrawer)(({ theme, size = "md" }) => ({
|
|
|
4273
4314
|
}));
|
|
4274
4315
|
var Drawer = (props) => {
|
|
4275
4316
|
const { children, ...innerProps } = props;
|
|
4276
|
-
return /* @__PURE__ */
|
|
4317
|
+
return /* @__PURE__ */ React27.createElement(StyledDrawer, { ...innerProps }, children);
|
|
4277
4318
|
};
|
|
4278
4319
|
Drawer.displayName = "Drawer";
|
|
4279
4320
|
|
|
4280
4321
|
// src/components/DialogContent/DialogContent.tsx
|
|
4281
|
-
import { DialogContent as JoyDialogContent, styled as
|
|
4322
|
+
import { DialogContent as JoyDialogContent, styled as styled16 } from "@mui/joy";
|
|
4282
4323
|
import { motion as motion23 } from "framer-motion";
|
|
4283
4324
|
var MotionDialogContent = motion23(JoyDialogContent);
|
|
4284
|
-
var StyledDialogContent =
|
|
4325
|
+
var StyledDialogContent = styled16(MotionDialogContent)(({ theme }) => ({
|
|
4285
4326
|
padding: theme.spacing(0, 6, 5)
|
|
4286
4327
|
}));
|
|
4287
4328
|
var DialogContent = StyledDialogContent;
|
|
@@ -4291,10 +4332,10 @@ DialogContent.displayName = "DialogContent";
|
|
|
4291
4332
|
var DialogContent_default = DialogContent;
|
|
4292
4333
|
|
|
4293
4334
|
// src/components/DialogTitle/DialogTitle.tsx
|
|
4294
|
-
import { DialogTitle as JoyDialogTitle, styled as
|
|
4335
|
+
import { DialogTitle as JoyDialogTitle, styled as styled17 } from "@mui/joy";
|
|
4295
4336
|
import { motion as motion24 } from "framer-motion";
|
|
4296
4337
|
var MotionDialogTitle = motion24(JoyDialogTitle);
|
|
4297
|
-
var StyledDialogTitle =
|
|
4338
|
+
var StyledDialogTitle = styled17(MotionDialogTitle)(({ theme }) => ({
|
|
4298
4339
|
padding: theme.spacing(4, 6)
|
|
4299
4340
|
}));
|
|
4300
4341
|
var DialogTitle = StyledDialogTitle;
|
|
@@ -4304,22 +4345,22 @@ DialogTitle.displayName = "DialogTitle";
|
|
|
4304
4345
|
var DialogTitle_default = DialogTitle;
|
|
4305
4346
|
|
|
4306
4347
|
// src/components/DialogFrame/DialogFrame.tsx
|
|
4307
|
-
import
|
|
4348
|
+
import React29 from "react";
|
|
4308
4349
|
|
|
4309
4350
|
// src/components/Modal/Modal.tsx
|
|
4310
|
-
import
|
|
4351
|
+
import React28 from "react";
|
|
4311
4352
|
import {
|
|
4312
4353
|
Modal as JoyModal,
|
|
4313
4354
|
ModalDialog as JoyModalDialog,
|
|
4314
4355
|
ModalClose as JoyModalClose,
|
|
4315
4356
|
ModalOverflow as JoyModalOverflow,
|
|
4316
|
-
styled as
|
|
4357
|
+
styled as styled18
|
|
4317
4358
|
} from "@mui/joy";
|
|
4318
4359
|
import { motion as motion25 } from "framer-motion";
|
|
4319
4360
|
var MotionModal = motion25(JoyModal);
|
|
4320
4361
|
var Modal = MotionModal;
|
|
4321
4362
|
Modal.displayName = "Modal";
|
|
4322
|
-
var StyledModalDialog =
|
|
4363
|
+
var StyledModalDialog = styled18(JoyModalDialog)({
|
|
4323
4364
|
padding: 0
|
|
4324
4365
|
});
|
|
4325
4366
|
var ModalDialog = StyledModalDialog;
|
|
@@ -4330,37 +4371,37 @@ var ModalOverflow = MotionModalOverflow;
|
|
|
4330
4371
|
ModalOverflow.displayName = "ModalOverflow";
|
|
4331
4372
|
function ModalFrame(props) {
|
|
4332
4373
|
const { title, children, titleStartDecorator, onClose, ...innerProps } = props;
|
|
4333
|
-
return /* @__PURE__ */
|
|
4374
|
+
return /* @__PURE__ */ React28.createElement(StyledModalDialog, { ...innerProps }, /* @__PURE__ */ React28.createElement(ModalClose, { onClick: onClose }), /* @__PURE__ */ React28.createElement(DialogTitle_default, null, titleStartDecorator, title), /* @__PURE__ */ React28.createElement(DialogContent_default, null, children));
|
|
4334
4375
|
}
|
|
4335
4376
|
ModalFrame.displayName = "ModalFrame";
|
|
4336
4377
|
|
|
4337
4378
|
// src/components/DialogFrame/DialogFrame.tsx
|
|
4338
|
-
import { styled as
|
|
4339
|
-
var StyledDialogFrame =
|
|
4379
|
+
import { styled as styled19 } from "@mui/joy";
|
|
4380
|
+
var StyledDialogFrame = styled19(ModalDialog, {
|
|
4340
4381
|
name: "Dialog",
|
|
4341
4382
|
slot: "Root"
|
|
4342
4383
|
})({
|
|
4343
4384
|
padding: 0
|
|
4344
4385
|
});
|
|
4345
|
-
var DialogFrame =
|
|
4386
|
+
var DialogFrame = React29.forwardRef((props, ref) => {
|
|
4346
4387
|
const { title, children, actions, fullscreen, ...innerProps } = props;
|
|
4347
|
-
return /* @__PURE__ */
|
|
4388
|
+
return /* @__PURE__ */ React29.createElement(StyledDialogFrame, { layout: fullscreen ? "fullscreen" : "center", ref, ...innerProps }, /* @__PURE__ */ React29.createElement(DialogTitle_default, null, title), /* @__PURE__ */ React29.createElement(DialogContent_default, null, children), /* @__PURE__ */ React29.createElement(DialogActions_default, null, actions));
|
|
4348
4389
|
});
|
|
4349
4390
|
DialogFrame.displayName = "DialogFrame";
|
|
4350
4391
|
|
|
4351
4392
|
// src/components/Divider/Divider.tsx
|
|
4352
|
-
import
|
|
4393
|
+
import React30 from "react";
|
|
4353
4394
|
import { Divider as JoyDivider } from "@mui/joy";
|
|
4354
4395
|
import { motion as motion26 } from "framer-motion";
|
|
4355
4396
|
var MotionDivider = motion26(JoyDivider);
|
|
4356
4397
|
var Divider = (props) => {
|
|
4357
|
-
return /* @__PURE__ */
|
|
4398
|
+
return /* @__PURE__ */ React30.createElement(MotionDivider, { ...props });
|
|
4358
4399
|
};
|
|
4359
4400
|
Divider.displayName = "Divider";
|
|
4360
4401
|
|
|
4361
4402
|
// src/components/InsetDrawer/InsetDrawer.tsx
|
|
4362
|
-
import { Drawer as JoyDrawer2, styled as
|
|
4363
|
-
var InsetDrawer =
|
|
4403
|
+
import { Drawer as JoyDrawer2, styled as styled20, drawerClasses as drawerClasses2 } from "@mui/joy";
|
|
4404
|
+
var InsetDrawer = styled20(JoyDrawer2)(({ theme }) => ({
|
|
4364
4405
|
[`& .${drawerClasses2.content}`]: {
|
|
4365
4406
|
backgroundColor: "transparent",
|
|
4366
4407
|
boxShadow: "none",
|
|
@@ -4378,7 +4419,7 @@ var InsetDrawer = styled19(JoyDrawer2)(({ theme }) => ({
|
|
|
4378
4419
|
import { Grid } from "@mui/joy";
|
|
4379
4420
|
|
|
4380
4421
|
// src/components/IconMenuButton/IconMenuButton.tsx
|
|
4381
|
-
import
|
|
4422
|
+
import React31 from "react";
|
|
4382
4423
|
import { MenuButton as JoyMenuButton2, IconButton as JoyIconButton2 } from "@mui/joy";
|
|
4383
4424
|
function IconMenuButton(props) {
|
|
4384
4425
|
const {
|
|
@@ -4392,7 +4433,7 @@ function IconMenuButton(props) {
|
|
|
4392
4433
|
placement = "bottom"
|
|
4393
4434
|
} = props;
|
|
4394
4435
|
if (!items.length) {
|
|
4395
|
-
return /* @__PURE__ */
|
|
4436
|
+
return /* @__PURE__ */ React31.createElement(
|
|
4396
4437
|
JoyIconButton2,
|
|
4397
4438
|
{
|
|
4398
4439
|
component: props.buttonComponent ?? "button",
|
|
@@ -4406,7 +4447,7 @@ function IconMenuButton(props) {
|
|
|
4406
4447
|
icon
|
|
4407
4448
|
);
|
|
4408
4449
|
}
|
|
4409
|
-
return /* @__PURE__ */
|
|
4450
|
+
return /* @__PURE__ */ React31.createElement(Dropdown_default, null, /* @__PURE__ */ React31.createElement(
|
|
4410
4451
|
JoyMenuButton2,
|
|
4411
4452
|
{
|
|
4412
4453
|
slots: { root: JoyIconButton2 },
|
|
@@ -4423,19 +4464,19 @@ function IconMenuButton(props) {
|
|
|
4423
4464
|
}
|
|
4424
4465
|
},
|
|
4425
4466
|
icon
|
|
4426
|
-
), /* @__PURE__ */
|
|
4467
|
+
), /* @__PURE__ */ React31.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React31.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
|
|
4427
4468
|
}
|
|
4428
4469
|
IconMenuButton.displayName = "IconMenuButton";
|
|
4429
4470
|
|
|
4430
4471
|
// src/components/Markdown/Markdown.tsx
|
|
4431
|
-
import
|
|
4472
|
+
import React32, { lazy, Suspense, useEffect as useEffect8, useState as useState9 } from "react";
|
|
4432
4473
|
import { Skeleton } from "@mui/joy";
|
|
4433
4474
|
import { Link as Link2 } from "@mui/joy";
|
|
4434
4475
|
import remarkGfm from "remark-gfm";
|
|
4435
4476
|
var LazyReactMarkdown = lazy(() => import("react-markdown"));
|
|
4436
4477
|
var Markdown = (props) => {
|
|
4437
|
-
const [rehypeAccent2, setRehypeAccent] =
|
|
4438
|
-
|
|
4478
|
+
const [rehypeAccent2, setRehypeAccent] = useState9(null);
|
|
4479
|
+
useEffect8(() => {
|
|
4439
4480
|
const loadRehypeAccent = async () => {
|
|
4440
4481
|
const module = await Promise.resolve().then(() => (init_rehype_accent(), rehype_accent_exports));
|
|
4441
4482
|
setRehypeAccent(() => module.rehypeAccent);
|
|
@@ -4457,12 +4498,12 @@ var Markdown = (props) => {
|
|
|
4457
4498
|
if (!rehypeAccent2) {
|
|
4458
4499
|
return null;
|
|
4459
4500
|
}
|
|
4460
|
-
return /* @__PURE__ */
|
|
4501
|
+
return /* @__PURE__ */ React32.createElement(Typography, { component: "div", color, textColor, level: defaultLevel, ...innerProps }, /* @__PURE__ */ React32.createElement(
|
|
4461
4502
|
Suspense,
|
|
4462
4503
|
{
|
|
4463
|
-
fallback: fallback || /* @__PURE__ */
|
|
4504
|
+
fallback: fallback || /* @__PURE__ */ React32.createElement(Typography, null, /* @__PURE__ */ React32.createElement(Skeleton, null, content || ""))
|
|
4464
4505
|
},
|
|
4465
|
-
/* @__PURE__ */
|
|
4506
|
+
/* @__PURE__ */ React32.createElement(
|
|
4466
4507
|
LazyReactMarkdown,
|
|
4467
4508
|
{
|
|
4468
4509
|
...markdownOptions,
|
|
@@ -4470,15 +4511,15 @@ var Markdown = (props) => {
|
|
|
4470
4511
|
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
4471
4512
|
remarkPlugins: [remarkGfm],
|
|
4472
4513
|
components: {
|
|
4473
|
-
h1: ({ children }) => /* @__PURE__ */
|
|
4474
|
-
h2: ({ children }) => /* @__PURE__ */
|
|
4475
|
-
h3: ({ children }) => /* @__PURE__ */
|
|
4476
|
-
h4: ({ children }) => /* @__PURE__ */
|
|
4477
|
-
p: ({ children, node }) => /* @__PURE__ */
|
|
4478
|
-
a: ({ children, href }) => /* @__PURE__ */
|
|
4479
|
-
hr: () => /* @__PURE__ */
|
|
4480
|
-
b: ({ children }) => /* @__PURE__ */
|
|
4481
|
-
strong: ({ children }) => /* @__PURE__ */
|
|
4514
|
+
h1: ({ children }) => /* @__PURE__ */ React32.createElement(Typography, { color, textColor, level: "h1" }, children),
|
|
4515
|
+
h2: ({ children }) => /* @__PURE__ */ React32.createElement(Typography, { color, textColor, level: "h2" }, children),
|
|
4516
|
+
h3: ({ children }) => /* @__PURE__ */ React32.createElement(Typography, { color, textColor, level: "h3" }, children),
|
|
4517
|
+
h4: ({ children }) => /* @__PURE__ */ React32.createElement(Typography, { color, textColor, level: "h4" }, children),
|
|
4518
|
+
p: ({ children, node }) => /* @__PURE__ */ React32.createElement(Typography, { color, textColor, level: defaultLevel, ...node?.properties }, children),
|
|
4519
|
+
a: ({ children, href }) => /* @__PURE__ */ React32.createElement(Link2, { href, target: defaultLinkAction }, children),
|
|
4520
|
+
hr: () => /* @__PURE__ */ React32.createElement(Divider, null),
|
|
4521
|
+
b: ({ children }) => /* @__PURE__ */ React32.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4522
|
+
strong: ({ children }) => /* @__PURE__ */ React32.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4482
4523
|
...markdownOptions?.components
|
|
4483
4524
|
}
|
|
4484
4525
|
}
|
|
@@ -4488,7 +4529,7 @@ var Markdown = (props) => {
|
|
|
4488
4529
|
Markdown.displayName = "Markdown";
|
|
4489
4530
|
|
|
4490
4531
|
// src/components/MenuButton/MenuButton.tsx
|
|
4491
|
-
import
|
|
4532
|
+
import React33 from "react";
|
|
4492
4533
|
import { MenuButton as JoyMenuButton3, Button as JoyButton2 } from "@mui/joy";
|
|
4493
4534
|
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|
4494
4535
|
function MenuButton(props) {
|
|
@@ -4506,7 +4547,7 @@ function MenuButton(props) {
|
|
|
4506
4547
|
placement = "bottom"
|
|
4507
4548
|
} = props;
|
|
4508
4549
|
if (!items.length) {
|
|
4509
|
-
return /* @__PURE__ */
|
|
4550
|
+
return /* @__PURE__ */ React33.createElement(
|
|
4510
4551
|
JoyButton2,
|
|
4511
4552
|
{
|
|
4512
4553
|
component: props.buttonComponent ?? "button",
|
|
@@ -4517,12 +4558,12 @@ function MenuButton(props) {
|
|
|
4517
4558
|
loading,
|
|
4518
4559
|
startDecorator,
|
|
4519
4560
|
...props.buttonComponentProps ?? {},
|
|
4520
|
-
endDecorator: showIcon ? /* @__PURE__ */
|
|
4561
|
+
endDecorator: showIcon ? /* @__PURE__ */ React33.createElement(React33.Fragment, null, endDecorator, /* @__PURE__ */ React33.createElement(ExpandMoreIcon, null)) : /* @__PURE__ */ React33.createElement(React33.Fragment, null, endDecorator)
|
|
4521
4562
|
},
|
|
4522
4563
|
buttonText
|
|
4523
4564
|
);
|
|
4524
4565
|
}
|
|
4525
|
-
return /* @__PURE__ */
|
|
4566
|
+
return /* @__PURE__ */ React33.createElement(Dropdown_default, null, /* @__PURE__ */ React33.createElement(
|
|
4526
4567
|
JoyMenuButton3,
|
|
4527
4568
|
{
|
|
4528
4569
|
component: props.buttonComponent ?? "button",
|
|
@@ -4533,25 +4574,25 @@ function MenuButton(props) {
|
|
|
4533
4574
|
loading,
|
|
4534
4575
|
startDecorator,
|
|
4535
4576
|
...props.buttonComponentProps ?? {},
|
|
4536
|
-
endDecorator: showIcon ? /* @__PURE__ */
|
|
4577
|
+
endDecorator: showIcon ? /* @__PURE__ */ React33.createElement(React33.Fragment, null, endDecorator, /* @__PURE__ */ React33.createElement(ExpandMoreIcon, null)) : /* @__PURE__ */ React33.createElement(React33.Fragment, null, endDecorator)
|
|
4537
4578
|
},
|
|
4538
4579
|
buttonText
|
|
4539
|
-
), /* @__PURE__ */
|
|
4580
|
+
), /* @__PURE__ */ React33.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React33.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
|
|
4540
4581
|
}
|
|
4541
4582
|
MenuButton.displayName = "MenuButton";
|
|
4542
4583
|
|
|
4543
4584
|
// src/components/MonthPicker/MonthPicker.tsx
|
|
4544
|
-
import
|
|
4585
|
+
import React34, { forwardRef as forwardRef9, useCallback as useCallback13, useEffect as useEffect9, useImperativeHandle as useImperativeHandle4, useRef as useRef8, useState as useState10 } from "react";
|
|
4545
4586
|
import CalendarTodayIcon3 from "@mui/icons-material/CalendarToday";
|
|
4546
|
-
import { styled as
|
|
4587
|
+
import { styled as styled21, useThemeProps as useThemeProps6 } from "@mui/joy";
|
|
4547
4588
|
import { FocusTrap as FocusTrap3, ClickAwayListener as ClickAwayListener3, Popper as Popper4 } from "@mui/base";
|
|
4548
|
-
var StyledPopper3 =
|
|
4589
|
+
var StyledPopper3 = styled21(Popper4, {
|
|
4549
4590
|
name: "MonthPicker",
|
|
4550
4591
|
slot: "popper"
|
|
4551
4592
|
})(({ theme }) => ({
|
|
4552
4593
|
zIndex: theme.zIndex.tooltip
|
|
4553
4594
|
}));
|
|
4554
|
-
var CalendarSheet3 =
|
|
4595
|
+
var CalendarSheet3 = styled21(Sheet_default, {
|
|
4555
4596
|
name: "MonthPicker",
|
|
4556
4597
|
slot: "sheet",
|
|
4557
4598
|
overridesResolver: (props, styles) => styles.root
|
|
@@ -4560,7 +4601,7 @@ var CalendarSheet3 = styled20(Sheet_default, {
|
|
|
4560
4601
|
boxShadow: theme.shadow.md,
|
|
4561
4602
|
borderRadius: theme.radius.md
|
|
4562
4603
|
}));
|
|
4563
|
-
var MonthPickerRoot =
|
|
4604
|
+
var MonthPickerRoot = styled21("div", {
|
|
4564
4605
|
name: "MonthPicker",
|
|
4565
4606
|
slot: "root",
|
|
4566
4607
|
overridesResolver: (props, styles) => styles.root
|
|
@@ -4623,14 +4664,14 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
4623
4664
|
locale,
|
|
4624
4665
|
...innerProps
|
|
4625
4666
|
} = props;
|
|
4626
|
-
const innerRef =
|
|
4627
|
-
const buttonRef =
|
|
4667
|
+
const innerRef = useRef8(null);
|
|
4668
|
+
const buttonRef = useRef8(null);
|
|
4628
4669
|
const [value, setValue, isControlled] = useControlledState(
|
|
4629
4670
|
props.value,
|
|
4630
4671
|
props.defaultValue || "",
|
|
4631
|
-
|
|
4672
|
+
useCallback13((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
4632
4673
|
);
|
|
4633
|
-
const getFormattedDisplayValue =
|
|
4674
|
+
const getFormattedDisplayValue = useCallback13(
|
|
4634
4675
|
(inputValue) => {
|
|
4635
4676
|
if (!inputValue) return "";
|
|
4636
4677
|
try {
|
|
@@ -4641,19 +4682,19 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
4641
4682
|
},
|
|
4642
4683
|
[format, displayFormat, locale]
|
|
4643
4684
|
);
|
|
4644
|
-
const [displayValue, setDisplayValue] =
|
|
4645
|
-
const [anchorEl, setAnchorEl] =
|
|
4685
|
+
const [displayValue, setDisplayValue] = useState10(() => getFormattedDisplayValue(value));
|
|
4686
|
+
const [anchorEl, setAnchorEl] = useState10(null);
|
|
4646
4687
|
const open = Boolean(anchorEl);
|
|
4647
|
-
|
|
4688
|
+
useEffect9(() => {
|
|
4648
4689
|
if (!anchorEl) {
|
|
4649
4690
|
innerRef.current?.blur();
|
|
4650
4691
|
}
|
|
4651
4692
|
}, [anchorEl, innerRef]);
|
|
4652
4693
|
useImperativeHandle4(ref, () => innerRef.current, [innerRef]);
|
|
4653
|
-
|
|
4694
|
+
useEffect9(() => {
|
|
4654
4695
|
setDisplayValue(getFormattedDisplayValue(value));
|
|
4655
4696
|
}, [value, getFormattedDisplayValue]);
|
|
4656
|
-
const handleChange =
|
|
4697
|
+
const handleChange = useCallback13(
|
|
4657
4698
|
(event) => {
|
|
4658
4699
|
const newValue = event.target.value;
|
|
4659
4700
|
setValue(newValue);
|
|
@@ -4663,21 +4704,21 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
4663
4704
|
},
|
|
4664
4705
|
[setValue, getFormattedDisplayValue, isControlled]
|
|
4665
4706
|
);
|
|
4666
|
-
const handleCalendarToggle =
|
|
4707
|
+
const handleCalendarToggle = useCallback13(
|
|
4667
4708
|
(event) => {
|
|
4668
4709
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4669
4710
|
innerRef.current?.focus();
|
|
4670
4711
|
},
|
|
4671
4712
|
[anchorEl, setAnchorEl, innerRef]
|
|
4672
4713
|
);
|
|
4673
|
-
const handleInputMouseDown =
|
|
4714
|
+
const handleInputMouseDown = useCallback13(
|
|
4674
4715
|
(event) => {
|
|
4675
4716
|
event.preventDefault();
|
|
4676
4717
|
buttonRef.current?.focus();
|
|
4677
4718
|
},
|
|
4678
4719
|
[buttonRef]
|
|
4679
4720
|
);
|
|
4680
|
-
return /* @__PURE__ */
|
|
4721
|
+
return /* @__PURE__ */ React34.createElement(MonthPickerRoot, null, /* @__PURE__ */ React34.createElement(FocusTrap3, { open: true }, /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(
|
|
4681
4722
|
Input_default,
|
|
4682
4723
|
{
|
|
4683
4724
|
...innerProps,
|
|
@@ -4707,7 +4748,7 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
4707
4748
|
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
4708
4749
|
fontFamily: "monospace"
|
|
4709
4750
|
},
|
|
4710
|
-
endDecorator: /* @__PURE__ */
|
|
4751
|
+
endDecorator: /* @__PURE__ */ React34.createElement(
|
|
4711
4752
|
IconButton_default,
|
|
4712
4753
|
{
|
|
4713
4754
|
ref: buttonRef,
|
|
@@ -4719,12 +4760,12 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
4719
4760
|
"aria-expanded": open,
|
|
4720
4761
|
disabled
|
|
4721
4762
|
},
|
|
4722
|
-
/* @__PURE__ */
|
|
4763
|
+
/* @__PURE__ */ React34.createElement(CalendarTodayIcon3, null)
|
|
4723
4764
|
),
|
|
4724
4765
|
label,
|
|
4725
4766
|
helperText
|
|
4726
4767
|
}
|
|
4727
|
-
), open && /* @__PURE__ */
|
|
4768
|
+
), open && /* @__PURE__ */ React34.createElement(ClickAwayListener3, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React34.createElement(
|
|
4728
4769
|
StyledPopper3,
|
|
4729
4770
|
{
|
|
4730
4771
|
id: "month-picker-popper",
|
|
@@ -4743,7 +4784,7 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
4743
4784
|
"aria-label": "Calendar Tooltip",
|
|
4744
4785
|
"aria-expanded": open
|
|
4745
4786
|
},
|
|
4746
|
-
/* @__PURE__ */
|
|
4787
|
+
/* @__PURE__ */ React34.createElement(CalendarSheet3, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React34.createElement(
|
|
4747
4788
|
Calendar_default,
|
|
4748
4789
|
{
|
|
4749
4790
|
view: "month",
|
|
@@ -4764,14 +4805,14 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
4764
4805
|
disablePast,
|
|
4765
4806
|
locale
|
|
4766
4807
|
}
|
|
4767
|
-
), /* @__PURE__ */
|
|
4808
|
+
), /* @__PURE__ */ React34.createElement(
|
|
4768
4809
|
DialogActions_default,
|
|
4769
4810
|
{
|
|
4770
4811
|
sx: {
|
|
4771
4812
|
p: 1
|
|
4772
4813
|
}
|
|
4773
4814
|
},
|
|
4774
|
-
/* @__PURE__ */
|
|
4815
|
+
/* @__PURE__ */ React34.createElement(
|
|
4775
4816
|
Button_default,
|
|
4776
4817
|
{
|
|
4777
4818
|
size,
|
|
@@ -4794,18 +4835,18 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
4794
4835
|
});
|
|
4795
4836
|
|
|
4796
4837
|
// src/components/MonthRangePicker/MonthRangePicker.tsx
|
|
4797
|
-
import
|
|
4838
|
+
import React35, { forwardRef as forwardRef10, useCallback as useCallback14, useEffect as useEffect10, useImperativeHandle as useImperativeHandle5, useMemo as useMemo12, useRef as useRef9, useState as useState11 } from "react";
|
|
4798
4839
|
import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
|
|
4799
4840
|
import CalendarTodayIcon4 from "@mui/icons-material/CalendarToday";
|
|
4800
|
-
import { styled as
|
|
4841
|
+
import { styled as styled22, useThemeProps as useThemeProps7 } from "@mui/joy";
|
|
4801
4842
|
import { FocusTrap as FocusTrap4, ClickAwayListener as ClickAwayListener4, Popper as Popper5 } from "@mui/base";
|
|
4802
|
-
var StyledPopper4 =
|
|
4843
|
+
var StyledPopper4 = styled22(Popper5, {
|
|
4803
4844
|
name: "MonthRangePicker",
|
|
4804
4845
|
slot: "popper"
|
|
4805
4846
|
})(({ theme }) => ({
|
|
4806
4847
|
zIndex: theme.zIndex.tooltip
|
|
4807
4848
|
}));
|
|
4808
|
-
var CalendarSheet4 =
|
|
4849
|
+
var CalendarSheet4 = styled22(Sheet_default, {
|
|
4809
4850
|
name: "MonthRangePicker",
|
|
4810
4851
|
slot: "sheet",
|
|
4811
4852
|
overridesResolver: (props, styles) => styles.root
|
|
@@ -4815,7 +4856,7 @@ var CalendarSheet4 = styled21(Sheet_default, {
|
|
|
4815
4856
|
boxShadow: theme.shadow.md,
|
|
4816
4857
|
borderRadius: theme.radius.md
|
|
4817
4858
|
}));
|
|
4818
|
-
var MonthRangePickerRoot =
|
|
4859
|
+
var MonthRangePickerRoot = styled22("div", {
|
|
4819
4860
|
name: "MonthRangePicker",
|
|
4820
4861
|
slot: "root",
|
|
4821
4862
|
overridesResolver: (props, styles) => styles.root
|
|
@@ -4852,9 +4893,9 @@ var parseDates2 = (str) => {
|
|
|
4852
4893
|
var formatToPattern3 = (format) => {
|
|
4853
4894
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
|
|
4854
4895
|
};
|
|
4855
|
-
var TextMaskAdapter7 =
|
|
4896
|
+
var TextMaskAdapter7 = React35.forwardRef(function TextMaskAdapter8(props, ref) {
|
|
4856
4897
|
const { onChange, format, ...other } = props;
|
|
4857
|
-
return /* @__PURE__ */
|
|
4898
|
+
return /* @__PURE__ */ React35.createElement(
|
|
4858
4899
|
IMaskInput3,
|
|
4859
4900
|
{
|
|
4860
4901
|
...other,
|
|
@@ -4902,35 +4943,35 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
4902
4943
|
size,
|
|
4903
4944
|
...innerProps
|
|
4904
4945
|
} = props;
|
|
4905
|
-
const innerRef =
|
|
4946
|
+
const innerRef = useRef9(null);
|
|
4906
4947
|
const [value, setValue] = useControlledState(
|
|
4907
4948
|
props.value,
|
|
4908
4949
|
props.defaultValue || "",
|
|
4909
|
-
|
|
4950
|
+
useCallback14((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
4910
4951
|
);
|
|
4911
|
-
const [anchorEl, setAnchorEl] =
|
|
4952
|
+
const [anchorEl, setAnchorEl] = useState11(null);
|
|
4912
4953
|
const open = Boolean(anchorEl);
|
|
4913
|
-
const calendarValue =
|
|
4914
|
-
|
|
4954
|
+
const calendarValue = useMemo12(() => value ? parseDates2(value) : void 0, [value]);
|
|
4955
|
+
useEffect10(() => {
|
|
4915
4956
|
if (!anchorEl) {
|
|
4916
4957
|
innerRef.current?.blur();
|
|
4917
4958
|
}
|
|
4918
4959
|
}, [anchorEl, innerRef]);
|
|
4919
4960
|
useImperativeHandle5(ref, () => innerRef.current, [innerRef]);
|
|
4920
|
-
const handleChange =
|
|
4961
|
+
const handleChange = useCallback14(
|
|
4921
4962
|
(event) => {
|
|
4922
4963
|
setValue(event.target.value);
|
|
4923
4964
|
},
|
|
4924
4965
|
[setValue]
|
|
4925
4966
|
);
|
|
4926
|
-
const handleCalendarToggle =
|
|
4967
|
+
const handleCalendarToggle = useCallback14(
|
|
4927
4968
|
(event) => {
|
|
4928
4969
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4929
4970
|
innerRef.current?.focus();
|
|
4930
4971
|
},
|
|
4931
4972
|
[anchorEl, setAnchorEl, innerRef]
|
|
4932
4973
|
);
|
|
4933
|
-
const handleCalendarChange =
|
|
4974
|
+
const handleCalendarChange = useCallback14(
|
|
4934
4975
|
([date1, date2]) => {
|
|
4935
4976
|
if (!date1 || !date2) return;
|
|
4936
4977
|
setValue(formatValueString4([date1, date2], format));
|
|
@@ -4938,7 +4979,7 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
4938
4979
|
},
|
|
4939
4980
|
[setValue, setAnchorEl, format]
|
|
4940
4981
|
);
|
|
4941
|
-
return /* @__PURE__ */
|
|
4982
|
+
return /* @__PURE__ */ React35.createElement(MonthRangePickerRoot, null, /* @__PURE__ */ React35.createElement(FocusTrap4, { open: true }, /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(
|
|
4942
4983
|
Input_default,
|
|
4943
4984
|
{
|
|
4944
4985
|
...innerProps,
|
|
@@ -4960,7 +5001,7 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
4960
5001
|
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
4961
5002
|
fontFamily: "monospace"
|
|
4962
5003
|
},
|
|
4963
|
-
endDecorator: /* @__PURE__ */
|
|
5004
|
+
endDecorator: /* @__PURE__ */ React35.createElement(
|
|
4964
5005
|
IconButton_default,
|
|
4965
5006
|
{
|
|
4966
5007
|
variant: "plain",
|
|
@@ -4970,12 +5011,12 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
4970
5011
|
"aria-haspopup": "dialog",
|
|
4971
5012
|
"aria-expanded": open
|
|
4972
5013
|
},
|
|
4973
|
-
/* @__PURE__ */
|
|
5014
|
+
/* @__PURE__ */ React35.createElement(CalendarTodayIcon4, null)
|
|
4974
5015
|
),
|
|
4975
5016
|
label,
|
|
4976
5017
|
helperText
|
|
4977
5018
|
}
|
|
4978
|
-
), open && /* @__PURE__ */
|
|
5019
|
+
), open && /* @__PURE__ */ React35.createElement(ClickAwayListener4, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React35.createElement(
|
|
4979
5020
|
StyledPopper4,
|
|
4980
5021
|
{
|
|
4981
5022
|
id: "month-range-picker-popper",
|
|
@@ -4994,7 +5035,7 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
4994
5035
|
"aria-label": "Calendar Tooltip",
|
|
4995
5036
|
"aria-expanded": open
|
|
4996
5037
|
},
|
|
4997
|
-
/* @__PURE__ */
|
|
5038
|
+
/* @__PURE__ */ React35.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React35.createElement(
|
|
4998
5039
|
Calendar_default,
|
|
4999
5040
|
{
|
|
5000
5041
|
view: "month",
|
|
@@ -5007,14 +5048,14 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
5007
5048
|
disableFuture,
|
|
5008
5049
|
disablePast
|
|
5009
5050
|
}
|
|
5010
|
-
), /* @__PURE__ */
|
|
5051
|
+
), /* @__PURE__ */ React35.createElement(
|
|
5011
5052
|
DialogActions_default,
|
|
5012
5053
|
{
|
|
5013
5054
|
sx: {
|
|
5014
5055
|
p: 1
|
|
5015
5056
|
}
|
|
5016
5057
|
},
|
|
5017
|
-
/* @__PURE__ */
|
|
5058
|
+
/* @__PURE__ */ React35.createElement(
|
|
5018
5059
|
Button_default,
|
|
5019
5060
|
{
|
|
5020
5061
|
size,
|
|
@@ -5033,16 +5074,16 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
5033
5074
|
MonthRangePicker.displayName = "MonthRangePicker";
|
|
5034
5075
|
|
|
5035
5076
|
// src/components/NavigationGroup/NavigationGroup.tsx
|
|
5036
|
-
import
|
|
5077
|
+
import React36 from "react";
|
|
5037
5078
|
import {
|
|
5038
5079
|
Accordion as JoyAccordion2,
|
|
5039
5080
|
AccordionSummary as JoyAccordionSummary2,
|
|
5040
5081
|
AccordionDetails as JoyAccordionDetails2,
|
|
5041
|
-
styled as
|
|
5082
|
+
styled as styled23,
|
|
5042
5083
|
accordionSummaryClasses,
|
|
5043
5084
|
Stack as Stack2
|
|
5044
5085
|
} from "@mui/joy";
|
|
5045
|
-
var AccordionSummary2 =
|
|
5086
|
+
var AccordionSummary2 = styled23(JoyAccordionSummary2, {
|
|
5046
5087
|
name: "NavigationGroup",
|
|
5047
5088
|
slot: "Summary",
|
|
5048
5089
|
shouldForwardProp: (prop) => prop !== "useIcon" && prop !== "level"
|
|
@@ -5055,7 +5096,7 @@ var AccordionSummary2 = styled22(JoyAccordionSummary2, {
|
|
|
5055
5096
|
}
|
|
5056
5097
|
}
|
|
5057
5098
|
}));
|
|
5058
|
-
var AccordionDetails2 =
|
|
5099
|
+
var AccordionDetails2 = styled23(JoyAccordionDetails2, {
|
|
5059
5100
|
name: "NavigationGroup",
|
|
5060
5101
|
slot: "Details"
|
|
5061
5102
|
})(({ theme }) => ({
|
|
@@ -5064,19 +5105,19 @@ var AccordionDetails2 = styled22(JoyAccordionDetails2, {
|
|
|
5064
5105
|
}));
|
|
5065
5106
|
function NavigationGroup(props) {
|
|
5066
5107
|
const { title, children, startDecorator, level, ...rest } = props;
|
|
5067
|
-
return /* @__PURE__ */
|
|
5108
|
+
return /* @__PURE__ */ React36.createElement(JoyAccordion2, { ...rest }, /* @__PURE__ */ React36.createElement(AccordionSummary2, { useIcon: !!startDecorator, level }, /* @__PURE__ */ React36.createElement(Stack2, { direction: "row", gap: 4 }, startDecorator, title)), /* @__PURE__ */ React36.createElement(AccordionDetails2, null, children));
|
|
5068
5109
|
}
|
|
5069
5110
|
|
|
5070
5111
|
// src/components/NavigationItem/NavigationItem.tsx
|
|
5071
|
-
import
|
|
5112
|
+
import React37 from "react";
|
|
5072
5113
|
import {
|
|
5073
5114
|
ListItem as JoyListItem,
|
|
5074
5115
|
ListItemButton as JoyListItemButton,
|
|
5075
5116
|
ListItemDecorator as JoyListItemDecorator,
|
|
5076
|
-
styled as
|
|
5117
|
+
styled as styled24,
|
|
5077
5118
|
listItemButtonClasses
|
|
5078
5119
|
} from "@mui/joy";
|
|
5079
|
-
var ListItemButton =
|
|
5120
|
+
var ListItemButton = styled24(JoyListItemButton, {
|
|
5080
5121
|
name: "NavigationItem",
|
|
5081
5122
|
slot: "Button",
|
|
5082
5123
|
shouldForwardProp: (prop) => prop !== "useIcon" && prop !== "level"
|
|
@@ -5103,7 +5144,7 @@ function NavigationItem(props) {
|
|
|
5103
5144
|
const handleClick = () => {
|
|
5104
5145
|
onClick?.(id);
|
|
5105
5146
|
};
|
|
5106
|
-
return /* @__PURE__ */
|
|
5147
|
+
return /* @__PURE__ */ React37.createElement(JoyListItem, { ...rest }, /* @__PURE__ */ React37.createElement(
|
|
5107
5148
|
ListItemButton,
|
|
5108
5149
|
{
|
|
5109
5150
|
level,
|
|
@@ -5112,21 +5153,21 @@ function NavigationItem(props) {
|
|
|
5112
5153
|
"aria-current": selected,
|
|
5113
5154
|
onClick: handleClick
|
|
5114
5155
|
},
|
|
5115
|
-
startDecorator && /* @__PURE__ */
|
|
5156
|
+
startDecorator && /* @__PURE__ */ React37.createElement(JoyListItemDecorator, null, startDecorator),
|
|
5116
5157
|
children
|
|
5117
5158
|
));
|
|
5118
5159
|
}
|
|
5119
5160
|
|
|
5120
5161
|
// src/components/Navigator/Navigator.tsx
|
|
5121
|
-
import
|
|
5162
|
+
import React38 from "react";
|
|
5122
5163
|
function Navigator(props) {
|
|
5123
5164
|
const { items, level = 0, onSelect } = props;
|
|
5124
5165
|
const handleItemClick = (id) => {
|
|
5125
5166
|
onSelect?.(id);
|
|
5126
5167
|
};
|
|
5127
|
-
return /* @__PURE__ */
|
|
5168
|
+
return /* @__PURE__ */ React38.createElement("div", null, items.map((item, index) => {
|
|
5128
5169
|
if (item.type === "item") {
|
|
5129
|
-
return /* @__PURE__ */
|
|
5170
|
+
return /* @__PURE__ */ React38.createElement(
|
|
5130
5171
|
NavigationItem,
|
|
5131
5172
|
{
|
|
5132
5173
|
key: item.id,
|
|
@@ -5139,7 +5180,7 @@ function Navigator(props) {
|
|
|
5139
5180
|
item.title
|
|
5140
5181
|
);
|
|
5141
5182
|
} else if (item.type === "group") {
|
|
5142
|
-
return /* @__PURE__ */
|
|
5183
|
+
return /* @__PURE__ */ React38.createElement(
|
|
5143
5184
|
NavigationGroup,
|
|
5144
5185
|
{
|
|
5145
5186
|
key: `${item.title}-${index}`,
|
|
@@ -5157,16 +5198,16 @@ function Navigator(props) {
|
|
|
5157
5198
|
Navigator.displayName = "Navigator";
|
|
5158
5199
|
|
|
5159
5200
|
// src/components/PercentageInput/PercentageInput.tsx
|
|
5160
|
-
import
|
|
5201
|
+
import React39, { useCallback as useCallback15, useMemo as useMemo13, useState as useState12 } from "react";
|
|
5161
5202
|
import { NumericFormat as NumericFormat2 } from "react-number-format";
|
|
5162
|
-
import { styled as
|
|
5203
|
+
import { styled as styled25, useThemeProps as useThemeProps8 } from "@mui/joy";
|
|
5163
5204
|
var padDecimal = (value, decimalScale) => {
|
|
5164
5205
|
const [integer, decimal = ""] = `${value}`.split(".");
|
|
5165
5206
|
return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
|
|
5166
5207
|
};
|
|
5167
|
-
var TextMaskAdapter9 =
|
|
5208
|
+
var TextMaskAdapter9 = React39.forwardRef(function TextMaskAdapter10(props, ref) {
|
|
5168
5209
|
const { onChange, min, max, ...innerProps } = props;
|
|
5169
|
-
return /* @__PURE__ */
|
|
5210
|
+
return /* @__PURE__ */ React39.createElement(
|
|
5170
5211
|
NumericFormat2,
|
|
5171
5212
|
{
|
|
5172
5213
|
...innerProps,
|
|
@@ -5186,12 +5227,12 @@ var TextMaskAdapter9 = React37.forwardRef(function TextMaskAdapter10(props, ref)
|
|
|
5186
5227
|
}
|
|
5187
5228
|
);
|
|
5188
5229
|
});
|
|
5189
|
-
var PercentageInputRoot =
|
|
5230
|
+
var PercentageInputRoot = styled25(Input_default, {
|
|
5190
5231
|
name: "PercentageInput",
|
|
5191
5232
|
slot: "Root",
|
|
5192
5233
|
overridesResolver: (props, styles) => styles.root
|
|
5193
5234
|
})({});
|
|
5194
|
-
var PercentageInput =
|
|
5235
|
+
var PercentageInput = React39.forwardRef(
|
|
5195
5236
|
function PercentageInput2(inProps, ref) {
|
|
5196
5237
|
const props = useThemeProps8({ props: inProps, name: "PercentageInput" });
|
|
5197
5238
|
const {
|
|
@@ -5214,18 +5255,18 @@ var PercentageInput = React37.forwardRef(
|
|
|
5214
5255
|
const [_value, setValue] = useControlledState(
|
|
5215
5256
|
props.value,
|
|
5216
5257
|
props.defaultValue,
|
|
5217
|
-
|
|
5258
|
+
useCallback15((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
5218
5259
|
);
|
|
5219
|
-
const [internalError, setInternalError] =
|
|
5260
|
+
const [internalError, setInternalError] = useState12(
|
|
5220
5261
|
max && _value && _value > max || min && _value && _value < min
|
|
5221
5262
|
);
|
|
5222
|
-
const value =
|
|
5263
|
+
const value = useMemo13(() => {
|
|
5223
5264
|
if (_value && useMinorUnit) {
|
|
5224
5265
|
return _value / Math.pow(10, maxDecimalScale);
|
|
5225
5266
|
}
|
|
5226
5267
|
return _value;
|
|
5227
5268
|
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
5228
|
-
const handleChange =
|
|
5269
|
+
const handleChange = useCallback15(
|
|
5229
5270
|
(event) => {
|
|
5230
5271
|
if (event.target.value === "") {
|
|
5231
5272
|
setValue(void 0);
|
|
@@ -5242,7 +5283,7 @@ var PercentageInput = React37.forwardRef(
|
|
|
5242
5283
|
},
|
|
5243
5284
|
[setValue, useMinorUnit, maxDecimalScale, min, max]
|
|
5244
5285
|
);
|
|
5245
|
-
return /* @__PURE__ */
|
|
5286
|
+
return /* @__PURE__ */ React39.createElement(
|
|
5246
5287
|
PercentageInputRoot,
|
|
5247
5288
|
{
|
|
5248
5289
|
...innerProps,
|
|
@@ -5283,30 +5324,30 @@ var RadioGroup = MotionRadioGroup;
|
|
|
5283
5324
|
RadioGroup.displayName = "RadioGroup";
|
|
5284
5325
|
|
|
5285
5326
|
// src/components/RadioList/RadioList.tsx
|
|
5286
|
-
import
|
|
5327
|
+
import React40 from "react";
|
|
5287
5328
|
function RadioList(props) {
|
|
5288
5329
|
const { items, ...innerProps } = props;
|
|
5289
|
-
return /* @__PURE__ */
|
|
5330
|
+
return /* @__PURE__ */ React40.createElement(RadioGroup, { ...innerProps }, items.map((item) => /* @__PURE__ */ React40.createElement(Radio, { key: `${item.value}`, value: item.value, label: item.label })));
|
|
5290
5331
|
}
|
|
5291
5332
|
RadioList.displayName = "RadioList";
|
|
5292
5333
|
|
|
5293
5334
|
// src/components/Stepper/Stepper.tsx
|
|
5294
|
-
import
|
|
5335
|
+
import React41 from "react";
|
|
5295
5336
|
import {
|
|
5296
5337
|
Stepper as JoyStepper,
|
|
5297
5338
|
Step as JoyStep,
|
|
5298
5339
|
StepIndicator as JoyStepIndicator,
|
|
5299
5340
|
stepClasses,
|
|
5300
5341
|
stepIndicatorClasses,
|
|
5301
|
-
styled as
|
|
5342
|
+
styled as styled26
|
|
5302
5343
|
} from "@mui/joy";
|
|
5303
5344
|
import CheckIcon from "@mui/icons-material/Check";
|
|
5304
5345
|
import { motion as motion28 } from "framer-motion";
|
|
5305
|
-
var Step =
|
|
5346
|
+
var Step = styled26(JoyStep)({});
|
|
5306
5347
|
Step.displayName = "Step";
|
|
5307
|
-
var StepIndicator =
|
|
5348
|
+
var StepIndicator = styled26(JoyStepIndicator)({});
|
|
5308
5349
|
StepIndicator.displayName = "StepIndicator";
|
|
5309
|
-
var StyledStepper =
|
|
5350
|
+
var StyledStepper = styled26(JoyStepper)(({ theme }) => ({
|
|
5310
5351
|
"--StepIndicator-size": "24px",
|
|
5311
5352
|
"--Step-gap": theme.spacing(2),
|
|
5312
5353
|
"--joy-palette-success-solidBg": "var(--joy-palette-success-400)",
|
|
@@ -5324,7 +5365,7 @@ function Stepper(props) {
|
|
|
5324
5365
|
inactiveLineColor = "neutral.300",
|
|
5325
5366
|
activeStep
|
|
5326
5367
|
} = props;
|
|
5327
|
-
return /* @__PURE__ */
|
|
5368
|
+
return /* @__PURE__ */ React41.createElement(
|
|
5328
5369
|
MotionStepper,
|
|
5329
5370
|
{
|
|
5330
5371
|
sx: (theme) => ({
|
|
@@ -5358,16 +5399,16 @@ function Stepper(props) {
|
|
|
5358
5399
|
const completed = activeStep > i + 1;
|
|
5359
5400
|
const disabled = activeStep < i + 1;
|
|
5360
5401
|
const hasContent = step.label || step.extraContent;
|
|
5361
|
-
return /* @__PURE__ */
|
|
5402
|
+
return /* @__PURE__ */ React41.createElement(
|
|
5362
5403
|
Step,
|
|
5363
5404
|
{
|
|
5364
5405
|
key: `step-${i}`,
|
|
5365
|
-
indicator: /* @__PURE__ */
|
|
5406
|
+
indicator: /* @__PURE__ */ React41.createElement(StepIndicator, { variant: "solid", color: "primary" }, completed ? /* @__PURE__ */ React41.createElement(CheckIcon, null) : step.indicatorContent),
|
|
5366
5407
|
active,
|
|
5367
5408
|
completed,
|
|
5368
5409
|
disabled
|
|
5369
5410
|
},
|
|
5370
|
-
hasContent && /* @__PURE__ */
|
|
5411
|
+
hasContent && /* @__PURE__ */ React41.createElement(Stack_default, null, step.label && /* @__PURE__ */ React41.createElement(Typography_default, { level: "title-sm" }, step.label), step.extraContent && /* @__PURE__ */ React41.createElement(Typography_default, { level: "body-xs" }, step.extraContent))
|
|
5371
5412
|
);
|
|
5372
5413
|
})
|
|
5373
5414
|
);
|
|
@@ -5375,11 +5416,11 @@ function Stepper(props) {
|
|
|
5375
5416
|
Stepper.displayName = "Stepper";
|
|
5376
5417
|
|
|
5377
5418
|
// src/components/Switch/Switch.tsx
|
|
5378
|
-
import
|
|
5379
|
-
import { Switch as JoySwitch, styled as
|
|
5419
|
+
import React42 from "react";
|
|
5420
|
+
import { Switch as JoySwitch, styled as styled27, switchClasses } from "@mui/joy";
|
|
5380
5421
|
import { motion as motion29 } from "framer-motion";
|
|
5381
5422
|
var MotionSwitch = motion29(JoySwitch);
|
|
5382
|
-
var StyledThumb =
|
|
5423
|
+
var StyledThumb = styled27(motion29.div)({
|
|
5383
5424
|
"--Icon-fontSize": "calc(var(--Switch-thumbSize) * 0.75)",
|
|
5384
5425
|
display: "inline-flex",
|
|
5385
5426
|
justifyContent: "center",
|
|
@@ -5397,14 +5438,14 @@ var StyledThumb = styled26(motion29.div)({
|
|
|
5397
5438
|
right: "var(--Switch-thumbOffset)"
|
|
5398
5439
|
}
|
|
5399
5440
|
});
|
|
5400
|
-
var Thumb = (props) => /* @__PURE__ */
|
|
5441
|
+
var Thumb = (props) => /* @__PURE__ */ React42.createElement(StyledThumb, { ...props, layout: true, transition: spring });
|
|
5401
5442
|
var spring = {
|
|
5402
5443
|
type: "spring",
|
|
5403
5444
|
stiffness: 700,
|
|
5404
5445
|
damping: 30
|
|
5405
5446
|
};
|
|
5406
5447
|
var Switch = (props) => {
|
|
5407
|
-
return /* @__PURE__ */
|
|
5448
|
+
return /* @__PURE__ */ React42.createElement(
|
|
5408
5449
|
MotionSwitch,
|
|
5409
5450
|
{
|
|
5410
5451
|
...props,
|
|
@@ -5418,21 +5459,21 @@ var Switch = (props) => {
|
|
|
5418
5459
|
Switch.displayName = "Switch";
|
|
5419
5460
|
|
|
5420
5461
|
// src/components/Tabs/Tabs.tsx
|
|
5421
|
-
import
|
|
5462
|
+
import React43, { forwardRef as forwardRef11 } from "react";
|
|
5422
5463
|
import {
|
|
5423
5464
|
Tabs as JoyTabs,
|
|
5424
5465
|
Tab as JoyTab,
|
|
5425
5466
|
TabList as JoyTabList,
|
|
5426
5467
|
TabPanel as JoyTabPanel,
|
|
5427
|
-
styled as
|
|
5468
|
+
styled as styled28,
|
|
5428
5469
|
tabClasses
|
|
5429
5470
|
} from "@mui/joy";
|
|
5430
|
-
var StyledTabs =
|
|
5471
|
+
var StyledTabs = styled28(JoyTabs)(({ theme }) => ({
|
|
5431
5472
|
backgroundColor: theme.palette.background.body
|
|
5432
5473
|
}));
|
|
5433
5474
|
var Tabs = StyledTabs;
|
|
5434
5475
|
Tabs.displayName = "Tabs";
|
|
5435
|
-
var StyledTab =
|
|
5476
|
+
var StyledTab = styled28(JoyTab)(({ theme }) => ({
|
|
5436
5477
|
gap: theme.spacing(2),
|
|
5437
5478
|
[`&:not(.${tabClasses.selected})`]: {
|
|
5438
5479
|
color: theme.palette.neutral[700]
|
|
@@ -5442,14 +5483,14 @@ var StyledTab = styled27(JoyTab)(({ theme }) => ({
|
|
|
5442
5483
|
}
|
|
5443
5484
|
}));
|
|
5444
5485
|
var Tab = forwardRef11(function Tab2({ startDecorator, endDecorator, children, ...props }, ref) {
|
|
5445
|
-
return /* @__PURE__ */
|
|
5486
|
+
return /* @__PURE__ */ React43.createElement(StyledTab, { ...props, ref }, startDecorator, children, endDecorator);
|
|
5446
5487
|
});
|
|
5447
5488
|
Tab.displayName = "Tab";
|
|
5448
5489
|
var TabList = JoyTabList;
|
|
5449
5490
|
var TabPanel = JoyTabPanel;
|
|
5450
5491
|
|
|
5451
5492
|
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
5452
|
-
import
|
|
5493
|
+
import React44 from "react";
|
|
5453
5494
|
import {
|
|
5454
5495
|
CssBaseline,
|
|
5455
5496
|
CssVarsProvider,
|
|
@@ -5705,13 +5746,13 @@ var defaultTheme = extendTheme({
|
|
|
5705
5746
|
});
|
|
5706
5747
|
function ThemeProvider(props) {
|
|
5707
5748
|
const theme = props.theme || defaultTheme;
|
|
5708
|
-
return /* @__PURE__ */
|
|
5749
|
+
return /* @__PURE__ */ React44.createElement(React44.Fragment, null, /* @__PURE__ */ React44.createElement(CssVarsProvider, { theme }, /* @__PURE__ */ React44.createElement(CssBaseline, null), props.children));
|
|
5709
5750
|
}
|
|
5710
5751
|
ThemeProvider.displayName = "ThemeProvider";
|
|
5711
5752
|
|
|
5712
5753
|
// src/components/Uploader/Uploader.tsx
|
|
5713
|
-
import
|
|
5714
|
-
import { styled as
|
|
5754
|
+
import React45, { useCallback as useCallback16, useEffect as useEffect11, useMemo as useMemo14, useRef as useRef10, useState as useState13 } from "react";
|
|
5755
|
+
import { styled as styled29, Input as Input2 } from "@mui/joy";
|
|
5715
5756
|
import MuiFileUploadIcon from "@mui/icons-material/CloudUploadRounded";
|
|
5716
5757
|
import MuiUploadFileIcon from "@mui/icons-material/UploadFileRounded";
|
|
5717
5758
|
import MuiClearIcon from "@mui/icons-material/ClearRounded";
|
|
@@ -5733,7 +5774,7 @@ var esmFiles = {
|
|
|
5733
5774
|
"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/prevent-unhandled.js"
|
|
5734
5775
|
)
|
|
5735
5776
|
};
|
|
5736
|
-
var VisuallyHiddenInput =
|
|
5777
|
+
var VisuallyHiddenInput = styled29(Input2)({
|
|
5737
5778
|
width: "1px",
|
|
5738
5779
|
height: "1px",
|
|
5739
5780
|
overflow: "hidden",
|
|
@@ -5742,18 +5783,18 @@ var VisuallyHiddenInput = styled28(Input2)({
|
|
|
5742
5783
|
clipPath: "inset(50%)",
|
|
5743
5784
|
position: "absolute"
|
|
5744
5785
|
});
|
|
5745
|
-
var PreviewRoot =
|
|
5786
|
+
var PreviewRoot = styled29(Stack_default, {
|
|
5746
5787
|
name: "Uploader",
|
|
5747
5788
|
slot: "PreviewRoot"
|
|
5748
5789
|
})({});
|
|
5749
|
-
var UploadCard =
|
|
5790
|
+
var UploadCard = styled29(Card, {
|
|
5750
5791
|
name: "Uploader",
|
|
5751
5792
|
slot: "UploadCard"
|
|
5752
5793
|
})(({ theme }) => ({
|
|
5753
5794
|
padding: theme.spacing(2.5),
|
|
5754
5795
|
border: `1px solid ${theme.palette.neutral.outlinedBorder}`
|
|
5755
5796
|
}));
|
|
5756
|
-
var UploadFileIcon =
|
|
5797
|
+
var UploadFileIcon = styled29(MuiUploadFileIcon, {
|
|
5757
5798
|
name: "Uploader",
|
|
5758
5799
|
slot: "UploadFileIcon"
|
|
5759
5800
|
})(({ theme }) => ({
|
|
@@ -5761,7 +5802,7 @@ var UploadFileIcon = styled28(MuiUploadFileIcon, {
|
|
|
5761
5802
|
width: "32px",
|
|
5762
5803
|
height: "32px"
|
|
5763
5804
|
}));
|
|
5764
|
-
var ClearIcon2 =
|
|
5805
|
+
var ClearIcon2 = styled29(MuiClearIcon, {
|
|
5765
5806
|
name: "Uploader",
|
|
5766
5807
|
slot: "ClearIcon"
|
|
5767
5808
|
})(({ theme }) => ({
|
|
@@ -5787,15 +5828,15 @@ var getFileSize = (n) => {
|
|
|
5787
5828
|
};
|
|
5788
5829
|
var Preview = (props) => {
|
|
5789
5830
|
const { files, uploaded, onDelete } = props;
|
|
5790
|
-
return /* @__PURE__ */
|
|
5831
|
+
return /* @__PURE__ */ React45.createElement(PreviewRoot, { gap: 1 }, [...uploaded, ...files].map((file) => /* @__PURE__ */ React45.createElement(UploadCard, { key: file.name, size: "sm", color: "neutral" }, /* @__PURE__ */ React45.createElement(Stack_default, { direction: "row", alignItems: "center", gap: 2 }, /* @__PURE__ */ React45.createElement(UploadFileIcon, null), /* @__PURE__ */ React45.createElement(Stack_default, { flex: "1" }, /* @__PURE__ */ React45.createElement(Typography_default, { level: "body-sm", textColor: "common.black" }, file.name), !!file.size && /* @__PURE__ */ React45.createElement(Typography_default, { level: "body-xs", fontWeight: "300", lineHeight: "1.33", textColor: "text.tertiary" }, getFileSize(file.size))), /* @__PURE__ */ React45.createElement(IconButton_default, { onClick: () => onDelete?.(file) }, /* @__PURE__ */ React45.createElement(ClearIcon2, null))))));
|
|
5791
5832
|
};
|
|
5792
|
-
var UploaderRoot =
|
|
5833
|
+
var UploaderRoot = styled29(Stack_default, {
|
|
5793
5834
|
name: "Uploader",
|
|
5794
5835
|
slot: "root"
|
|
5795
5836
|
})(({ theme }) => ({
|
|
5796
5837
|
gap: theme.spacing(2)
|
|
5797
5838
|
}));
|
|
5798
|
-
var FileDropZone =
|
|
5839
|
+
var FileDropZone = styled29(Sheet_default, {
|
|
5799
5840
|
name: "Uploader",
|
|
5800
5841
|
slot: "dropZone",
|
|
5801
5842
|
shouldForwardProp: (prop) => prop !== "error"
|
|
@@ -5811,7 +5852,7 @@ var FileDropZone = styled28(Sheet_default, {
|
|
|
5811
5852
|
backgroundColor: theme.palette.background.surface,
|
|
5812
5853
|
border: error ? `1px solid ${theme.palette.danger.outlinedBorder}` : state === "idle" ? `1px solid ${theme.palette.neutral.outlinedBorder}` : `1px solid ${theme.palette.primary.outlinedBorder}`
|
|
5813
5854
|
}));
|
|
5814
|
-
var UploaderIcon =
|
|
5855
|
+
var UploaderIcon = styled29(MuiFileUploadIcon, {
|
|
5815
5856
|
name: "Uploader",
|
|
5816
5857
|
slot: "iconContainer",
|
|
5817
5858
|
shouldForwardProp: (prop) => prop !== "error"
|
|
@@ -5820,7 +5861,7 @@ var UploaderIcon = styled28(MuiFileUploadIcon, {
|
|
|
5820
5861
|
width: "32px",
|
|
5821
5862
|
height: "32px"
|
|
5822
5863
|
}));
|
|
5823
|
-
var Uploader =
|
|
5864
|
+
var Uploader = React45.memo(
|
|
5824
5865
|
(props) => {
|
|
5825
5866
|
const {
|
|
5826
5867
|
accept,
|
|
@@ -5835,14 +5876,14 @@ var Uploader = React43.memo(
|
|
|
5835
5876
|
disabled,
|
|
5836
5877
|
onDelete
|
|
5837
5878
|
} = props;
|
|
5838
|
-
const dropZoneRef =
|
|
5839
|
-
const inputRef =
|
|
5840
|
-
const [errorText, setErrorText] =
|
|
5841
|
-
const [files, setFiles] =
|
|
5842
|
-
const [uploaded, setUploaded] =
|
|
5843
|
-
const [previewState, setPreviewState] =
|
|
5844
|
-
const accepts =
|
|
5845
|
-
const parsedAccepts =
|
|
5879
|
+
const dropZoneRef = useRef10(null);
|
|
5880
|
+
const inputRef = useRef10(null);
|
|
5881
|
+
const [errorText, setErrorText] = useState13();
|
|
5882
|
+
const [files, setFiles] = useState13([]);
|
|
5883
|
+
const [uploaded, setUploaded] = useState13(props.uploaded || []);
|
|
5884
|
+
const [previewState, setPreviewState] = useState13("idle");
|
|
5885
|
+
const accepts = useMemo14(() => accept.split(",").map((accept2) => accept2.trim()), [accept]);
|
|
5886
|
+
const parsedAccepts = useMemo14(
|
|
5846
5887
|
() => accepts.flatMap((type) => {
|
|
5847
5888
|
if (["image/*", "video/*", "audio/*"].includes(type)) {
|
|
5848
5889
|
return ALL_EXTENSIONS_BY_TYPE[type];
|
|
@@ -5851,7 +5892,7 @@ var Uploader = React43.memo(
|
|
|
5851
5892
|
}),
|
|
5852
5893
|
[accepts]
|
|
5853
5894
|
);
|
|
5854
|
-
const helperText =
|
|
5895
|
+
const helperText = useMemo14(() => {
|
|
5855
5896
|
const [allAcceptedTypes, acceptedTypes] = [
|
|
5856
5897
|
accepts.filter((accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
|
|
5857
5898
|
const [type] = accept2.split("/");
|
|
@@ -5878,12 +5919,12 @@ var Uploader = React43.memo(
|
|
|
5878
5919
|
}
|
|
5879
5920
|
return helperTexts.join(", ");
|
|
5880
5921
|
}, [accepts, maxFileTotalSize, maxCount]);
|
|
5881
|
-
const error =
|
|
5882
|
-
const showDropZone =
|
|
5922
|
+
const error = useMemo14(() => !!errorText || props.error, [props.error, errorText]);
|
|
5923
|
+
const showDropZone = useMemo14(
|
|
5883
5924
|
() => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
|
|
5884
5925
|
[files, maxCount, uploaded]
|
|
5885
5926
|
);
|
|
5886
|
-
const addFiles =
|
|
5927
|
+
const addFiles = useCallback16(
|
|
5887
5928
|
(uploads) => {
|
|
5888
5929
|
try {
|
|
5889
5930
|
const types = parsedAccepts.map((type) => type.replace(".", "")) || [];
|
|
@@ -5928,7 +5969,7 @@ var Uploader = React43.memo(
|
|
|
5928
5969
|
},
|
|
5929
5970
|
[files, uploaded, maxCount, parsedAccepts, maxFileSize, maxFileTotalSize, name, onChange]
|
|
5930
5971
|
);
|
|
5931
|
-
|
|
5972
|
+
useEffect11(() => {
|
|
5932
5973
|
if (!dropZoneRef.current || disabled) {
|
|
5933
5974
|
return;
|
|
5934
5975
|
}
|
|
@@ -5966,7 +6007,7 @@ var Uploader = React43.memo(
|
|
|
5966
6007
|
);
|
|
5967
6008
|
return () => cleanup?.();
|
|
5968
6009
|
}, [disabled, addFiles]);
|
|
5969
|
-
|
|
6010
|
+
useEffect11(() => {
|
|
5970
6011
|
if (inputRef.current && minCount) {
|
|
5971
6012
|
if (files.length < minCount) {
|
|
5972
6013
|
inputRef.current.setCustomValidity(`At least ${minCount} files are required.`);
|
|
@@ -5975,14 +6016,14 @@ var Uploader = React43.memo(
|
|
|
5975
6016
|
}
|
|
5976
6017
|
}
|
|
5977
6018
|
}, [inputRef, files, minCount]);
|
|
5978
|
-
const handleFileChanged =
|
|
6019
|
+
const handleFileChanged = useCallback16(
|
|
5979
6020
|
(event) => {
|
|
5980
6021
|
const files2 = Array.from(event.target.files || []);
|
|
5981
6022
|
addFiles(files2);
|
|
5982
6023
|
},
|
|
5983
6024
|
[addFiles]
|
|
5984
6025
|
);
|
|
5985
|
-
const handleDeleteFile =
|
|
6026
|
+
const handleDeleteFile = useCallback16(
|
|
5986
6027
|
(deletedFile) => {
|
|
5987
6028
|
if (deletedFile instanceof File) {
|
|
5988
6029
|
setFiles((current) => {
|
|
@@ -6002,10 +6043,10 @@ var Uploader = React43.memo(
|
|
|
6002
6043
|
},
|
|
6003
6044
|
[name, onChange, onDelete]
|
|
6004
6045
|
);
|
|
6005
|
-
const handleUploaderButtonClick =
|
|
6046
|
+
const handleUploaderButtonClick = useCallback16(() => {
|
|
6006
6047
|
inputRef.current?.click();
|
|
6007
6048
|
}, []);
|
|
6008
|
-
const uploader = /* @__PURE__ */
|
|
6049
|
+
const uploader = /* @__PURE__ */ React45.createElement(
|
|
6009
6050
|
FileDropZone,
|
|
6010
6051
|
{
|
|
6011
6052
|
state: previewState,
|
|
@@ -6013,8 +6054,8 @@ var Uploader = React43.memo(
|
|
|
6013
6054
|
ref: dropZoneRef,
|
|
6014
6055
|
onClick: handleUploaderButtonClick
|
|
6015
6056
|
},
|
|
6016
|
-
/* @__PURE__ */
|
|
6017
|
-
/* @__PURE__ */
|
|
6057
|
+
/* @__PURE__ */ React45.createElement(Stack_default, { alignItems: "center", gap: 1 }, /* @__PURE__ */ React45.createElement(UploaderIcon, { state: previewState, error: !!(error || errorText) })),
|
|
6058
|
+
/* @__PURE__ */ React45.createElement(
|
|
6018
6059
|
VisuallyHiddenInput,
|
|
6019
6060
|
{
|
|
6020
6061
|
disabled,
|
|
@@ -6037,7 +6078,7 @@ var Uploader = React43.memo(
|
|
|
6037
6078
|
}
|
|
6038
6079
|
)
|
|
6039
6080
|
);
|
|
6040
|
-
return /* @__PURE__ */
|
|
6081
|
+
return /* @__PURE__ */ React45.createElement(UploaderRoot, null, showDropZone && /* @__PURE__ */ React45.createElement(FormControl_default, { size, error: !!(error || errorText), disabled, required: !!minCount }, label && /* @__PURE__ */ React45.createElement(FormLabel_default, null, label), uploader, /* @__PURE__ */ React45.createElement(FormHelperText_default, null, /* @__PURE__ */ React45.createElement(Stack_default, null, errorText && /* @__PURE__ */ React45.createElement("div", null, errorText), /* @__PURE__ */ React45.createElement("div", null, helperText)))), [...uploaded, ...files].length > 0 && /* @__PURE__ */ React45.createElement(Preview, { files, uploaded, onDelete: handleDeleteFile }));
|
|
6041
6082
|
}
|
|
6042
6083
|
);
|
|
6043
6084
|
Uploader.displayName = "Uploader";
|
|
@@ -6201,7 +6242,7 @@ export {
|
|
|
6201
6242
|
stepButtonClasses,
|
|
6202
6243
|
stepClasses2 as stepClasses,
|
|
6203
6244
|
stepperClasses,
|
|
6204
|
-
|
|
6245
|
+
styled30 as styled,
|
|
6205
6246
|
switchClasses2 as switchClasses,
|
|
6206
6247
|
tabListClasses,
|
|
6207
6248
|
tabPanelClasses,
|