@ceed/ads 1.29.0 → 1.30.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CurrencyInput/CurrencyInput.d.ts +1 -1
- package/dist/components/CurrencyInput/hooks/use-currency-setting.d.ts +2 -2
- package/dist/components/DataTable/hooks.d.ts +2 -1
- package/dist/components/DataTable/utils.d.ts +1 -0
- package/dist/components/ProfileMenu/ProfileMenu.d.ts +1 -1
- package/dist/components/SearchBar/SearchBar.d.ts +21 -0
- package/dist/components/SearchBar/index.d.ts +3 -0
- package/dist/components/data-display/Badge.md +39 -71
- package/dist/components/data-display/DataTable.md +1 -1
- package/dist/components/data-display/InfoSign.md +98 -74
- package/dist/components/data-display/Typography.md +97 -363
- package/dist/components/feedback/Dialog.md +62 -76
- package/dist/components/feedback/Modal.md +44 -259
- package/dist/components/feedback/llms.txt +0 -2
- package/dist/components/index.d.ts +2 -0
- package/dist/components/inputs/Autocomplete.md +107 -356
- package/dist/components/inputs/ButtonGroup.md +106 -115
- package/dist/components/inputs/Calendar.md +459 -98
- package/dist/components/inputs/CurrencyInput.md +5 -183
- package/dist/components/inputs/DatePicker.md +431 -108
- package/dist/components/inputs/DateRangePicker.md +492 -131
- package/dist/components/inputs/FilterMenu.md +19 -169
- package/dist/components/inputs/FilterableCheckboxGroup.md +23 -123
- package/dist/components/inputs/IconButton.md +88 -137
- package/dist/components/inputs/Input.md +0 -5
- package/dist/components/inputs/MonthPicker.md +422 -95
- package/dist/components/inputs/MonthRangePicker.md +466 -89
- package/dist/components/inputs/PercentageInput.md +16 -185
- package/dist/components/inputs/RadioButton.md +35 -163
- package/dist/components/inputs/RadioTileGroup.md +61 -150
- package/dist/components/inputs/SearchBar.md +44 -0
- package/dist/components/inputs/Select.md +326 -222
- package/dist/components/inputs/Switch.md +376 -136
- package/dist/components/inputs/Textarea.md +10 -213
- package/dist/components/inputs/Uploader/Uploader.md +66 -145
- package/dist/components/inputs/llms.txt +1 -3
- package/dist/components/navigation/Breadcrumbs.md +322 -80
- package/dist/components/navigation/Dropdown.md +221 -92
- package/dist/components/navigation/IconMenuButton.md +502 -40
- package/dist/components/navigation/InsetDrawer.md +738 -68
- package/dist/components/navigation/Link.md +298 -39
- package/dist/components/navigation/Menu.md +285 -92
- package/dist/components/navigation/MenuButton.md +448 -55
- package/dist/components/navigation/Pagination.md +338 -47
- package/dist/components/navigation/ProfileMenu.md +268 -45
- package/dist/components/navigation/Stepper.md +28 -160
- package/dist/components/navigation/Tabs.md +316 -57
- package/dist/components/surfaces/Sheet.md +334 -151
- package/dist/index.browser.js +15 -13
- package/dist/index.browser.js.map +4 -4
- package/dist/index.cjs +313 -291
- package/dist/index.d.ts +1 -1
- package/dist/index.js +450 -372
- package/dist/llms.txt +1 -8
- package/framer/index.js +1 -1
- package/package.json +16 -15
- package/dist/chunks/rehype-accent-FZRUD7VI.js +0 -39
- package/dist/components/feedback/CircularProgress.md +0 -257
- package/dist/components/feedback/Skeleton.md +0 -280
- package/dist/components/inputs/FormControl.md +0 -361
- package/dist/components/inputs/RadioList.md +0 -241
- package/dist/components/inputs/Slider.md +0 -334
- package/dist/guides/ThemeProvider.md +0 -116
- package/dist/guides/llms.txt +0 -9
package/dist/index.js
CHANGED
|
@@ -1,3 +1,59 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __esm = (fn, res) => function __init() {
|
|
4
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
5
|
+
};
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// src/libs/rehype-accent/index.ts
|
|
12
|
+
var rehype_accent_exports = {};
|
|
13
|
+
__export(rehype_accent_exports, {
|
|
14
|
+
rehypeAccent: () => rehypeAccent
|
|
15
|
+
});
|
|
16
|
+
import { visit } from "unist-util-visit";
|
|
17
|
+
function rehypeAccent(options) {
|
|
18
|
+
const { accentColor } = options;
|
|
19
|
+
return (tree) => {
|
|
20
|
+
visit(tree, "text", (node, index, parent) => {
|
|
21
|
+
const value = node.value;
|
|
22
|
+
const regex = /\|\|.*?\|\|/g;
|
|
23
|
+
let match;
|
|
24
|
+
let lastIndex = 0;
|
|
25
|
+
const newNodes = [];
|
|
26
|
+
while ((match = regex.exec(value)) !== null) {
|
|
27
|
+
if (match.index > lastIndex) {
|
|
28
|
+
newNodes.push({
|
|
29
|
+
type: "text",
|
|
30
|
+
value: value.slice(lastIndex, match.index)
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const innerText = match[0].split("||")[1];
|
|
34
|
+
newNodes.push({
|
|
35
|
+
type: "element",
|
|
36
|
+
tagName: "span",
|
|
37
|
+
properties: { textColor: accentColor },
|
|
38
|
+
children: [{ type: "text", value: innerText }]
|
|
39
|
+
});
|
|
40
|
+
lastIndex = match.index + match[0].length;
|
|
41
|
+
}
|
|
42
|
+
if (lastIndex < value.length) {
|
|
43
|
+
newNodes.push({ type: "text", value: value.slice(lastIndex) });
|
|
44
|
+
}
|
|
45
|
+
if (newNodes.length) {
|
|
46
|
+
parent.children.splice(index, 1, ...newNodes);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
var init_rehype_accent = __esm({
|
|
52
|
+
"src/libs/rehype-accent/index.ts"() {
|
|
53
|
+
"use strict";
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
1
57
|
// src/index.ts
|
|
2
58
|
import {
|
|
3
59
|
useTheme as useTheme2,
|
|
@@ -693,24 +749,11 @@ Button.displayName = "Button";
|
|
|
693
749
|
var Button_default = Button;
|
|
694
750
|
|
|
695
751
|
// src/components/Calendar/Calendar.tsx
|
|
696
|
-
import
|
|
752
|
+
import React11, { Fragment, forwardRef as forwardRef4, useMemo as useMemo4 } from "react";
|
|
697
753
|
import { styled as styled5 } from "@mui/joy";
|
|
698
754
|
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
|
|
699
755
|
import ChevronRightIcon from "@mui/icons-material/ChevronRight";
|
|
700
|
-
import { AnimatePresence, motion as
|
|
701
|
-
|
|
702
|
-
// src/components/Tooltip/Tooltip.tsx
|
|
703
|
-
import React10 from "react";
|
|
704
|
-
import { Tooltip as JoyTooltip } from "@mui/joy";
|
|
705
|
-
import { motion as motion12 } from "framer-motion";
|
|
706
|
-
var MotionTooltip = motion12(JoyTooltip);
|
|
707
|
-
var Tooltip = (props) => {
|
|
708
|
-
return /* @__PURE__ */ React10.createElement(MotionTooltip, { ...props });
|
|
709
|
-
};
|
|
710
|
-
Tooltip.displayName = "Tooltip";
|
|
711
|
-
|
|
712
|
-
// src/components/Tooltip/index.ts
|
|
713
|
-
var Tooltip_default = Tooltip;
|
|
756
|
+
import { AnimatePresence, motion as motion12 } from "framer-motion";
|
|
714
757
|
|
|
715
758
|
// src/components/Calendar/utils/index.ts
|
|
716
759
|
var getCalendarDates = (date) => {
|
|
@@ -1069,12 +1112,6 @@ var useCalendar = (ownerState) => {
|
|
|
1069
1112
|
};
|
|
1070
1113
|
|
|
1071
1114
|
// src/components/Calendar/Calendar.tsx
|
|
1072
|
-
var MONTH_VIEW_HINT_MESSAGE = "Click the month title to view all months.";
|
|
1073
|
-
var MONTH_NAV_CLICK_WINDOW_MS = 1200;
|
|
1074
|
-
var MONTH_NAV_CLICK_THRESHOLD = 3;
|
|
1075
|
-
var MONTH_VIEW_HINT_DURATION_MS = 5e3;
|
|
1076
|
-
var MONTH_VIEW_HINT_COOLDOWN_MS = 3e4;
|
|
1077
|
-
var lastMonthViewAssistHintShownAt = 0;
|
|
1078
1115
|
var CalendarRoot = styled5("div", {
|
|
1079
1116
|
name: "Calendar",
|
|
1080
1117
|
slot: "root"
|
|
@@ -1101,7 +1138,7 @@ var CalendarViewContainer = styled5("div", {
|
|
|
1101
1138
|
overflow: "hidden",
|
|
1102
1139
|
minHeight: calendarType === "datePicker" ? "250px" : "unset"
|
|
1103
1140
|
}));
|
|
1104
|
-
var CalendarViewTable = styled5(
|
|
1141
|
+
var CalendarViewTable = styled5(motion12.table, {
|
|
1105
1142
|
name: "Calendar",
|
|
1106
1143
|
slot: "viewTable"
|
|
1107
1144
|
})(({ theme }) => ({
|
|
@@ -1281,7 +1318,7 @@ var PickerDays = (props) => {
|
|
|
1281
1318
|
const { getPickerDayProps, getDayCellProps } = useCalendar(ownerState);
|
|
1282
1319
|
const calendarDates = useMemo4(() => getCalendarDates(ownerState.viewMonth), [ownerState.viewMonth]);
|
|
1283
1320
|
const weekdayNames = useMemo4(() => getWeekdayNames(ownerState.locale || "default"), [ownerState.locale]);
|
|
1284
|
-
return /* @__PURE__ */
|
|
1321
|
+
return /* @__PURE__ */ React11.createElement(CalendarViewContainer, { calendarType: "datePicker" }, /* @__PURE__ */ React11.createElement(AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ React11.createElement(
|
|
1285
1322
|
CalendarViewTable,
|
|
1286
1323
|
{
|
|
1287
1324
|
key: `${ownerState.viewMonth.toString()}_${ownerState.direction}`,
|
|
@@ -1310,10 +1347,10 @@ var PickerDays = (props) => {
|
|
|
1310
1347
|
}
|
|
1311
1348
|
}
|
|
1312
1349
|
},
|
|
1313
|
-
/* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
(date, i) => date ? /* @__PURE__ */
|
|
1316
|
-
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */
|
|
1350
|
+
/* @__PURE__ */ React11.createElement(CalendarWeekHeaderContainer, null, /* @__PURE__ */ React11.createElement("tr", null, weekdayNames.map((name, i) => /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${name}_${i}` }, /* @__PURE__ */ React11.createElement("th", null, /* @__PURE__ */ React11.createElement(Typography_default, { level: "body-xs", textAlign: "center" }, name)), i < 6 && /* @__PURE__ */ React11.createElement("th", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" }))))),
|
|
1351
|
+
/* @__PURE__ */ React11.createElement(CalendarDayPickerContainer, null, calendarDates.map((weekDates, rowIndex) => /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${rowIndex}` }, /* @__PURE__ */ React11.createElement("tr", null, weekDates.map(
|
|
1352
|
+
(date, i) => date ? /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${date}_${i}` }, /* @__PURE__ */ React11.createElement(CalendarDayCell, { ...getDayCellProps(date) }, /* @__PURE__ */ React11.createElement(CalendarDay, { size: "sm", variant: "plain", color: "neutral", ...getPickerDayProps(date) }, date)), i < 6 && /* @__PURE__ */ React11.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })) : /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${i}` }, /* @__PURE__ */ React11.createElement("td", null), i < 6 && /* @__PURE__ */ React11.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" }))
|
|
1353
|
+
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */ React11.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ React11.createElement("td", { colSpan: 13, style: { height: 4 } })))))
|
|
1317
1354
|
)));
|
|
1318
1355
|
};
|
|
1319
1356
|
var PickerMonths = (props) => {
|
|
@@ -1330,7 +1367,7 @@ var PickerMonths = (props) => {
|
|
|
1330
1367
|
[[]]
|
|
1331
1368
|
);
|
|
1332
1369
|
const isMonthPicker = !ownerState.views?.find((view) => view === "day");
|
|
1333
|
-
return /* @__PURE__ */
|
|
1370
|
+
return /* @__PURE__ */ React11.createElement(CalendarViewContainer, { calendarType: isMonthPicker ? "monthPicker" : "datePicker" }, /* @__PURE__ */ React11.createElement(AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ React11.createElement(
|
|
1334
1371
|
CalendarViewTable,
|
|
1335
1372
|
{
|
|
1336
1373
|
key: `${ownerState.viewMonth.getFullYear()}_${ownerState.direction}`,
|
|
@@ -1359,7 +1396,7 @@ var PickerMonths = (props) => {
|
|
|
1359
1396
|
}
|
|
1360
1397
|
}
|
|
1361
1398
|
},
|
|
1362
|
-
/* @__PURE__ */
|
|
1399
|
+
/* @__PURE__ */ React11.createElement("tbody", null, chunkedMonths.map((months, i) => /* @__PURE__ */ React11.createElement(Fragment, { key: months.join("_") }, /* @__PURE__ */ React11.createElement("tr", null, months.map((monthIndex, j) => /* @__PURE__ */ React11.createElement(Fragment, { key: monthIndex }, /* @__PURE__ */ React11.createElement(CalendarMonthCell, { ...getMonthCellProps(monthIndex) }, /* @__PURE__ */ React11.createElement(CalendarMonth, { size: "sm", variant: "plain", color: "neutral", ...getPickerMonthProps(monthIndex) }, getMonthNameFromIndex(monthIndex, ownerState.locale))), j < 3 && /* @__PURE__ */ React11.createElement("td", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" })))), i < chunkedMonths.length - 1 && /* @__PURE__ */ React11.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ React11.createElement("td", { colSpan: 7, style: { height: 4 } })))))
|
|
1363
1400
|
)));
|
|
1364
1401
|
};
|
|
1365
1402
|
var Calendar = forwardRef4((inProps, ref) => {
|
|
@@ -1381,96 +1418,17 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1381
1418
|
...others
|
|
1382
1419
|
} = props;
|
|
1383
1420
|
const { calendarTitle, onPrev, onNext } = useCalendar(ownerState);
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
const monthViewAssistHintShownInSessionRef = useRef3(false);
|
|
1387
|
-
const monthViewAssistHintTimeoutRef = useRef3(null);
|
|
1388
|
-
const hasEndDate = Boolean(value?.[1]);
|
|
1389
|
-
const isRangeHintEligible = Boolean(rangeSelection && !hasEndDate);
|
|
1390
|
-
const isHintEligible = Boolean(view === "day" && (!rangeSelection || isRangeHintEligible));
|
|
1391
|
-
const monthViewHintMessage = MONTH_VIEW_HINT_MESSAGE;
|
|
1392
|
-
useEffect3(() => {
|
|
1393
|
-
if (!isHintEligible) {
|
|
1394
|
-
monthNavClickTimestampsRef.current = [];
|
|
1395
|
-
setIsMonthViewAssistHintOpen(false);
|
|
1396
|
-
}
|
|
1397
|
-
}, [isHintEligible]);
|
|
1398
|
-
useEffect3(() => {
|
|
1399
|
-
return () => {
|
|
1400
|
-
if (monthViewAssistHintTimeoutRef.current) {
|
|
1401
|
-
clearTimeout(monthViewAssistHintTimeoutRef.current);
|
|
1402
|
-
}
|
|
1403
|
-
};
|
|
1404
|
-
}, []);
|
|
1405
|
-
const closeMonthViewAssistHint = useCallback5(() => {
|
|
1406
|
-
if (monthViewAssistHintTimeoutRef.current) {
|
|
1407
|
-
clearTimeout(monthViewAssistHintTimeoutRef.current);
|
|
1408
|
-
monthViewAssistHintTimeoutRef.current = null;
|
|
1409
|
-
}
|
|
1410
|
-
setIsMonthViewAssistHintOpen(false);
|
|
1411
|
-
}, []);
|
|
1412
|
-
const showMonthViewAssistHint = useCallback5(() => {
|
|
1413
|
-
const now = Date.now();
|
|
1414
|
-
if (monthViewAssistHintShownInSessionRef.current) return;
|
|
1415
|
-
if (now - lastMonthViewAssistHintShownAt < MONTH_VIEW_HINT_COOLDOWN_MS) return;
|
|
1416
|
-
monthViewAssistHintShownInSessionRef.current = true;
|
|
1417
|
-
lastMonthViewAssistHintShownAt = now;
|
|
1418
|
-
setIsMonthViewAssistHintOpen(true);
|
|
1419
|
-
if (monthViewAssistHintTimeoutRef.current) {
|
|
1420
|
-
clearTimeout(monthViewAssistHintTimeoutRef.current);
|
|
1421
|
-
}
|
|
1422
|
-
monthViewAssistHintTimeoutRef.current = setTimeout(() => {
|
|
1423
|
-
setIsMonthViewAssistHintOpen(false);
|
|
1424
|
-
monthViewAssistHintTimeoutRef.current = null;
|
|
1425
|
-
}, MONTH_VIEW_HINT_DURATION_MS);
|
|
1426
|
-
}, []);
|
|
1427
|
-
const trackFastMonthNavigation = useCallback5(() => {
|
|
1428
|
-
if (!isHintEligible) return;
|
|
1429
|
-
const now = Date.now();
|
|
1430
|
-
monthNavClickTimestampsRef.current = [
|
|
1431
|
-
...monthNavClickTimestampsRef.current.filter((timestamp) => now - timestamp <= MONTH_NAV_CLICK_WINDOW_MS),
|
|
1432
|
-
now
|
|
1433
|
-
];
|
|
1434
|
-
if (monthNavClickTimestampsRef.current.length >= MONTH_NAV_CLICK_THRESHOLD) {
|
|
1435
|
-
showMonthViewAssistHint();
|
|
1436
|
-
}
|
|
1437
|
-
}, [isHintEligible, showMonthViewAssistHint]);
|
|
1438
|
-
const handlePrevClick = useCallback5(() => {
|
|
1439
|
-
onPrev();
|
|
1440
|
-
trackFastMonthNavigation();
|
|
1441
|
-
}, [onPrev, trackFastMonthNavigation]);
|
|
1442
|
-
const handleNextClick = useCallback5(() => {
|
|
1443
|
-
onNext();
|
|
1444
|
-
trackFastMonthNavigation();
|
|
1445
|
-
}, [onNext, trackFastMonthNavigation]);
|
|
1446
|
-
const handleSwitchViewClick = useCallback5(() => {
|
|
1447
|
-
closeMonthViewAssistHint();
|
|
1448
|
-
onViewChange?.();
|
|
1449
|
-
}, [closeMonthViewAssistHint, onViewChange]);
|
|
1450
|
-
return /* @__PURE__ */ React12.createElement(CalendarRoot, { ref, ...others }, /* @__PURE__ */ React12.createElement(CalendarHeader, null, /* @__PURE__ */ React12.createElement(IconButton_default, { size: "sm", onClick: handlePrevClick, "aria-label": `Previous ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ React12.createElement(ChevronLeftIcon, null)), /* @__PURE__ */ React12.createElement(
|
|
1451
|
-
Tooltip_default,
|
|
1421
|
+
return /* @__PURE__ */ React11.createElement(CalendarRoot, { ref, ...others }, /* @__PURE__ */ React11.createElement(CalendarHeader, null, /* @__PURE__ */ React11.createElement(IconButton_default, { size: "sm", onClick: onPrev, "aria-label": `Previous ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ React11.createElement(ChevronLeftIcon, null)), /* @__PURE__ */ React11.createElement(
|
|
1422
|
+
CalendarSwitchViewButton,
|
|
1452
1423
|
{
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
disableHoverListener: true,
|
|
1459
|
-
disableTouchListener: true,
|
|
1460
|
-
variant: "solid"
|
|
1424
|
+
ownerState,
|
|
1425
|
+
variant: "plain",
|
|
1426
|
+
color: "neutral",
|
|
1427
|
+
onClick: onViewChange,
|
|
1428
|
+
"aria-label": "Switch Calendar View"
|
|
1461
1429
|
},
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
{
|
|
1465
|
-
ownerState,
|
|
1466
|
-
variant: "plain",
|
|
1467
|
-
color: "neutral",
|
|
1468
|
-
onClick: handleSwitchViewClick,
|
|
1469
|
-
"aria-label": "Switch Calendar View"
|
|
1470
|
-
},
|
|
1471
|
-
calendarTitle
|
|
1472
|
-
)
|
|
1473
|
-
), /* @__PURE__ */ React12.createElement(IconButton_default, { size: "sm", onClick: handleNextClick, "aria-label": `Next ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ React12.createElement(ChevronRightIcon, null))), view === "day" && /* @__PURE__ */ React12.createElement(PickerDays, { ownerState }), view === "month" && /* @__PURE__ */ React12.createElement(PickerMonths, { ownerState }));
|
|
1430
|
+
calendarTitle
|
|
1431
|
+
), /* @__PURE__ */ React11.createElement(IconButton_default, { size: "sm", onClick: onNext, "aria-label": `Next ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ React11.createElement(ChevronRightIcon, null))), view === "day" && /* @__PURE__ */ React11.createElement(PickerDays, { ownerState }), view === "month" && /* @__PURE__ */ React11.createElement(PickerMonths, { ownerState }));
|
|
1474
1432
|
});
|
|
1475
1433
|
Calendar.displayName = "Calendar";
|
|
1476
1434
|
|
|
@@ -1485,30 +1443,30 @@ import {
|
|
|
1485
1443
|
CardActions as JoyCardActions,
|
|
1486
1444
|
CardOverflow as JoyCardOverflow
|
|
1487
1445
|
} from "@mui/joy";
|
|
1488
|
-
import { motion as
|
|
1489
|
-
var MotionCard =
|
|
1446
|
+
import { motion as motion13 } from "framer-motion";
|
|
1447
|
+
var MotionCard = motion13(JoyCard);
|
|
1490
1448
|
var Card = MotionCard;
|
|
1491
1449
|
Card.displayName = "Card";
|
|
1492
|
-
var MotionCardContent =
|
|
1450
|
+
var MotionCardContent = motion13(JoyCardContent);
|
|
1493
1451
|
var CardContent = MotionCardContent;
|
|
1494
1452
|
CardContent.displayName = "CardContent";
|
|
1495
|
-
var MotionCardCover =
|
|
1453
|
+
var MotionCardCover = motion13(JoyCardCover);
|
|
1496
1454
|
var CardCover = MotionCardCover;
|
|
1497
1455
|
CardCover.displayName = "CardCover";
|
|
1498
|
-
var MotionCardActions =
|
|
1456
|
+
var MotionCardActions = motion13(JoyCardActions);
|
|
1499
1457
|
var CardActions = MotionCardActions;
|
|
1500
1458
|
CardActions.displayName = "CardActions";
|
|
1501
|
-
var MotionCardOverflow =
|
|
1459
|
+
var MotionCardOverflow = motion13(JoyCardOverflow);
|
|
1502
1460
|
var CardOverflow = MotionCardOverflow;
|
|
1503
1461
|
CardOverflow.displayName = "CardOverflow";
|
|
1504
1462
|
|
|
1505
1463
|
// src/components/Checkbox/Checkbox.tsx
|
|
1506
|
-
import
|
|
1464
|
+
import React12 from "react";
|
|
1507
1465
|
import { Checkbox as JoyCheckbox } from "@mui/joy";
|
|
1508
|
-
import { motion as
|
|
1509
|
-
var MotionCheckbox =
|
|
1466
|
+
import { motion as motion14 } from "framer-motion";
|
|
1467
|
+
var MotionCheckbox = motion14(JoyCheckbox);
|
|
1510
1468
|
var Checkbox = (props) => {
|
|
1511
|
-
return /* @__PURE__ */
|
|
1469
|
+
return /* @__PURE__ */ React12.createElement(MotionCheckbox, { ...props });
|
|
1512
1470
|
};
|
|
1513
1471
|
Checkbox.displayName = "Checkbox";
|
|
1514
1472
|
|
|
@@ -1517,7 +1475,7 @@ var Checkbox_default = Checkbox;
|
|
|
1517
1475
|
|
|
1518
1476
|
// src/components/Container/Container.tsx
|
|
1519
1477
|
import { styled as styled6 } from "@mui/joy";
|
|
1520
|
-
import
|
|
1478
|
+
import React13, { forwardRef as forwardRef5 } from "react";
|
|
1521
1479
|
var ContainerRoot = styled6("div", {
|
|
1522
1480
|
name: "Container",
|
|
1523
1481
|
slot: "root",
|
|
@@ -1544,23 +1502,24 @@ var ContainerRoot = styled6("div", {
|
|
|
1544
1502
|
} : null
|
|
1545
1503
|
]);
|
|
1546
1504
|
var Container = forwardRef5(function Container2(props, ref) {
|
|
1547
|
-
return /* @__PURE__ */
|
|
1505
|
+
return /* @__PURE__ */ React13.createElement(ContainerRoot, { ref, ...props });
|
|
1548
1506
|
});
|
|
1549
1507
|
Container.displayName = "Container";
|
|
1550
1508
|
|
|
1551
1509
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
1552
|
-
import
|
|
1510
|
+
import React15, { useCallback as useCallback6, useMemo as useMemo5, useState as useState5 } from "react";
|
|
1511
|
+
import { IntlMessageFormat as IntlMessageFormat2 } from "intl-messageformat";
|
|
1553
1512
|
import { NumericFormat } from "react-number-format";
|
|
1554
1513
|
|
|
1555
1514
|
// src/components/Input/Input.tsx
|
|
1556
|
-
import
|
|
1515
|
+
import React14, { useCallback as useCallback5, useState as useState4 } from "react";
|
|
1557
1516
|
import { Input as JoyInput } from "@mui/joy";
|
|
1558
|
-
import { motion as
|
|
1517
|
+
import { motion as motion15 } from "framer-motion";
|
|
1559
1518
|
import ClearIcon from "@mui/icons-material/Close";
|
|
1560
1519
|
import VisibilityIcon from "@mui/icons-material/Visibility";
|
|
1561
1520
|
import VisibilityOffIcon from "@mui/icons-material/VisibilityOff";
|
|
1562
|
-
var MotionInput =
|
|
1563
|
-
var Input =
|
|
1521
|
+
var MotionInput = motion15(JoyInput);
|
|
1522
|
+
var Input = React14.forwardRef((props, ref) => {
|
|
1564
1523
|
const {
|
|
1565
1524
|
label,
|
|
1566
1525
|
helperText,
|
|
@@ -1583,11 +1542,11 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
1583
1542
|
if (type === "password" && innerProps.endDecorator) {
|
|
1584
1543
|
console.warn('Input: endDecorator is not supported when type="password"');
|
|
1585
1544
|
}
|
|
1586
|
-
const [passwordVisible, setPasswordVisible] =
|
|
1545
|
+
const [passwordVisible, setPasswordVisible] = useState4(false);
|
|
1587
1546
|
const [value, setValue] = useControlledState(
|
|
1588
1547
|
props.value,
|
|
1589
1548
|
props.defaultValue,
|
|
1590
|
-
|
|
1549
|
+
useCallback5(
|
|
1591
1550
|
(value2) => {
|
|
1592
1551
|
onChange?.({
|
|
1593
1552
|
/**
|
|
@@ -1613,7 +1572,7 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
1613
1572
|
const actualType = type === "password" && passwordVisible ? "text" : type;
|
|
1614
1573
|
const isPasswordType = type === "password";
|
|
1615
1574
|
const showPasswordToggle = isPasswordType && !disableTogglePasswordButton;
|
|
1616
|
-
const input = /* @__PURE__ */
|
|
1575
|
+
const input = /* @__PURE__ */ React14.createElement(
|
|
1617
1576
|
MotionInput,
|
|
1618
1577
|
{
|
|
1619
1578
|
value,
|
|
@@ -1628,7 +1587,7 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
1628
1587
|
...innerProps.slotProps
|
|
1629
1588
|
},
|
|
1630
1589
|
...innerProps,
|
|
1631
|
-
endDecorator: isPasswordType ? showPasswordToggle ? /* @__PURE__ */
|
|
1590
|
+
endDecorator: isPasswordType ? showPasswordToggle ? /* @__PURE__ */ React14.createElement(Stack_default, { gap: 1, direction: "row" }, /* @__PURE__ */ React14.createElement(
|
|
1632
1591
|
IconButton_default,
|
|
1633
1592
|
{
|
|
1634
1593
|
onMouseDown: (e) => e.preventDefault(),
|
|
@@ -1636,19 +1595,19 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
1636
1595
|
disabled,
|
|
1637
1596
|
"aria-label": passwordVisible ? "Hide password" : "Show password"
|
|
1638
1597
|
},
|
|
1639
|
-
passwordVisible ? /* @__PURE__ */
|
|
1640
|
-
)) : null : enableClearable ? /* @__PURE__ */
|
|
1598
|
+
passwordVisible ? /* @__PURE__ */ React14.createElement(VisibilityOffIcon, null) : /* @__PURE__ */ React14.createElement(VisibilityIcon, null)
|
|
1599
|
+
)) : null : enableClearable ? /* @__PURE__ */ React14.createElement(Stack_default, { gap: 1, direction: "row" }, innerProps.endDecorator, value && /* @__PURE__ */ React14.createElement(
|
|
1641
1600
|
IconButton_default,
|
|
1642
1601
|
{
|
|
1643
1602
|
onMouseDown: (e) => e.preventDefault(),
|
|
1644
1603
|
onClick: handleClear,
|
|
1645
1604
|
"aria-label": "Clear"
|
|
1646
1605
|
},
|
|
1647
|
-
/* @__PURE__ */
|
|
1606
|
+
/* @__PURE__ */ React14.createElement(ClearIcon, null)
|
|
1648
1607
|
)) : innerProps.endDecorator
|
|
1649
1608
|
}
|
|
1650
1609
|
);
|
|
1651
|
-
return /* @__PURE__ */
|
|
1610
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1652
1611
|
FormControl_default,
|
|
1653
1612
|
{
|
|
1654
1613
|
required,
|
|
@@ -1659,9 +1618,9 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
1659
1618
|
sx,
|
|
1660
1619
|
className
|
|
1661
1620
|
},
|
|
1662
|
-
label && /* @__PURE__ */
|
|
1621
|
+
label && /* @__PURE__ */ React14.createElement(FormLabel_default, null, label),
|
|
1663
1622
|
input,
|
|
1664
|
-
helperText && /* @__PURE__ */
|
|
1623
|
+
helperText && /* @__PURE__ */ React14.createElement(FormHelperText_default, null, helperText)
|
|
1665
1624
|
);
|
|
1666
1625
|
});
|
|
1667
1626
|
Input.displayName = "Input";
|
|
@@ -1673,6 +1632,7 @@ var Input_default = Input;
|
|
|
1673
1632
|
import { styled as styled7, useThemeProps as useThemeProps3 } from "@mui/joy";
|
|
1674
1633
|
|
|
1675
1634
|
// src/components/CurrencyInput/hooks/use-currency-setting.ts
|
|
1635
|
+
import IntlMessageFormat from "intl-messageformat";
|
|
1676
1636
|
var CURRENCY_DECIMAL_MAP = {
|
|
1677
1637
|
AED: 2,
|
|
1678
1638
|
ALL: 2,
|
|
@@ -1817,10 +1777,9 @@ var CURRENCY_DECIMAL_MAP = {
|
|
|
1817
1777
|
};
|
|
1818
1778
|
var useCurrencySetting = (props) => {
|
|
1819
1779
|
const { currency = "USD", placeholder } = props;
|
|
1820
|
-
const
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
const decimalSeparator = parts.find((p) => p.type === "decimal")?.value;
|
|
1780
|
+
const [symbol, thousandSeparator, decimalSeparator, ...rest] = new IntlMessageFormat(
|
|
1781
|
+
`{amount, number, ::currency/${currency} unit-width-narrow}`
|
|
1782
|
+
).format({ amount: 1e3 }).toString().replace(/\d/g, "").split("");
|
|
1824
1783
|
const decimalScale = CURRENCY_DECIMAL_MAP[currency];
|
|
1825
1784
|
return {
|
|
1826
1785
|
symbol: `${symbol} `,
|
|
@@ -1833,9 +1792,9 @@ var useCurrencySetting = (props) => {
|
|
|
1833
1792
|
};
|
|
1834
1793
|
|
|
1835
1794
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
1836
|
-
var TextMaskAdapter =
|
|
1795
|
+
var TextMaskAdapter = React15.forwardRef(function TextMaskAdapter2(props, ref) {
|
|
1837
1796
|
const { onChange, ...innerProps } = props;
|
|
1838
|
-
return /* @__PURE__ */
|
|
1797
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1839
1798
|
NumericFormat,
|
|
1840
1799
|
{
|
|
1841
1800
|
...innerProps,
|
|
@@ -1855,7 +1814,7 @@ var CurrencyInputRoot = styled7(Input_default, {
|
|
|
1855
1814
|
slot: "root",
|
|
1856
1815
|
overridesResolver: (props, styles) => styles.root
|
|
1857
1816
|
})({});
|
|
1858
|
-
var CurrencyInput =
|
|
1817
|
+
var CurrencyInput = React15.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
1859
1818
|
const props = useThemeProps3({ props: inProps, name: "CurrencyInput" });
|
|
1860
1819
|
const {
|
|
1861
1820
|
currency = "USD",
|
|
@@ -1876,7 +1835,7 @@ var CurrencyInput = React16.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
1876
1835
|
const [_value, setValue] = useControlledState(
|
|
1877
1836
|
props.value,
|
|
1878
1837
|
props.defaultValue,
|
|
1879
|
-
|
|
1838
|
+
useCallback6((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
1880
1839
|
);
|
|
1881
1840
|
const value = useMemo5(() => {
|
|
1882
1841
|
if (_value && useMinorUnit) {
|
|
@@ -1890,14 +1849,14 @@ var CurrencyInput = React16.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
1890
1849
|
}
|
|
1891
1850
|
return props.max;
|
|
1892
1851
|
}, [props.max, useMinorUnit, decimalScale]);
|
|
1893
|
-
const [isOverLimit, setIsOverLimit] =
|
|
1894
|
-
const handleChange =
|
|
1852
|
+
const [isOverLimit, setIsOverLimit] = useState5(!!max && !!value && value > max);
|
|
1853
|
+
const handleChange = useCallback6(
|
|
1895
1854
|
(event) => {
|
|
1896
1855
|
if (event.target.value === "") {
|
|
1897
1856
|
setValue(void 0);
|
|
1898
1857
|
return;
|
|
1899
1858
|
}
|
|
1900
|
-
const amount = useMinorUnit ? Number(
|
|
1859
|
+
const amount = useMinorUnit ? Number(event.target.value?.replace(decimalSeparator, "")) : Number(event.target.value);
|
|
1901
1860
|
if (!!max && Number(event.target.value) > max) {
|
|
1902
1861
|
setIsOverLimit(true);
|
|
1903
1862
|
} else {
|
|
@@ -1907,7 +1866,7 @@ var CurrencyInput = React16.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
1907
1866
|
},
|
|
1908
1867
|
[decimalSeparator, max, useMinorUnit, setValue]
|
|
1909
1868
|
);
|
|
1910
|
-
return /* @__PURE__ */
|
|
1869
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1911
1870
|
CurrencyInputRoot,
|
|
1912
1871
|
{
|
|
1913
1872
|
...innerProps,
|
|
@@ -1920,7 +1879,9 @@ var CurrencyInput = React16.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
1920
1879
|
required,
|
|
1921
1880
|
color: error || isOverLimit ? "danger" : props.color,
|
|
1922
1881
|
label,
|
|
1923
|
-
helperText: isOverLimit ? `limit:
|
|
1882
|
+
helperText: isOverLimit ? new IntlMessageFormat2(`limit: {amount, number, ::currency/${currency} unit-width-narrow}`).format({
|
|
1883
|
+
amount: max
|
|
1884
|
+
}) : helperText,
|
|
1924
1885
|
slotProps: {
|
|
1925
1886
|
input: {
|
|
1926
1887
|
component: TextMaskAdapter,
|
|
@@ -1945,9 +1906,9 @@ var CurrencyInput_default = CurrencyInput;
|
|
|
1945
1906
|
|
|
1946
1907
|
// src/components/DataTable/DataTable.tsx
|
|
1947
1908
|
import React25, {
|
|
1948
|
-
useCallback as
|
|
1909
|
+
useCallback as useCallback11,
|
|
1949
1910
|
useMemo as useMemo10,
|
|
1950
|
-
useRef as
|
|
1911
|
+
useRef as useRef6,
|
|
1951
1912
|
useId,
|
|
1952
1913
|
forwardRef as forwardRef7,
|
|
1953
1914
|
useImperativeHandle as useImperativeHandle2,
|
|
@@ -2102,6 +2063,15 @@ function calculateColumnGroups(columnGroupingModel, columns, visibleFields) {
|
|
|
2102
2063
|
const correctedMaxLevel = filteredGroupsByLevel.length > 0 ? filteredGroupsByLevel.length - 1 : -1;
|
|
2103
2064
|
return { groups: filteredGroupsByLevel, maxLevel: correctedMaxLevel, fieldsInGroupingModel };
|
|
2104
2065
|
}
|
|
2066
|
+
function parsePxValue(value) {
|
|
2067
|
+
if (!value) return null;
|
|
2068
|
+
const trimmed = value.trim();
|
|
2069
|
+
if (trimmed.endsWith("px")) {
|
|
2070
|
+
const num = parseFloat(trimmed);
|
|
2071
|
+
return isNaN(num) ? null : num;
|
|
2072
|
+
}
|
|
2073
|
+
return null;
|
|
2074
|
+
}
|
|
2105
2075
|
function getTextAlign(props) {
|
|
2106
2076
|
return !props.editMode && ["number", "date", "currency"].includes(props.type || "") ? "end" : "start";
|
|
2107
2077
|
}
|
|
@@ -2173,9 +2143,9 @@ function computeAutoFitWidth(params) {
|
|
|
2173
2143
|
}
|
|
2174
2144
|
|
|
2175
2145
|
// src/components/DataTable/styled.tsx
|
|
2176
|
-
import
|
|
2146
|
+
import React16 from "react";
|
|
2177
2147
|
import { styled as styled8, LinearProgress, buttonClasses, iconButtonClasses, Typography as Typography3 } from "@mui/joy";
|
|
2178
|
-
import { motion as
|
|
2148
|
+
import { motion as motion16 } from "framer-motion";
|
|
2179
2149
|
import SortIcon from "@mui/icons-material/ArrowUpwardRounded";
|
|
2180
2150
|
var EllipsisDiv = styled8("div", {
|
|
2181
2151
|
name: "DataTable",
|
|
@@ -2259,7 +2229,7 @@ var Asterisk = styled8("span", {
|
|
|
2259
2229
|
color: "var(--ceed-palette-danger-500)",
|
|
2260
2230
|
marginLeft: theme.spacing(0.5)
|
|
2261
2231
|
}));
|
|
2262
|
-
var StyledTh = styled8(
|
|
2232
|
+
var StyledTh = styled8(motion16.th)(({ theme }) => ({
|
|
2263
2233
|
boxShadow: "1px 0 var(--TableCell-borderColor)"
|
|
2264
2234
|
}));
|
|
2265
2235
|
var StyledTd = styled8("td")(({ theme }) => ({
|
|
@@ -2278,10 +2248,10 @@ var StyledTd = styled8("td")(({ theme }) => ({
|
|
|
2278
2248
|
}
|
|
2279
2249
|
}
|
|
2280
2250
|
}));
|
|
2281
|
-
var MotionSortIcon =
|
|
2282
|
-
var DefaultLoadingOverlay = () => /* @__PURE__ */
|
|
2283
|
-
var DefaultNoRowsOverlay = () => /* @__PURE__ */
|
|
2284
|
-
var Resizer = (ref, targetRef = ref, onResizeStateChange, onAutoFit) => /* @__PURE__ */
|
|
2251
|
+
var MotionSortIcon = motion16(SortIcon);
|
|
2252
|
+
var DefaultLoadingOverlay = () => /* @__PURE__ */ React16.createElement(LinearProgress, { value: 8, variant: "plain" });
|
|
2253
|
+
var DefaultNoRowsOverlay = () => /* @__PURE__ */ React16.createElement(Typography3, { level: "body-sm", textColor: "text.tertiary" }, "No rows");
|
|
2254
|
+
var Resizer = (ref, targetRef = ref, onResizeStateChange, onAutoFit) => /* @__PURE__ */ React16.createElement(
|
|
2285
2255
|
Box_default,
|
|
2286
2256
|
{
|
|
2287
2257
|
sx: {
|
|
@@ -2359,12 +2329,12 @@ var Resizer = (ref, targetRef = ref, onResizeStateChange, onAutoFit) => /* @__PU
|
|
|
2359
2329
|
|
|
2360
2330
|
// src/components/DataTable/components.tsx
|
|
2361
2331
|
import React22, {
|
|
2362
|
-
useRef as
|
|
2363
|
-
useState as
|
|
2332
|
+
useRef as useRef4,
|
|
2333
|
+
useState as useState7,
|
|
2364
2334
|
useLayoutEffect,
|
|
2365
2335
|
useMemo as useMemo8,
|
|
2366
|
-
useCallback as
|
|
2367
|
-
useEffect as
|
|
2336
|
+
useCallback as useCallback8,
|
|
2337
|
+
useEffect as useEffect4,
|
|
2368
2338
|
memo,
|
|
2369
2339
|
createElement
|
|
2370
2340
|
} from "react";
|
|
@@ -2372,7 +2342,7 @@ import { styled as styled12, useTheme } from "@mui/joy";
|
|
|
2372
2342
|
import { AnimatePresence as AnimatePresence2 } from "framer-motion";
|
|
2373
2343
|
|
|
2374
2344
|
// src/components/DatePicker/DatePicker.tsx
|
|
2375
|
-
import
|
|
2345
|
+
import React17, { forwardRef as forwardRef6, useCallback as useCallback7, useEffect as useEffect3, useImperativeHandle, useRef as useRef3, useState as useState6 } from "react";
|
|
2376
2346
|
import { IMaskInput, IMask } from "react-imask";
|
|
2377
2347
|
import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
|
|
2378
2348
|
import { styled as styled10, useThemeProps as useThemeProps4 } from "@mui/joy";
|
|
@@ -2387,8 +2357,8 @@ var Sheet_default = Sheet;
|
|
|
2387
2357
|
|
|
2388
2358
|
// src/components/DialogActions/DialogActions.tsx
|
|
2389
2359
|
import { DialogActions as JoyDialogActions, styled as styled9 } from "@mui/joy";
|
|
2390
|
-
import { motion as
|
|
2391
|
-
var MotionDialogActions =
|
|
2360
|
+
import { motion as motion17 } from "framer-motion";
|
|
2361
|
+
var MotionDialogActions = motion17(JoyDialogActions);
|
|
2392
2362
|
var StyledDialogActions = styled9(MotionDialogActions)(({ theme }) => ({
|
|
2393
2363
|
padding: theme.spacing(2),
|
|
2394
2364
|
gap: theme.spacing(2),
|
|
@@ -2484,9 +2454,9 @@ function parseDate(dateString, format) {
|
|
|
2484
2454
|
var formatToPattern = (format) => {
|
|
2485
2455
|
return format.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
2486
2456
|
};
|
|
2487
|
-
var TextMaskAdapter3 =
|
|
2457
|
+
var TextMaskAdapter3 = React17.forwardRef(function TextMaskAdapter4(props, ref) {
|
|
2488
2458
|
const { onChange, format, ...other } = props;
|
|
2489
|
-
return /* @__PURE__ */
|
|
2459
|
+
return /* @__PURE__ */ React17.createElement(
|
|
2490
2460
|
IMaskInput,
|
|
2491
2461
|
{
|
|
2492
2462
|
...other,
|
|
@@ -2546,24 +2516,24 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2546
2516
|
shouldDisableDate,
|
|
2547
2517
|
...innerProps
|
|
2548
2518
|
} = props;
|
|
2549
|
-
const innerRef =
|
|
2550
|
-
const buttonRef =
|
|
2519
|
+
const innerRef = useRef3(null);
|
|
2520
|
+
const buttonRef = useRef3(null);
|
|
2551
2521
|
const [value, setValue] = useControlledState(
|
|
2552
2522
|
props.value,
|
|
2553
2523
|
props.defaultValue || "",
|
|
2554
|
-
|
|
2524
|
+
useCallback7((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
2555
2525
|
);
|
|
2556
|
-
const [displayValue, setDisplayValue] =
|
|
2526
|
+
const [displayValue, setDisplayValue] = useState6(
|
|
2557
2527
|
() => value ? formatValueString(parseDate(value, format), displayFormat) : ""
|
|
2558
2528
|
);
|
|
2559
|
-
const [anchorEl, setAnchorEl] =
|
|
2529
|
+
const [anchorEl, setAnchorEl] = useState6(null);
|
|
2560
2530
|
const open = Boolean(anchorEl);
|
|
2561
|
-
|
|
2531
|
+
useEffect3(() => {
|
|
2562
2532
|
if (!anchorEl) {
|
|
2563
2533
|
innerRef.current?.blur();
|
|
2564
2534
|
}
|
|
2565
2535
|
}, [anchorEl, innerRef]);
|
|
2566
|
-
|
|
2536
|
+
useEffect3(() => {
|
|
2567
2537
|
if (value === "") {
|
|
2568
2538
|
setDisplayValue("");
|
|
2569
2539
|
return;
|
|
@@ -2574,7 +2544,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2574
2544
|
}
|
|
2575
2545
|
}, [displayFormat, displayValue, format, value]);
|
|
2576
2546
|
useImperativeHandle(ref, () => innerRef.current, [innerRef]);
|
|
2577
|
-
const handleChange =
|
|
2547
|
+
const handleChange = useCallback7(
|
|
2578
2548
|
(event) => {
|
|
2579
2549
|
const value2 = event.target.value;
|
|
2580
2550
|
setDisplayValue(value2 ? formatValueString(parseDate(value2, format), displayFormat) : value2);
|
|
@@ -2582,7 +2552,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2582
2552
|
},
|
|
2583
2553
|
[displayFormat, format, setValue]
|
|
2584
2554
|
);
|
|
2585
|
-
const handleDisplayInputChange =
|
|
2555
|
+
const handleDisplayInputChange = useCallback7(
|
|
2586
2556
|
(event) => {
|
|
2587
2557
|
if (event.target.value === "") {
|
|
2588
2558
|
handleChange({
|
|
@@ -2607,7 +2577,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2607
2577
|
},
|
|
2608
2578
|
[displayFormat, format, handleChange, props.name]
|
|
2609
2579
|
);
|
|
2610
|
-
const handleCalendarToggle =
|
|
2580
|
+
const handleCalendarToggle = useCallback7(
|
|
2611
2581
|
(event) => {
|
|
2612
2582
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
2613
2583
|
setTimeout(() => {
|
|
@@ -2616,7 +2586,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2616
2586
|
},
|
|
2617
2587
|
[anchorEl, setAnchorEl, innerRef]
|
|
2618
2588
|
);
|
|
2619
|
-
const handleInputMouseDown =
|
|
2589
|
+
const handleInputMouseDown = useCallback7(
|
|
2620
2590
|
(event) => {
|
|
2621
2591
|
if (inputReadOnly) {
|
|
2622
2592
|
event.preventDefault();
|
|
@@ -2625,7 +2595,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2625
2595
|
},
|
|
2626
2596
|
[inputReadOnly, buttonRef]
|
|
2627
2597
|
);
|
|
2628
|
-
return /* @__PURE__ */
|
|
2598
|
+
return /* @__PURE__ */ React17.createElement(DatePickerRoot, null, /* @__PURE__ */ React17.createElement(FocusTrap, { open: true }, /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
2629
2599
|
Input_default,
|
|
2630
2600
|
{
|
|
2631
2601
|
...innerProps,
|
|
@@ -2653,7 +2623,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2653
2623
|
},
|
|
2654
2624
|
className,
|
|
2655
2625
|
sx,
|
|
2656
|
-
endDecorator: /* @__PURE__ */
|
|
2626
|
+
endDecorator: /* @__PURE__ */ React17.createElement(
|
|
2657
2627
|
CalendarButton,
|
|
2658
2628
|
{
|
|
2659
2629
|
ref: buttonRef,
|
|
@@ -2665,13 +2635,13 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2665
2635
|
"aria-expanded": open,
|
|
2666
2636
|
disabled
|
|
2667
2637
|
},
|
|
2668
|
-
/* @__PURE__ */
|
|
2638
|
+
/* @__PURE__ */ React17.createElement(CalendarTodayIcon, null)
|
|
2669
2639
|
),
|
|
2670
2640
|
label,
|
|
2671
2641
|
helperText,
|
|
2672
2642
|
readOnly: readOnly || inputReadOnly
|
|
2673
2643
|
}
|
|
2674
|
-
), open && /* @__PURE__ */
|
|
2644
|
+
), open && /* @__PURE__ */ React17.createElement(ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React17.createElement(
|
|
2675
2645
|
StyledPopper,
|
|
2676
2646
|
{
|
|
2677
2647
|
id: "date-picker-popper",
|
|
@@ -2690,7 +2660,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2690
2660
|
"aria-label": "Calendar Tooltip",
|
|
2691
2661
|
"aria-expanded": open
|
|
2692
2662
|
},
|
|
2693
|
-
/* @__PURE__ */
|
|
2663
|
+
/* @__PURE__ */ React17.createElement(CalendarSheet, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React17.createElement(
|
|
2694
2664
|
Calendar_default,
|
|
2695
2665
|
{
|
|
2696
2666
|
value: value && !Number.isNaN(parseDate(value, format).getTime()) ? [parseDate(value, format), void 0] : void 0,
|
|
@@ -2709,14 +2679,14 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2709
2679
|
disablePast,
|
|
2710
2680
|
shouldDisableDate: shouldDisableDate ? (date) => shouldDisableDate(formatValueString(date, format)) : void 0
|
|
2711
2681
|
}
|
|
2712
|
-
), !hideClearButton && /* @__PURE__ */
|
|
2682
|
+
), !hideClearButton && /* @__PURE__ */ React17.createElement(
|
|
2713
2683
|
DialogActions_default,
|
|
2714
2684
|
{
|
|
2715
2685
|
sx: {
|
|
2716
2686
|
p: 1
|
|
2717
2687
|
}
|
|
2718
2688
|
},
|
|
2719
|
-
/* @__PURE__ */
|
|
2689
|
+
/* @__PURE__ */ React17.createElement(
|
|
2720
2690
|
Button_default,
|
|
2721
2691
|
{
|
|
2722
2692
|
size,
|
|
@@ -2742,10 +2712,10 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2742
2712
|
var DatePicker_default = DatePicker;
|
|
2743
2713
|
|
|
2744
2714
|
// src/components/Textarea/Textarea.tsx
|
|
2745
|
-
import
|
|
2715
|
+
import React18 from "react";
|
|
2746
2716
|
import { Textarea as JoyTextarea } from "@mui/joy";
|
|
2747
|
-
import { motion as
|
|
2748
|
-
var MotionTextarea =
|
|
2717
|
+
import { motion as motion18 } from "framer-motion";
|
|
2718
|
+
var MotionTextarea = motion18(JoyTextarea);
|
|
2749
2719
|
var Textarea = (props) => {
|
|
2750
2720
|
const {
|
|
2751
2721
|
label,
|
|
@@ -2762,7 +2732,7 @@ var Textarea = (props) => {
|
|
|
2762
2732
|
className,
|
|
2763
2733
|
...innerProps
|
|
2764
2734
|
} = props;
|
|
2765
|
-
const textarea = /* @__PURE__ */
|
|
2735
|
+
const textarea = /* @__PURE__ */ React18.createElement(
|
|
2766
2736
|
MotionTextarea,
|
|
2767
2737
|
{
|
|
2768
2738
|
required,
|
|
@@ -2774,7 +2744,7 @@ var Textarea = (props) => {
|
|
|
2774
2744
|
...innerProps
|
|
2775
2745
|
}
|
|
2776
2746
|
);
|
|
2777
|
-
return /* @__PURE__ */
|
|
2747
|
+
return /* @__PURE__ */ React18.createElement(
|
|
2778
2748
|
FormControl_default,
|
|
2779
2749
|
{
|
|
2780
2750
|
required,
|
|
@@ -2785,9 +2755,9 @@ var Textarea = (props) => {
|
|
|
2785
2755
|
sx,
|
|
2786
2756
|
className
|
|
2787
2757
|
},
|
|
2788
|
-
label && /* @__PURE__ */
|
|
2758
|
+
label && /* @__PURE__ */ React18.createElement(FormLabel_default, null, label),
|
|
2789
2759
|
textarea,
|
|
2790
|
-
helperText && /* @__PURE__ */
|
|
2760
|
+
helperText && /* @__PURE__ */ React18.createElement(FormHelperText_default, null, helperText)
|
|
2791
2761
|
);
|
|
2792
2762
|
};
|
|
2793
2763
|
Textarea.displayName = "Textarea";
|
|
@@ -2796,10 +2766,10 @@ Textarea.displayName = "Textarea";
|
|
|
2796
2766
|
var Textarea_default = Textarea;
|
|
2797
2767
|
|
|
2798
2768
|
// src/components/Select/Select.tsx
|
|
2799
|
-
import
|
|
2769
|
+
import React19, { useMemo as useMemo7 } from "react";
|
|
2800
2770
|
import { Select as JoySelect, Option as JoyOption, ListItemContent as ListItemContent2, Typography as Typography4 } from "@mui/joy";
|
|
2801
|
-
import { motion as
|
|
2802
|
-
var MotionOption =
|
|
2771
|
+
import { motion as motion19 } from "framer-motion";
|
|
2772
|
+
var MotionOption = motion19(JoyOption);
|
|
2803
2773
|
var Option = MotionOption;
|
|
2804
2774
|
var secondaryTextLevelMap2 = {
|
|
2805
2775
|
sm: "body-xs",
|
|
@@ -2854,7 +2824,7 @@ function Select(props) {
|
|
|
2854
2824
|
});
|
|
2855
2825
|
return map;
|
|
2856
2826
|
}, [options]);
|
|
2857
|
-
const select = /* @__PURE__ */
|
|
2827
|
+
const select = /* @__PURE__ */ React19.createElement(
|
|
2858
2828
|
JoySelect,
|
|
2859
2829
|
{
|
|
2860
2830
|
...innerProps,
|
|
@@ -2871,9 +2841,9 @@ function Select(props) {
|
|
|
2871
2841
|
return optionMap.get(selected.value)?.label;
|
|
2872
2842
|
}
|
|
2873
2843
|
},
|
|
2874
|
-
options.map((option) => /* @__PURE__ */
|
|
2844
|
+
options.map((option) => /* @__PURE__ */ React19.createElement(Option, { key: option.value, value: option.value, disabled: option.disabled }, option.secondaryText ? /* @__PURE__ */ React19.createElement(ListItemContent2, { sx: { gap: 0.5 } }, /* @__PURE__ */ React19.createElement(Typography4, { level: "inherit" }, option.label), /* @__PURE__ */ React19.createElement(Typography4, { level: secondaryTextLevelMap2[size ?? "md"], textColor: "text.tertiary" }, option.secondaryText)) : option.label))
|
|
2875
2845
|
);
|
|
2876
|
-
return /* @__PURE__ */
|
|
2846
|
+
return /* @__PURE__ */ React19.createElement(
|
|
2877
2847
|
FormControl_default,
|
|
2878
2848
|
{
|
|
2879
2849
|
required,
|
|
@@ -2884,9 +2854,9 @@ function Select(props) {
|
|
|
2884
2854
|
sx,
|
|
2885
2855
|
className
|
|
2886
2856
|
},
|
|
2887
|
-
label && /* @__PURE__ */
|
|
2857
|
+
label && /* @__PURE__ */ React19.createElement(FormLabel_default, null, label),
|
|
2888
2858
|
select,
|
|
2889
|
-
helperText && /* @__PURE__ */
|
|
2859
|
+
helperText && /* @__PURE__ */ React19.createElement(FormHelperText_default, null, helperText)
|
|
2890
2860
|
);
|
|
2891
2861
|
}
|
|
2892
2862
|
Select.displayName = "Select";
|
|
@@ -2897,6 +2867,19 @@ var Select_default = Select;
|
|
|
2897
2867
|
// src/components/DataTable/components.tsx
|
|
2898
2868
|
import { Link } from "@mui/joy";
|
|
2899
2869
|
|
|
2870
|
+
// src/components/Tooltip/Tooltip.tsx
|
|
2871
|
+
import React20 from "react";
|
|
2872
|
+
import { Tooltip as JoyTooltip } from "@mui/joy";
|
|
2873
|
+
import { motion as motion20 } from "framer-motion";
|
|
2874
|
+
var MotionTooltip = motion20(JoyTooltip);
|
|
2875
|
+
var Tooltip = (props) => {
|
|
2876
|
+
return /* @__PURE__ */ React20.createElement(MotionTooltip, { ...props });
|
|
2877
|
+
};
|
|
2878
|
+
Tooltip.displayName = "Tooltip";
|
|
2879
|
+
|
|
2880
|
+
// src/components/Tooltip/index.ts
|
|
2881
|
+
var Tooltip_default = Tooltip;
|
|
2882
|
+
|
|
2900
2883
|
// src/components/InfoSign/InfoSign.tsx
|
|
2901
2884
|
import React21 from "react";
|
|
2902
2885
|
import { styled as styled11, tooltipClasses } from "@mui/joy";
|
|
@@ -2936,8 +2919,8 @@ var TextEllipsis = ({
|
|
|
2936
2919
|
lineClamp,
|
|
2937
2920
|
...rest
|
|
2938
2921
|
}) => {
|
|
2939
|
-
const textRef =
|
|
2940
|
-
const [showTooltip, setShowTooltip] =
|
|
2922
|
+
const textRef = useRef4(null);
|
|
2923
|
+
const [showTooltip, setShowTooltip] = useState7(false);
|
|
2941
2924
|
useLayoutEffect(() => {
|
|
2942
2925
|
const element = textRef.current;
|
|
2943
2926
|
if (!element) return;
|
|
@@ -2953,8 +2936,8 @@ var TextEllipsis = ({
|
|
|
2953
2936
|
return /* @__PURE__ */ React22.createElement(Tooltip_default, { title: showTooltip ? children : "", placement: "top" }, /* @__PURE__ */ React22.createElement(EllipsisDiv, { ref: textRef, lineClamp, ...rest }, children));
|
|
2954
2937
|
};
|
|
2955
2938
|
var CellTextEllipsis = ({ children }) => {
|
|
2956
|
-
const textRef =
|
|
2957
|
-
const [showTooltip, setShowTooltip] =
|
|
2939
|
+
const textRef = useRef4(null);
|
|
2940
|
+
const [showTooltip, setShowTooltip] = useState7(false);
|
|
2958
2941
|
useLayoutEffect(() => {
|
|
2959
2942
|
const element = textRef.current;
|
|
2960
2943
|
if (element) {
|
|
@@ -3008,17 +2991,17 @@ var HeadCell = (props) => {
|
|
|
3008
2991
|
const theme = useTheme();
|
|
3009
2992
|
const ref = headerRef;
|
|
3010
2993
|
const colRef = tableColRef;
|
|
3011
|
-
const localRef =
|
|
2994
|
+
const localRef = useRef4(null);
|
|
3012
2995
|
useLayoutEffect(() => {
|
|
3013
2996
|
ref.current = localRef.current;
|
|
3014
2997
|
}, [ref]);
|
|
3015
|
-
const [isHovered, setIsHovered] =
|
|
2998
|
+
const [isHovered, setIsHovered] = useState7(false);
|
|
3016
2999
|
const sortable = type === "actions" ? false : _sortable;
|
|
3017
3000
|
const headId = useMemo8(
|
|
3018
3001
|
() => `${tableId}_header_${headerName ?? field}`.trim(),
|
|
3019
3002
|
[tableId, headerName, field]
|
|
3020
3003
|
);
|
|
3021
|
-
const isResizingRef =
|
|
3004
|
+
const isResizingRef = useRef4(false);
|
|
3022
3005
|
const resizer = useMemo8(
|
|
3023
3006
|
() => resizable ?? true ? Resizer(
|
|
3024
3007
|
ref,
|
|
@@ -3102,7 +3085,7 @@ var HeadCell = (props) => {
|
|
|
3102
3085
|
ref: localRef,
|
|
3103
3086
|
key: field,
|
|
3104
3087
|
style,
|
|
3105
|
-
onClick:
|
|
3088
|
+
onClick: useCallback8(
|
|
3106
3089
|
(e) => {
|
|
3107
3090
|
if (isResizingRef.current) return;
|
|
3108
3091
|
if (!(e.target instanceof Element) || !e.currentTarget.contains(e.target)) return;
|
|
@@ -3141,8 +3124,8 @@ var BodyCell = (props) => {
|
|
|
3141
3124
|
onCellEditStop
|
|
3142
3125
|
} = props;
|
|
3143
3126
|
const theme = useTheme();
|
|
3144
|
-
const [value, setValue] =
|
|
3145
|
-
const cellRef =
|
|
3127
|
+
const [value, setValue] = useState7(row[field]);
|
|
3128
|
+
const cellRef = useRef4(null);
|
|
3146
3129
|
const params = useMemo8(
|
|
3147
3130
|
() => ({
|
|
3148
3131
|
row,
|
|
@@ -3287,7 +3270,7 @@ var BodyCell = (props) => {
|
|
|
3287
3270
|
() => (typeof cellClassName === "function" ? cellClassName(params) : cellClassName) || "",
|
|
3288
3271
|
[cellClassName, params]
|
|
3289
3272
|
);
|
|
3290
|
-
|
|
3273
|
+
useEffect4(() => {
|
|
3291
3274
|
setValue(row[field]);
|
|
3292
3275
|
}, [row, field]);
|
|
3293
3276
|
return /* @__PURE__ */ React22.createElement(
|
|
@@ -3357,10 +3340,10 @@ var VirtualizedTableRow = memo(StyledTableRow2, (prevProps, nextProps) => {
|
|
|
3357
3340
|
});
|
|
3358
3341
|
|
|
3359
3342
|
// src/components/DataTable/hooks.ts
|
|
3360
|
-
import { useState as
|
|
3343
|
+
import { useState as useState8, useLayoutEffect as useLayoutEffect2, useRef as useRef5, useMemo as useMemo9, useCallback as useCallback9, useEffect as useEffect5, createRef } from "react";
|
|
3361
3344
|
function useColumnWidths(columnsByField) {
|
|
3362
|
-
const [widths, setWidths] =
|
|
3363
|
-
const roRef =
|
|
3345
|
+
const [widths, setWidths] = useState8({});
|
|
3346
|
+
const roRef = useRef5();
|
|
3364
3347
|
useLayoutEffect2(() => {
|
|
3365
3348
|
if (roRef.current) roRef.current.disconnect();
|
|
3366
3349
|
roRef.current = new ResizeObserver((entries) => {
|
|
@@ -3410,26 +3393,27 @@ function useDataTableRenderer({
|
|
|
3410
3393
|
isRowSelectable,
|
|
3411
3394
|
columnGroupingModel,
|
|
3412
3395
|
columnVisibilityModel,
|
|
3413
|
-
onColumnVisibilityModelChange
|
|
3396
|
+
onColumnVisibilityModelChange,
|
|
3397
|
+
checkboxSelection
|
|
3414
3398
|
}) {
|
|
3415
3399
|
if (pinnedColumns && columnGroupingModel) {
|
|
3416
3400
|
throw new Error(
|
|
3417
3401
|
"You cannot use both `pinnedColumns` and `columnGroupingModel` at the same time. Please choose one of them."
|
|
3418
3402
|
);
|
|
3419
3403
|
}
|
|
3420
|
-
const onSelectionModelChangeRef =
|
|
3404
|
+
const onSelectionModelChangeRef = useRef5(onSelectionModelChange);
|
|
3421
3405
|
onSelectionModelChangeRef.current = onSelectionModelChange;
|
|
3422
|
-
const [focusedRowId, setFocusedRowId] =
|
|
3423
|
-
const [selectionAnchor, setSelectionAnchor] =
|
|
3406
|
+
const [focusedRowId, setFocusedRowId] = useState8(null);
|
|
3407
|
+
const [selectionAnchor, setSelectionAnchor] = useState8(null);
|
|
3424
3408
|
const [sortModel, setSortModel] = useControlledState(
|
|
3425
3409
|
controlledSortModel,
|
|
3426
3410
|
initialState?.sorting?.sortModel ?? [],
|
|
3427
|
-
|
|
3411
|
+
useCallback9((sortModel2) => onSortModelChange?.(sortModel2), [onSortModelChange])
|
|
3428
3412
|
);
|
|
3429
3413
|
const [visibilityModel] = useControlledState(
|
|
3430
3414
|
columnVisibilityModel,
|
|
3431
3415
|
initialState?.columns?.columnVisibilityModel ?? {},
|
|
3432
|
-
|
|
3416
|
+
useCallback9(
|
|
3433
3417
|
(model) => onColumnVisibilityModelChange?.(model),
|
|
3434
3418
|
[onColumnVisibilityModelChange]
|
|
3435
3419
|
)
|
|
@@ -3443,6 +3427,14 @@ function useDataTableRenderer({
|
|
|
3443
3427
|
[reorderedColumns, visibilityModel]
|
|
3444
3428
|
);
|
|
3445
3429
|
const visibleFieldSet = useMemo9(() => new Set(visibleColumns.map((c) => c.field)), [visibleColumns]);
|
|
3430
|
+
const tableMinWidth = useMemo9(() => {
|
|
3431
|
+
const DEFAULT_MIN = 50;
|
|
3432
|
+
let total = checkboxSelection ? 40 : 0;
|
|
3433
|
+
for (const col of visibleColumns) {
|
|
3434
|
+
total += parsePxValue(col.minWidth) ?? parsePxValue(col.width) ?? DEFAULT_MIN;
|
|
3435
|
+
}
|
|
3436
|
+
return total;
|
|
3437
|
+
}, [visibleColumns, checkboxSelection]);
|
|
3446
3438
|
const allColumnsByField = useMemo9(
|
|
3447
3439
|
() => reorderedColumns.reduce(
|
|
3448
3440
|
(acc, curr) => ({
|
|
@@ -3467,7 +3459,7 @@ function useDataTableRenderer({
|
|
|
3467
3459
|
),
|
|
3468
3460
|
[visibleColumns]
|
|
3469
3461
|
);
|
|
3470
|
-
const sortComparator =
|
|
3462
|
+
const sortComparator = useCallback9(
|
|
3471
3463
|
(rowA, rowB) => {
|
|
3472
3464
|
for (const sort of sortModel) {
|
|
3473
3465
|
const { field, sort: direction } = sort;
|
|
@@ -3504,9 +3496,9 @@ function useDataTableRenderer({
|
|
|
3504
3496
|
() => Array.from(new Set(_sortOrder || ["asc", "desc", null])),
|
|
3505
3497
|
[_sortOrder]
|
|
3506
3498
|
);
|
|
3507
|
-
const [page, setPage] =
|
|
3499
|
+
const [page, setPage] = useState8(paginationModel?.page || 1);
|
|
3508
3500
|
const pageSize = paginationModel?.pageSize || 20;
|
|
3509
|
-
const getId =
|
|
3501
|
+
const getId = useCallback9(
|
|
3510
3502
|
(row, index) => _getId?.(row) ?? row.id ?? `${(index || 0) + (page - 1) * pageSize}`,
|
|
3511
3503
|
[_getId, page, pageSize]
|
|
3512
3504
|
);
|
|
@@ -3522,7 +3514,7 @@ function useDataTableRenderer({
|
|
|
3522
3514
|
}),
|
|
3523
3515
|
[dataInPage, isRowSelectable, getId]
|
|
3524
3516
|
);
|
|
3525
|
-
const handleRangeSelection =
|
|
3517
|
+
const handleRangeSelection = useCallback9(
|
|
3526
3518
|
(anchor, targetIndex) => {
|
|
3527
3519
|
const startIndex = Math.min(anchor.rowIndex, targetIndex);
|
|
3528
3520
|
const endIndex = Math.max(anchor.rowIndex, targetIndex);
|
|
@@ -3559,7 +3551,7 @@ function useDataTableRenderer({
|
|
|
3559
3551
|
[_isTotalSelected, selectionModel, selectableRowCount]
|
|
3560
3552
|
);
|
|
3561
3553
|
const columnWidths = useColumnWidths(visibleColumnsByField);
|
|
3562
|
-
const getWidth =
|
|
3554
|
+
const getWidth = useCallback9(
|
|
3563
3555
|
(f) => columnWidths[f] ?? allColumnsByField[f]?.width ?? // Column prop 으로 지정된 width
|
|
3564
3556
|
allColumnsByField[f]?.minWidth ?? 0,
|
|
3565
3557
|
[columnWidths, allColumnsByField]
|
|
@@ -3611,14 +3603,14 @@ function useDataTableRenderer({
|
|
|
3611
3603
|
sortOrder,
|
|
3612
3604
|
getWidth
|
|
3613
3605
|
]);
|
|
3614
|
-
const handlePageChange =
|
|
3606
|
+
const handlePageChange = useCallback9(
|
|
3615
3607
|
(newPage) => {
|
|
3616
3608
|
setPage(newPage);
|
|
3617
3609
|
onPaginationModelChange?.({ page: newPage, pageSize });
|
|
3618
3610
|
},
|
|
3619
3611
|
[onPaginationModelChange, pageSize]
|
|
3620
3612
|
);
|
|
3621
|
-
const handleSortChange =
|
|
3613
|
+
const handleSortChange = useCallback9(
|
|
3622
3614
|
(props) => {
|
|
3623
3615
|
const { field, currentSort, multiple } = props;
|
|
3624
3616
|
const column = allColumnsByField[field];
|
|
@@ -3641,29 +3633,29 @@ function useDataTableRenderer({
|
|
|
3641
3633
|
},
|
|
3642
3634
|
[sortOrder, allColumnsByField, sortModel, setSortModel]
|
|
3643
3635
|
);
|
|
3644
|
-
|
|
3636
|
+
useEffect5(() => {
|
|
3645
3637
|
if (!paginationModel) {
|
|
3646
3638
|
handlePageChange(1);
|
|
3647
3639
|
}
|
|
3648
3640
|
}, [rowCount, handlePageChange, paginationModel]);
|
|
3649
|
-
|
|
3641
|
+
useEffect5(() => {
|
|
3650
3642
|
const lastPage = Math.max(1, Math.ceil(rowCount / pageSize));
|
|
3651
3643
|
if (page > lastPage) {
|
|
3652
3644
|
handlePageChange(lastPage);
|
|
3653
3645
|
}
|
|
3654
3646
|
}, [page, rowCount, pageSize, handlePageChange]);
|
|
3655
|
-
|
|
3647
|
+
useEffect5(() => {
|
|
3656
3648
|
onSelectionModelChangeRef.current?.([]);
|
|
3657
3649
|
setSelectionAnchor(null);
|
|
3658
3650
|
}, [page]);
|
|
3659
|
-
const prevRowsRef =
|
|
3660
|
-
|
|
3651
|
+
const prevRowsRef = useRef5(_rows);
|
|
3652
|
+
useEffect5(() => {
|
|
3661
3653
|
if (prevRowsRef.current !== _rows) {
|
|
3662
3654
|
setSelectionAnchor(null);
|
|
3663
3655
|
prevRowsRef.current = _rows;
|
|
3664
3656
|
}
|
|
3665
3657
|
}, [_rows]);
|
|
3666
|
-
const handleAutoFit =
|
|
3658
|
+
const handleAutoFit = useCallback9(
|
|
3667
3659
|
(field) => {
|
|
3668
3660
|
const colDef = visibleColumnsByField[field];
|
|
3669
3661
|
if (!colDef?.headerRef.current) return;
|
|
@@ -3696,8 +3688,8 @@ function useDataTableRenderer({
|
|
|
3696
3688
|
handleAutoFit,
|
|
3697
3689
|
isAllSelected,
|
|
3698
3690
|
isTotalSelected,
|
|
3699
|
-
isSelectedRow:
|
|
3700
|
-
isRowSelectable:
|
|
3691
|
+
isSelectedRow: useCallback9((model) => selectedModelSet.has(model), [selectedModelSet]),
|
|
3692
|
+
isRowSelectable: useCallback9(
|
|
3701
3693
|
(rowId, row) => {
|
|
3702
3694
|
if (!isRowSelectable) return true;
|
|
3703
3695
|
return isRowSelectable({ row, id: rowId });
|
|
@@ -3705,13 +3697,13 @@ function useDataTableRenderer({
|
|
|
3705
3697
|
[isRowSelectable]
|
|
3706
3698
|
),
|
|
3707
3699
|
focusedRowId,
|
|
3708
|
-
onRowFocus:
|
|
3700
|
+
onRowFocus: useCallback9((rowId) => {
|
|
3709
3701
|
setFocusedRowId(rowId);
|
|
3710
3702
|
}, []),
|
|
3711
|
-
onAllCheckboxChange:
|
|
3703
|
+
onAllCheckboxChange: useCallback9(() => {
|
|
3712
3704
|
onSelectionModelChange?.(isAllSelected ? [] : selectableDataInPage.map(getId));
|
|
3713
3705
|
}, [isAllSelected, selectableDataInPage, onSelectionModelChange, getId]),
|
|
3714
|
-
onCheckboxChange:
|
|
3706
|
+
onCheckboxChange: useCallback9(
|
|
3715
3707
|
(event, selectedModel) => {
|
|
3716
3708
|
const isShiftClick = "shiftKey" in event && event.shiftKey;
|
|
3717
3709
|
const rowIndex = dataInPage.findIndex((row, i) => getId(row, i) === selectedModel);
|
|
@@ -3743,8 +3735,9 @@ function useDataTableRenderer({
|
|
|
3743
3735
|
]
|
|
3744
3736
|
),
|
|
3745
3737
|
columns,
|
|
3738
|
+
tableMinWidth,
|
|
3746
3739
|
processedColumnGroups,
|
|
3747
|
-
onTotalSelect:
|
|
3740
|
+
onTotalSelect: useCallback9(() => {
|
|
3748
3741
|
const selectableRows = rows.filter((row, i) => {
|
|
3749
3742
|
if (!isRowSelectable) return true;
|
|
3750
3743
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
@@ -3829,7 +3822,7 @@ function TableBody(props) {
|
|
|
3829
3822
|
TableBody.displayName = "TableBody";
|
|
3830
3823
|
|
|
3831
3824
|
// src/components/Pagination/Pagination.tsx
|
|
3832
|
-
import React24, { useCallback as
|
|
3825
|
+
import React24, { useCallback as useCallback10, useEffect as useEffect6 } from "react";
|
|
3833
3826
|
import PreviousIcon from "@mui/icons-material/ChevronLeftRounded";
|
|
3834
3827
|
import NextIcon from "@mui/icons-material/ChevronRightRounded";
|
|
3835
3828
|
import FirstPageIcon from "@mui/icons-material/FirstPageRounded";
|
|
@@ -3898,7 +3891,7 @@ function Pagination(props) {
|
|
|
3898
3891
|
const [paginationModel, setPaginationModel] = useControlledState(
|
|
3899
3892
|
_paginationModel,
|
|
3900
3893
|
defaultPaginationModel,
|
|
3901
|
-
|
|
3894
|
+
useCallback10(
|
|
3902
3895
|
(newPage) => {
|
|
3903
3896
|
onPageChange(newPage.page);
|
|
3904
3897
|
},
|
|
@@ -3914,7 +3907,7 @@ function Pagination(props) {
|
|
|
3914
3907
|
const afterPages = [paginationModel.page + 1, paginationModel.page + 2].filter((p) => p <= lastPage - 1);
|
|
3915
3908
|
const isMoreAfterPages = lastPage > 1 && paginationModel.page < lastPage - 3;
|
|
3916
3909
|
const isMoreBeforePages = lastPage > 1 && paginationModel.page > 4;
|
|
3917
|
-
|
|
3910
|
+
useEffect6(() => {
|
|
3918
3911
|
if (paginationModel.page > lastPage) {
|
|
3919
3912
|
setPaginationModel({ ...paginationModel, page: lastPage });
|
|
3920
3913
|
}
|
|
@@ -4107,8 +4100,8 @@ function Component(props, apiRef) {
|
|
|
4107
4100
|
...innerProps
|
|
4108
4101
|
} = props;
|
|
4109
4102
|
const tableId = useId();
|
|
4110
|
-
const parentRef =
|
|
4111
|
-
const tableBodyRef =
|
|
4103
|
+
const parentRef = useRef6(null);
|
|
4104
|
+
const tableBodyRef = useRef6(null);
|
|
4112
4105
|
const {
|
|
4113
4106
|
columns,
|
|
4114
4107
|
processedColumnGroups,
|
|
@@ -4132,6 +4125,7 @@ function Component(props, apiRef) {
|
|
|
4132
4125
|
onTotalSelect,
|
|
4133
4126
|
HeadCell: HeadCell2,
|
|
4134
4127
|
BodyRow: BodyRow2,
|
|
4128
|
+
tableMinWidth,
|
|
4135
4129
|
// For keyboard selection
|
|
4136
4130
|
selectionAnchor,
|
|
4137
4131
|
setSelectionAnchor
|
|
@@ -4148,20 +4142,20 @@ function Component(props, apiRef) {
|
|
|
4148
4142
|
const virtualizedItems = virtualizer.getVirtualItems();
|
|
4149
4143
|
const showNoRowsOverlay = !loading && rowCount === 0;
|
|
4150
4144
|
const totalColCount = Math.max(1, columns.length + (checkboxSelection ? 1 : 0));
|
|
4151
|
-
const getRowClickHandler =
|
|
4145
|
+
const getRowClickHandler = useCallback11(
|
|
4152
4146
|
(row, rowId) => (e) => {
|
|
4153
4147
|
onRowClick?.({ row, rowId }, e);
|
|
4154
4148
|
checkboxSelection && !disableSelectionOnClick && isRowSelectableCheck(rowId, row) && onCheckboxChange(e, rowId);
|
|
4155
4149
|
},
|
|
4156
4150
|
[onRowClick, checkboxSelection, disableSelectionOnClick, onCheckboxChange, isRowSelectableCheck]
|
|
4157
4151
|
);
|
|
4158
|
-
const getRowFocusHandler =
|
|
4152
|
+
const getRowFocusHandler = useCallback11(
|
|
4159
4153
|
(rowId) => () => {
|
|
4160
4154
|
onRowFocus(rowId);
|
|
4161
4155
|
},
|
|
4162
4156
|
[onRowFocus]
|
|
4163
4157
|
);
|
|
4164
|
-
const getCheckboxClickHandler =
|
|
4158
|
+
const getCheckboxClickHandler = useCallback11(
|
|
4165
4159
|
(rowId, row) => (e) => {
|
|
4166
4160
|
e.stopPropagation();
|
|
4167
4161
|
if (isRowSelectableCheck(rowId, row)) {
|
|
@@ -4171,7 +4165,7 @@ function Component(props, apiRef) {
|
|
|
4171
4165
|
},
|
|
4172
4166
|
[onCheckboxChange, isRowSelectableCheck, onRowFocus]
|
|
4173
4167
|
);
|
|
4174
|
-
const handleTableKeyDown =
|
|
4168
|
+
const handleTableKeyDown = useCallback11(
|
|
4175
4169
|
(e) => {
|
|
4176
4170
|
const supportedKeys = ["ArrowUp", "ArrowDown", " ", "Home", "End", "PageUp", "PageDown"];
|
|
4177
4171
|
if (!supportedKeys.includes(e.key)) return;
|
|
@@ -4321,7 +4315,7 @@ function Component(props, apiRef) {
|
|
|
4321
4315
|
ref: parentRef,
|
|
4322
4316
|
...backgroundProps
|
|
4323
4317
|
},
|
|
4324
|
-
/* @__PURE__ */ React25.createElement(Table, { ...innerProps }, /* @__PURE__ */ React25.createElement("colgroup", null, checkboxSelection && /* @__PURE__ */ React25.createElement(
|
|
4318
|
+
/* @__PURE__ */ React25.createElement(Table, { ...innerProps, sx: { ...innerProps.sx, minWidth: tableMinWidth } }, /* @__PURE__ */ React25.createElement("colgroup", null, checkboxSelection && /* @__PURE__ */ React25.createElement(
|
|
4325
4319
|
"col",
|
|
4326
4320
|
{
|
|
4327
4321
|
style: {
|
|
@@ -4334,7 +4328,8 @@ function Component(props, apiRef) {
|
|
|
4334
4328
|
ref: c.tableColRef,
|
|
4335
4329
|
key: `${c.field.toString()}_${c.width}`,
|
|
4336
4330
|
style: {
|
|
4337
|
-
width: c.width
|
|
4331
|
+
width: c.width,
|
|
4332
|
+
minWidth: c.minWidth ?? "50px"
|
|
4338
4333
|
}
|
|
4339
4334
|
}
|
|
4340
4335
|
))), /* @__PURE__ */ React25.createElement("thead", null, processedColumnGroups && processedColumnGroups.groups.length > 0 && processedColumnGroups.groups.map((levelGroups, level) => /* @__PURE__ */ React25.createElement("tr", { key: `group-level-${level}` }, checkboxSelection && level === 0 && /* @__PURE__ */ React25.createElement(
|
|
@@ -4526,7 +4521,7 @@ var DataTable = forwardRef7(Component);
|
|
|
4526
4521
|
DataTable.displayName = "DataTable";
|
|
4527
4522
|
|
|
4528
4523
|
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
4529
|
-
import React26, { forwardRef as forwardRef8, useCallback as
|
|
4524
|
+
import React26, { forwardRef as forwardRef8, useCallback as useCallback12, useEffect as useEffect7, useImperativeHandle as useImperativeHandle3, useMemo as useMemo11, useRef as useRef7, useState as useState9 } from "react";
|
|
4530
4525
|
import { IMaskInput as IMaskInput2, IMask as IMask2 } from "react-imask";
|
|
4531
4526
|
import CalendarTodayIcon2 from "@mui/icons-material/CalendarToday";
|
|
4532
4527
|
import { styled as styled14, useThemeProps as useThemeProps5 } from "@mui/joy";
|
|
@@ -4687,23 +4682,23 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4687
4682
|
readOnly,
|
|
4688
4683
|
...innerProps
|
|
4689
4684
|
} = props;
|
|
4690
|
-
const innerRef =
|
|
4691
|
-
const buttonRef =
|
|
4685
|
+
const innerRef = useRef7(null);
|
|
4686
|
+
const buttonRef = useRef7(null);
|
|
4692
4687
|
const [value, setValue] = useControlledState(
|
|
4693
4688
|
props.value,
|
|
4694
4689
|
props.defaultValue || "",
|
|
4695
|
-
|
|
4690
|
+
useCallback12((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
4696
4691
|
);
|
|
4697
|
-
const [displayValue, setDisplayValue] =
|
|
4692
|
+
const [displayValue, setDisplayValue] = useState9(
|
|
4698
4693
|
() => value ? formatValueString2(parseDates(value, format), displayFormat) : ""
|
|
4699
4694
|
);
|
|
4700
|
-
const [anchorEl, setAnchorEl] =
|
|
4695
|
+
const [anchorEl, setAnchorEl] = useState9(null);
|
|
4701
4696
|
const open = Boolean(anchorEl);
|
|
4702
4697
|
const calendarValue = useMemo11(
|
|
4703
4698
|
() => value ? parseDates(value, format) : void 0,
|
|
4704
4699
|
[value, format]
|
|
4705
4700
|
);
|
|
4706
|
-
|
|
4701
|
+
useEffect7(() => {
|
|
4707
4702
|
if (value) {
|
|
4708
4703
|
try {
|
|
4709
4704
|
const dates = parseDates(value, format);
|
|
@@ -4715,13 +4710,13 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4715
4710
|
setDisplayValue("");
|
|
4716
4711
|
}
|
|
4717
4712
|
}, [displayFormat, value, format]);
|
|
4718
|
-
|
|
4713
|
+
useEffect7(() => {
|
|
4719
4714
|
if (!anchorEl) {
|
|
4720
4715
|
innerRef.current?.blur();
|
|
4721
4716
|
}
|
|
4722
4717
|
}, [anchorEl, innerRef]);
|
|
4723
4718
|
useImperativeHandle3(ref, () => innerRef.current, [innerRef]);
|
|
4724
|
-
const handleChange =
|
|
4719
|
+
const handleChange = useCallback12(
|
|
4725
4720
|
(event) => {
|
|
4726
4721
|
const value2 = event.target.value;
|
|
4727
4722
|
setDisplayValue(value2 ? formatValueString2(parseDates(value2, format), displayFormat) : value2);
|
|
@@ -4729,7 +4724,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4729
4724
|
},
|
|
4730
4725
|
[displayFormat, format, setValue]
|
|
4731
4726
|
);
|
|
4732
|
-
const handleDisplayInputChange =
|
|
4727
|
+
const handleDisplayInputChange = useCallback12(
|
|
4733
4728
|
(event) => {
|
|
4734
4729
|
if (event.target.value === "") {
|
|
4735
4730
|
handleChange({
|
|
@@ -4754,14 +4749,14 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4754
4749
|
},
|
|
4755
4750
|
[displayFormat, format, handleChange, props.name]
|
|
4756
4751
|
);
|
|
4757
|
-
const handleCalendarToggle =
|
|
4752
|
+
const handleCalendarToggle = useCallback12(
|
|
4758
4753
|
(event) => {
|
|
4759
4754
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4760
4755
|
innerRef.current?.focus();
|
|
4761
4756
|
},
|
|
4762
4757
|
[anchorEl, setAnchorEl, innerRef]
|
|
4763
4758
|
);
|
|
4764
|
-
const handleCalendarChange =
|
|
4759
|
+
const handleCalendarChange = useCallback12(
|
|
4765
4760
|
([date1, date2]) => {
|
|
4766
4761
|
if (!date1 || !date2) return;
|
|
4767
4762
|
const formattedValue = formatValueString2([date1, date2], format);
|
|
@@ -4775,7 +4770,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4775
4770
|
},
|
|
4776
4771
|
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat]
|
|
4777
4772
|
);
|
|
4778
|
-
const handleInputMouseDown =
|
|
4773
|
+
const handleInputMouseDown = useCallback12(
|
|
4779
4774
|
(event) => {
|
|
4780
4775
|
if (inputReadOnly) {
|
|
4781
4776
|
event.preventDefault();
|
|
@@ -4984,13 +4979,13 @@ var InsetDrawer = styled19(JoyDrawer)(({ theme }) => ({
|
|
|
4984
4979
|
}));
|
|
4985
4980
|
|
|
4986
4981
|
// src/components/FilterableCheckboxGroup/FilterableCheckboxGroup.tsx
|
|
4987
|
-
import React30, { useCallback as
|
|
4982
|
+
import React30, { useCallback as useCallback13, useEffect as useEffect8, useMemo as useMemo12, useRef as useRef8, useState as useState10 } from "react";
|
|
4988
4983
|
import SearchIcon from "@mui/icons-material/Search";
|
|
4989
4984
|
import { useVirtualizer as useVirtualizer3 } from "@tanstack/react-virtual";
|
|
4990
4985
|
function LabelWithTooltip(props) {
|
|
4991
4986
|
const { label, size } = props;
|
|
4992
|
-
const labelContentRef =
|
|
4993
|
-
const [isOverflowing, setIsOverflowing] =
|
|
4987
|
+
const labelContentRef = useRef8(null);
|
|
4988
|
+
const [isOverflowing, setIsOverflowing] = useState10(false);
|
|
4994
4989
|
const labelContent = /* @__PURE__ */ React30.createElement(
|
|
4995
4990
|
"span",
|
|
4996
4991
|
{
|
|
@@ -5007,7 +5002,7 @@ function LabelWithTooltip(props) {
|
|
|
5007
5002
|
},
|
|
5008
5003
|
label
|
|
5009
5004
|
);
|
|
5010
|
-
|
|
5005
|
+
useEffect8(() => {
|
|
5011
5006
|
const element = labelContentRef.current;
|
|
5012
5007
|
if (element) {
|
|
5013
5008
|
setIsOverflowing(element.scrollWidth > element.clientWidth);
|
|
@@ -5031,16 +5026,16 @@ function FilterableCheckboxGroup(props) {
|
|
|
5031
5026
|
maxHeight = 300,
|
|
5032
5027
|
disabled
|
|
5033
5028
|
} = props;
|
|
5034
|
-
const [searchTerm, setSearchTerm] =
|
|
5035
|
-
const [sortedOptions, setSortedOptions] =
|
|
5029
|
+
const [searchTerm, setSearchTerm] = useState10("");
|
|
5030
|
+
const [sortedOptions, setSortedOptions] = useState10(options);
|
|
5036
5031
|
const [internalValue, setInternalValue] = useControlledState(
|
|
5037
5032
|
value,
|
|
5038
5033
|
value ?? [],
|
|
5039
|
-
|
|
5034
|
+
useCallback13((newValue) => onChange?.(newValue), [onChange])
|
|
5040
5035
|
);
|
|
5041
|
-
const parentRef =
|
|
5042
|
-
const isInitialSortRef =
|
|
5043
|
-
const prevOptionsRef =
|
|
5036
|
+
const parentRef = useRef8(null);
|
|
5037
|
+
const isInitialSortRef = useRef8(false);
|
|
5038
|
+
const prevOptionsRef = useRef8([...options]);
|
|
5044
5039
|
const filteredOptions = useMemo12(() => {
|
|
5045
5040
|
if (!searchTerm) return sortedOptions;
|
|
5046
5041
|
return sortedOptions.filter((option) => option.label.toLowerCase().includes(searchTerm.toLowerCase()));
|
|
@@ -5063,7 +5058,7 @@ function FilterableCheckboxGroup(props) {
|
|
|
5063
5058
|
overscan: 5
|
|
5064
5059
|
});
|
|
5065
5060
|
const items = virtualizer.getVirtualItems();
|
|
5066
|
-
|
|
5061
|
+
useEffect8(() => {
|
|
5067
5062
|
const optionsChanged = prevOptionsRef.current.length !== options.length || prevOptionsRef.current.some(
|
|
5068
5063
|
(prevOption, index) => prevOption.value !== options[index]?.value || prevOption.label !== options[index]?.label || prevOption.disabled !== options[index]?.disabled
|
|
5069
5064
|
);
|
|
@@ -5089,13 +5084,13 @@ function FilterableCheckboxGroup(props) {
|
|
|
5089
5084
|
}
|
|
5090
5085
|
}
|
|
5091
5086
|
}, [options, value]);
|
|
5092
|
-
|
|
5087
|
+
useEffect8(() => {
|
|
5093
5088
|
virtualizer.measure();
|
|
5094
5089
|
}, [virtualizer, filteredOptions, size]);
|
|
5095
|
-
const handleSearchChange =
|
|
5090
|
+
const handleSearchChange = useCallback13((event) => {
|
|
5096
5091
|
setSearchTerm(event.target.value);
|
|
5097
5092
|
}, []);
|
|
5098
|
-
const handleCheckboxChange =
|
|
5093
|
+
const handleCheckboxChange = useCallback13(
|
|
5099
5094
|
(optionValue) => (event) => {
|
|
5100
5095
|
const checked = event.target.checked;
|
|
5101
5096
|
const newValue = checked ? [...internalValue, optionValue] : internalValue.filter((v) => v !== optionValue);
|
|
@@ -5103,7 +5098,7 @@ function FilterableCheckboxGroup(props) {
|
|
|
5103
5098
|
},
|
|
5104
5099
|
[internalValue, setInternalValue]
|
|
5105
5100
|
);
|
|
5106
|
-
const handleSelectAll =
|
|
5101
|
+
const handleSelectAll = useCallback13(
|
|
5107
5102
|
(event) => {
|
|
5108
5103
|
const checked = event.target.checked;
|
|
5109
5104
|
const enabledOptions = filteredOptions.filter((option) => !option.disabled);
|
|
@@ -5207,16 +5202,16 @@ function FilterableCheckboxGroup(props) {
|
|
|
5207
5202
|
FilterableCheckboxGroup.displayName = "FilterableCheckboxGroup";
|
|
5208
5203
|
|
|
5209
5204
|
// src/components/FilterMenu/FilterMenu.tsx
|
|
5210
|
-
import React41, { useCallback as
|
|
5205
|
+
import React41, { useCallback as useCallback23 } from "react";
|
|
5211
5206
|
import { Button as Button2, Stack as Stack11 } from "@mui/joy";
|
|
5212
5207
|
|
|
5213
5208
|
// src/components/FilterMenu/components/CheckboxGroup.tsx
|
|
5214
|
-
import React31, { useCallback as
|
|
5209
|
+
import React31, { useCallback as useCallback14 } from "react";
|
|
5215
5210
|
import { Stack as Stack2 } from "@mui/joy";
|
|
5216
5211
|
function CheckboxGroup(props) {
|
|
5217
5212
|
const { id, label, options, value, onChange, hidden } = props;
|
|
5218
5213
|
const [internalValue, setInternalValue] = useControlledState(value, [], onChange);
|
|
5219
|
-
const handleCheckboxChange =
|
|
5214
|
+
const handleCheckboxChange = useCallback14(
|
|
5220
5215
|
(optionValue) => (event) => {
|
|
5221
5216
|
const checked = event.target.checked;
|
|
5222
5217
|
let newValue;
|
|
@@ -5245,12 +5240,12 @@ function CheckboxGroup(props) {
|
|
|
5245
5240
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
5246
5241
|
|
|
5247
5242
|
// src/components/FilterMenu/components/FilterableCheckboxGroup.tsx
|
|
5248
|
-
import React32, { useCallback as
|
|
5243
|
+
import React32, { useCallback as useCallback15 } from "react";
|
|
5249
5244
|
import { Stack as Stack3 } from "@mui/joy";
|
|
5250
5245
|
function FilterableCheckboxGroup2(props) {
|
|
5251
5246
|
const { id, label, options, value, onChange, hidden, placeholder, maxHeight } = props;
|
|
5252
5247
|
const [internalValue, setInternalValue] = useControlledState(value, [], onChange);
|
|
5253
|
-
const handleChange =
|
|
5248
|
+
const handleChange = useCallback15(
|
|
5254
5249
|
(newValue) => {
|
|
5255
5250
|
setInternalValue(newValue);
|
|
5256
5251
|
},
|
|
@@ -5274,7 +5269,7 @@ function FilterableCheckboxGroup2(props) {
|
|
|
5274
5269
|
FilterableCheckboxGroup2.displayName = "FilterableCheckboxGroup";
|
|
5275
5270
|
|
|
5276
5271
|
// src/components/FilterMenu/components/RadioGroup.tsx
|
|
5277
|
-
import React33, { useCallback as
|
|
5272
|
+
import React33, { useCallback as useCallback16 } from "react";
|
|
5278
5273
|
|
|
5279
5274
|
// src/components/Radio/Radio.tsx
|
|
5280
5275
|
import { Radio as JoyRadio, RadioGroup as JoyRadioGroup } from "@mui/joy";
|
|
@@ -5291,7 +5286,7 @@ import { Stack as Stack4 } from "@mui/joy";
|
|
|
5291
5286
|
function RadioGroup2(props) {
|
|
5292
5287
|
const { id, label, options, value, onChange, hidden } = props;
|
|
5293
5288
|
const [internalValue, setInternalValue] = useControlledState(value, value ?? "", onChange);
|
|
5294
|
-
const handleRadioChange =
|
|
5289
|
+
const handleRadioChange = useCallback16(
|
|
5295
5290
|
(event) => {
|
|
5296
5291
|
const newValue = event.target.value;
|
|
5297
5292
|
const option = options.find((opt) => opt.value.toString() === newValue);
|
|
@@ -5308,7 +5303,7 @@ function RadioGroup2(props) {
|
|
|
5308
5303
|
RadioGroup2.displayName = "RadioGroup";
|
|
5309
5304
|
|
|
5310
5305
|
// src/components/FilterMenu/components/DateRange.tsx
|
|
5311
|
-
import React34, { useCallback as
|
|
5306
|
+
import React34, { useCallback as useCallback17, useMemo as useMemo13, useState as useState11, useEffect as useEffect9 } from "react";
|
|
5312
5307
|
import { Stack as Stack5 } from "@mui/joy";
|
|
5313
5308
|
function DateRange(props) {
|
|
5314
5309
|
const {
|
|
@@ -5326,7 +5321,7 @@ function DateRange(props) {
|
|
|
5326
5321
|
hideClearButton
|
|
5327
5322
|
} = props;
|
|
5328
5323
|
const [internalValue, setInternalValue] = useControlledState(value, null, onChange);
|
|
5329
|
-
const [selectedOption, setSelectedOption] =
|
|
5324
|
+
const [selectedOption, setSelectedOption] = useState11("all-time");
|
|
5330
5325
|
const dateRangeOptions = useMemo13(
|
|
5331
5326
|
() => [
|
|
5332
5327
|
{ label: "All Time", value: "all-time" },
|
|
@@ -5337,7 +5332,7 @@ function DateRange(props) {
|
|
|
5337
5332
|
],
|
|
5338
5333
|
[]
|
|
5339
5334
|
);
|
|
5340
|
-
const getDateRangeForOption =
|
|
5335
|
+
const getDateRangeForOption = useCallback17(
|
|
5341
5336
|
(option) => {
|
|
5342
5337
|
const now = /* @__PURE__ */ new Date();
|
|
5343
5338
|
const currentYear = now.getFullYear();
|
|
@@ -5376,7 +5371,7 @@ function DateRange(props) {
|
|
|
5376
5371
|
},
|
|
5377
5372
|
[internalValue]
|
|
5378
5373
|
);
|
|
5379
|
-
const determineOptionFromValue =
|
|
5374
|
+
const determineOptionFromValue = useCallback17(
|
|
5380
5375
|
(value2) => {
|
|
5381
5376
|
if (!value2) {
|
|
5382
5377
|
return "all-time";
|
|
@@ -5398,11 +5393,11 @@ function DateRange(props) {
|
|
|
5398
5393
|
}
|
|
5399
5394
|
return "";
|
|
5400
5395
|
}, [selectedOption, internalValue]);
|
|
5401
|
-
|
|
5396
|
+
useEffect9(() => {
|
|
5402
5397
|
const newOption = determineOptionFromValue(internalValue);
|
|
5403
5398
|
setSelectedOption(newOption);
|
|
5404
5399
|
}, [internalValue, determineOptionFromValue]);
|
|
5405
|
-
const handleOptionChange =
|
|
5400
|
+
const handleOptionChange = useCallback17(
|
|
5406
5401
|
(event) => {
|
|
5407
5402
|
const newOption = event.target.value;
|
|
5408
5403
|
setSelectedOption(newOption);
|
|
@@ -5411,7 +5406,7 @@ function DateRange(props) {
|
|
|
5411
5406
|
},
|
|
5412
5407
|
[getDateRangeForOption, setInternalValue]
|
|
5413
5408
|
);
|
|
5414
|
-
const handleCustomDateChange =
|
|
5409
|
+
const handleCustomDateChange = useCallback17(
|
|
5415
5410
|
(event) => {
|
|
5416
5411
|
const dateRangeString = event.target.value;
|
|
5417
5412
|
if (dateRangeString && dateRangeString.includes(" - ")) {
|
|
@@ -5451,12 +5446,12 @@ function DateRange(props) {
|
|
|
5451
5446
|
DateRange.displayName = "DateRange";
|
|
5452
5447
|
|
|
5453
5448
|
// src/components/FilterMenu/components/CurrencyInput.tsx
|
|
5454
|
-
import React35, { useCallback as
|
|
5449
|
+
import React35, { useCallback as useCallback18 } from "react";
|
|
5455
5450
|
import { Stack as Stack6 } from "@mui/joy";
|
|
5456
5451
|
function CurrencyInput3(props) {
|
|
5457
5452
|
const { id, label, value, onChange, hidden, max, placeholder, useMinorUnit, currency = "USD" } = props;
|
|
5458
5453
|
const [internalValue, setInternalValue] = useControlledState(value, value, onChange);
|
|
5459
|
-
const handleCurrencyChange =
|
|
5454
|
+
const handleCurrencyChange = useCallback18(
|
|
5460
5455
|
(event) => {
|
|
5461
5456
|
const newValue = event.target.value;
|
|
5462
5457
|
setInternalValue(newValue);
|
|
@@ -5482,14 +5477,14 @@ function CurrencyInput3(props) {
|
|
|
5482
5477
|
CurrencyInput3.displayName = "CurrencyInput";
|
|
5483
5478
|
|
|
5484
5479
|
// src/components/FilterMenu/components/CurrencyRange.tsx
|
|
5485
|
-
import React36, { useCallback as
|
|
5480
|
+
import React36, { useCallback as useCallback19 } from "react";
|
|
5486
5481
|
import { Stack as Stack7 } from "@mui/joy";
|
|
5487
5482
|
function CurrencyRange(props) {
|
|
5488
5483
|
const { id, label, value, onChange, hidden, max, placeholder, useMinorUnit, currency = "USD" } = props;
|
|
5489
5484
|
const [internalValue, setInternalValue] = useControlledState(value, null, onChange);
|
|
5490
5485
|
const minValue = internalValue?.[0];
|
|
5491
5486
|
const maxValue = internalValue?.[1];
|
|
5492
|
-
const handleMinChange =
|
|
5487
|
+
const handleMinChange = useCallback19(
|
|
5493
5488
|
(event) => {
|
|
5494
5489
|
const newMinValue = event.target.value;
|
|
5495
5490
|
const currentMaxValue = maxValue;
|
|
@@ -5503,7 +5498,7 @@ function CurrencyRange(props) {
|
|
|
5503
5498
|
},
|
|
5504
5499
|
[maxValue, setInternalValue]
|
|
5505
5500
|
);
|
|
5506
|
-
const handleMaxChange =
|
|
5501
|
+
const handleMaxChange = useCallback19(
|
|
5507
5502
|
(event) => {
|
|
5508
5503
|
const newMaxValue = event.target.value;
|
|
5509
5504
|
const currentMinValue = minValue;
|
|
@@ -5555,7 +5550,7 @@ import React38 from "react";
|
|
|
5555
5550
|
import { Stack as Stack8, Typography as Typography5 } from "@mui/joy";
|
|
5556
5551
|
|
|
5557
5552
|
// src/components/PercentageInput/PercentageInput.tsx
|
|
5558
|
-
import React37, { useCallback as
|
|
5553
|
+
import React37, { useCallback as useCallback20, useMemo as useMemo14, useState as useState12 } from "react";
|
|
5559
5554
|
import { NumericFormat as NumericFormat2 } from "react-number-format";
|
|
5560
5555
|
import { styled as styled20, useThemeProps as useThemeProps6 } from "@mui/joy";
|
|
5561
5556
|
var padDecimal = (value, decimalScale) => {
|
|
@@ -5612,9 +5607,9 @@ var PercentageInput = React37.forwardRef(
|
|
|
5612
5607
|
const [_value, setValue] = useControlledState(
|
|
5613
5608
|
props.value,
|
|
5614
5609
|
props.defaultValue,
|
|
5615
|
-
|
|
5610
|
+
useCallback20((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
5616
5611
|
);
|
|
5617
|
-
const [internalError, setInternalError] =
|
|
5612
|
+
const [internalError, setInternalError] = useState12(
|
|
5618
5613
|
max && _value && _value > max || min && _value && _value < min
|
|
5619
5614
|
);
|
|
5620
5615
|
const value = useMemo14(() => {
|
|
@@ -5623,7 +5618,7 @@ var PercentageInput = React37.forwardRef(
|
|
|
5623
5618
|
}
|
|
5624
5619
|
return _value;
|
|
5625
5620
|
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
5626
|
-
const handleChange =
|
|
5621
|
+
const handleChange = useCallback20(
|
|
5627
5622
|
(event) => {
|
|
5628
5623
|
if (event.target.value === "") {
|
|
5629
5624
|
setValue(void 0);
|
|
@@ -5702,7 +5697,7 @@ var PercentageInput3 = ({
|
|
|
5702
5697
|
};
|
|
5703
5698
|
|
|
5704
5699
|
// src/components/FilterMenu/components/PercentageRange.tsx
|
|
5705
|
-
import React39, { useCallback as
|
|
5700
|
+
import React39, { useCallback as useCallback21 } from "react";
|
|
5706
5701
|
import { Stack as Stack9 } from "@mui/joy";
|
|
5707
5702
|
function PercentageRange(props) {
|
|
5708
5703
|
const { id, label, value, onChange, hidden, useMinorUnit, maxDecimalScale, min, max } = props;
|
|
@@ -5713,7 +5708,7 @@ function PercentageRange(props) {
|
|
|
5713
5708
|
);
|
|
5714
5709
|
const minValue = internalValue?.[0];
|
|
5715
5710
|
const maxValue = internalValue?.[1];
|
|
5716
|
-
const handleMinChange =
|
|
5711
|
+
const handleMinChange = useCallback21(
|
|
5717
5712
|
(event) => {
|
|
5718
5713
|
const newMinValue = event.target.value;
|
|
5719
5714
|
const currentMaxValue = maxValue;
|
|
@@ -5725,7 +5720,7 @@ function PercentageRange(props) {
|
|
|
5725
5720
|
},
|
|
5726
5721
|
[maxValue, setInternalValue]
|
|
5727
5722
|
);
|
|
5728
|
-
const handleMaxChange =
|
|
5723
|
+
const handleMaxChange = useCallback21(
|
|
5729
5724
|
(event) => {
|
|
5730
5725
|
const newMaxValue = event.target.value;
|
|
5731
5726
|
const currentMinValue = minValue;
|
|
@@ -5773,13 +5768,13 @@ function PercentageRange(props) {
|
|
|
5773
5768
|
PercentageRange.displayName = "PercentageRange";
|
|
5774
5769
|
|
|
5775
5770
|
// src/components/FilterMenu/components/Autocomplete.tsx
|
|
5776
|
-
import React40, { useCallback as
|
|
5771
|
+
import React40, { useCallback as useCallback22 } from "react";
|
|
5777
5772
|
import { Stack as Stack10 } from "@mui/joy";
|
|
5778
5773
|
function Autocomplete2(props) {
|
|
5779
5774
|
const { id, label, value, onChange, options, multiple, hidden, placeholder } = props;
|
|
5780
5775
|
const [internalValue, setInternalValue] = useControlledState(value, void 0, onChange);
|
|
5781
5776
|
const autocompleteValue = typeof internalValue === "string" || typeof internalValue === "number" ? String(internalValue) : void 0;
|
|
5782
|
-
const handleChange =
|
|
5777
|
+
const handleChange = useCallback22(
|
|
5783
5778
|
(event) => {
|
|
5784
5779
|
const val = event.target.value;
|
|
5785
5780
|
if (val) {
|
|
@@ -5828,7 +5823,7 @@ function FilterMenu(props) {
|
|
|
5828
5823
|
void 0
|
|
5829
5824
|
// onChange는 Apply 버튼에서만 호출
|
|
5830
5825
|
);
|
|
5831
|
-
const handleFilterChange =
|
|
5826
|
+
const handleFilterChange = useCallback23(
|
|
5832
5827
|
(filterId, value) => {
|
|
5833
5828
|
setInternalValues((prev) => ({
|
|
5834
5829
|
...prev,
|
|
@@ -5837,11 +5832,11 @@ function FilterMenu(props) {
|
|
|
5837
5832
|
},
|
|
5838
5833
|
[setInternalValues]
|
|
5839
5834
|
);
|
|
5840
|
-
const handleApply =
|
|
5835
|
+
const handleApply = useCallback23(() => {
|
|
5841
5836
|
onChange?.(internalValues);
|
|
5842
5837
|
onClose?.();
|
|
5843
5838
|
}, [onChange, onClose, internalValues]);
|
|
5844
|
-
const handleClear =
|
|
5839
|
+
const handleClear = useCallback23(() => {
|
|
5845
5840
|
const clearedValues = resetValues || {};
|
|
5846
5841
|
setInternalValues(clearedValues);
|
|
5847
5842
|
onChange?.(clearedValues);
|
|
@@ -5877,7 +5872,7 @@ function FilterMenu(props) {
|
|
|
5877
5872
|
FilterMenu.displayName = "FilterMenu";
|
|
5878
5873
|
|
|
5879
5874
|
// src/components/Uploader/Uploader.tsx
|
|
5880
|
-
import React42, { useCallback as
|
|
5875
|
+
import React42, { useCallback as useCallback24, useEffect as useEffect10, useMemo as useMemo15, useRef as useRef9, useState as useState13 } from "react";
|
|
5881
5876
|
import { styled as styled21, Input as Input2 } from "@mui/joy";
|
|
5882
5877
|
import MuiFileUploadIcon from "@mui/icons-material/CloudUploadRounded";
|
|
5883
5878
|
import MuiUploadFileIcon from "@mui/icons-material/UploadFileRounded";
|
|
@@ -6026,12 +6021,12 @@ var Uploader = React42.memo(
|
|
|
6026
6021
|
error: errorProp,
|
|
6027
6022
|
helperText: helperTextProp
|
|
6028
6023
|
} = props;
|
|
6029
|
-
const dropZoneRef =
|
|
6030
|
-
const inputRef =
|
|
6031
|
-
const [errorText, setErrorText] =
|
|
6032
|
-
const [files, setFiles] =
|
|
6033
|
-
const [uploaded, setUploaded] =
|
|
6034
|
-
const [previewState, setPreviewState] =
|
|
6024
|
+
const dropZoneRef = useRef9(null);
|
|
6025
|
+
const inputRef = useRef9(null);
|
|
6026
|
+
const [errorText, setErrorText] = useState13();
|
|
6027
|
+
const [files, setFiles] = useState13([]);
|
|
6028
|
+
const [uploaded, setUploaded] = useState13(props.uploaded || []);
|
|
6029
|
+
const [previewState, setPreviewState] = useState13("idle");
|
|
6035
6030
|
const accepts = useMemo15(() => accept.split(",").map((accept2) => accept2.trim()), [accept]);
|
|
6036
6031
|
const parsedAccepts = useMemo15(
|
|
6037
6032
|
() => accepts.flatMap((type) => {
|
|
@@ -6077,7 +6072,7 @@ var Uploader = React42.memo(
|
|
|
6077
6072
|
() => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
|
|
6078
6073
|
[files, maxCount, uploaded]
|
|
6079
6074
|
);
|
|
6080
|
-
const addFiles =
|
|
6075
|
+
const addFiles = useCallback24(
|
|
6081
6076
|
(uploads) => {
|
|
6082
6077
|
try {
|
|
6083
6078
|
const types = parsedAccepts.map((type) => type.replace(".", "")) || [];
|
|
@@ -6122,7 +6117,7 @@ var Uploader = React42.memo(
|
|
|
6122
6117
|
},
|
|
6123
6118
|
[files, uploaded, maxCount, parsedAccepts, maxFileSize, maxFileTotalSize, name, onChange]
|
|
6124
6119
|
);
|
|
6125
|
-
|
|
6120
|
+
useEffect10(() => {
|
|
6126
6121
|
if (!dropZoneRef.current || disabled) {
|
|
6127
6122
|
return;
|
|
6128
6123
|
}
|
|
@@ -6160,7 +6155,7 @@ var Uploader = React42.memo(
|
|
|
6160
6155
|
);
|
|
6161
6156
|
return () => cleanup?.();
|
|
6162
6157
|
}, [disabled, addFiles]);
|
|
6163
|
-
|
|
6158
|
+
useEffect10(() => {
|
|
6164
6159
|
if (inputRef.current && minCount) {
|
|
6165
6160
|
if (files.length < minCount) {
|
|
6166
6161
|
inputRef.current.setCustomValidity(`At least ${minCount} files are required.`);
|
|
@@ -6169,14 +6164,14 @@ var Uploader = React42.memo(
|
|
|
6169
6164
|
}
|
|
6170
6165
|
}
|
|
6171
6166
|
}, [inputRef, files, minCount]);
|
|
6172
|
-
const handleFileChanged =
|
|
6167
|
+
const handleFileChanged = useCallback24(
|
|
6173
6168
|
(event) => {
|
|
6174
6169
|
const files2 = Array.from(event.target.files || []);
|
|
6175
6170
|
addFiles(files2);
|
|
6176
6171
|
},
|
|
6177
6172
|
[addFiles]
|
|
6178
6173
|
);
|
|
6179
|
-
const handleDeleteFile =
|
|
6174
|
+
const handleDeleteFile = useCallback24(
|
|
6180
6175
|
(deletedFile) => {
|
|
6181
6176
|
if (deletedFile instanceof File) {
|
|
6182
6177
|
setFiles((current) => {
|
|
@@ -6196,7 +6191,7 @@ var Uploader = React42.memo(
|
|
|
6196
6191
|
},
|
|
6197
6192
|
[name, onChange, onDelete]
|
|
6198
6193
|
);
|
|
6199
|
-
const handleUploaderButtonClick =
|
|
6194
|
+
const handleUploaderButtonClick = useCallback24(() => {
|
|
6200
6195
|
inputRef.current?.click();
|
|
6201
6196
|
}, []);
|
|
6202
6197
|
const uploader = /* @__PURE__ */ React42.createElement(
|
|
@@ -6291,16 +6286,16 @@ function IconMenuButton(props) {
|
|
|
6291
6286
|
IconMenuButton.displayName = "IconMenuButton";
|
|
6292
6287
|
|
|
6293
6288
|
// src/components/Markdown/Markdown.tsx
|
|
6294
|
-
import React44, { lazy, Suspense, useEffect as
|
|
6289
|
+
import React44, { lazy, Suspense, useEffect as useEffect11, useState as useState14 } from "react";
|
|
6295
6290
|
import { Skeleton } from "@mui/joy";
|
|
6296
6291
|
import { Link as Link2 } from "@mui/joy";
|
|
6297
6292
|
import remarkGfm from "remark-gfm";
|
|
6298
6293
|
var LazyReactMarkdown = lazy(() => import("react-markdown"));
|
|
6299
6294
|
var Markdown = (props) => {
|
|
6300
|
-
const [
|
|
6301
|
-
|
|
6295
|
+
const [rehypeAccent2, setRehypeAccent] = useState14(null);
|
|
6296
|
+
useEffect11(() => {
|
|
6302
6297
|
const loadRehypeAccent = async () => {
|
|
6303
|
-
const module = await
|
|
6298
|
+
const module = await Promise.resolve().then(() => (init_rehype_accent(), rehype_accent_exports));
|
|
6304
6299
|
setRehypeAccent(() => module.rehypeAccent);
|
|
6305
6300
|
};
|
|
6306
6301
|
loadRehypeAccent();
|
|
@@ -6317,7 +6312,7 @@ var Markdown = (props) => {
|
|
|
6317
6312
|
fallback,
|
|
6318
6313
|
...innerProps
|
|
6319
6314
|
} = props;
|
|
6320
|
-
if (!
|
|
6315
|
+
if (!rehypeAccent2) {
|
|
6321
6316
|
return null;
|
|
6322
6317
|
}
|
|
6323
6318
|
return /* @__PURE__ */ React44.createElement(Typography, { component: "div", color, textColor, level: defaultLevel, ...innerProps }, /* @__PURE__ */ React44.createElement(
|
|
@@ -6330,7 +6325,7 @@ var Markdown = (props) => {
|
|
|
6330
6325
|
{
|
|
6331
6326
|
...markdownOptions,
|
|
6332
6327
|
children: content,
|
|
6333
|
-
rehypePlugins: [[
|
|
6328
|
+
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
6334
6329
|
remarkPlugins: [remarkGfm],
|
|
6335
6330
|
components: {
|
|
6336
6331
|
a: ({ children, href }) => /* @__PURE__ */ React44.createElement(Link2, { href, target: defaultLinkAction }, children),
|
|
@@ -6472,7 +6467,7 @@ function MenuButton(props) {
|
|
|
6472
6467
|
MenuButton.displayName = "MenuButton";
|
|
6473
6468
|
|
|
6474
6469
|
// src/components/MonthPicker/MonthPicker.tsx
|
|
6475
|
-
import React46, { forwardRef as forwardRef9, useCallback as
|
|
6470
|
+
import React46, { forwardRef as forwardRef9, useCallback as useCallback25, useEffect as useEffect12, useImperativeHandle as useImperativeHandle4, useRef as useRef10, useState as useState15 } from "react";
|
|
6476
6471
|
import CalendarTodayIcon3 from "@mui/icons-material/CalendarToday";
|
|
6477
6472
|
import { styled as styled22, useThemeProps as useThemeProps7 } from "@mui/joy";
|
|
6478
6473
|
import { FocusTrap as FocusTrap3, ClickAwayListener as ClickAwayListener3, Popper as Popper4 } from "@mui/base";
|
|
@@ -6554,14 +6549,14 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
6554
6549
|
locale,
|
|
6555
6550
|
...innerProps
|
|
6556
6551
|
} = props;
|
|
6557
|
-
const innerRef =
|
|
6558
|
-
const buttonRef =
|
|
6552
|
+
const innerRef = useRef10(null);
|
|
6553
|
+
const buttonRef = useRef10(null);
|
|
6559
6554
|
const [value, setValue, isControlled] = useControlledState(
|
|
6560
6555
|
props.value,
|
|
6561
6556
|
props.defaultValue || "",
|
|
6562
|
-
|
|
6557
|
+
useCallback25((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
6563
6558
|
);
|
|
6564
|
-
const getFormattedDisplayValue =
|
|
6559
|
+
const getFormattedDisplayValue = useCallback25(
|
|
6565
6560
|
(inputValue) => {
|
|
6566
6561
|
if (!inputValue) return "";
|
|
6567
6562
|
try {
|
|
@@ -6572,19 +6567,19 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
6572
6567
|
},
|
|
6573
6568
|
[format, displayFormat, locale]
|
|
6574
6569
|
);
|
|
6575
|
-
const [displayValue, setDisplayValue] =
|
|
6576
|
-
const [anchorEl, setAnchorEl] =
|
|
6570
|
+
const [displayValue, setDisplayValue] = useState15(() => getFormattedDisplayValue(value));
|
|
6571
|
+
const [anchorEl, setAnchorEl] = useState15(null);
|
|
6577
6572
|
const open = Boolean(anchorEl);
|
|
6578
|
-
|
|
6573
|
+
useEffect12(() => {
|
|
6579
6574
|
if (!anchorEl) {
|
|
6580
6575
|
innerRef.current?.blur();
|
|
6581
6576
|
}
|
|
6582
6577
|
}, [anchorEl, innerRef]);
|
|
6583
6578
|
useImperativeHandle4(ref, () => innerRef.current, [innerRef]);
|
|
6584
|
-
|
|
6579
|
+
useEffect12(() => {
|
|
6585
6580
|
setDisplayValue(getFormattedDisplayValue(value));
|
|
6586
6581
|
}, [value, getFormattedDisplayValue]);
|
|
6587
|
-
const handleChange =
|
|
6582
|
+
const handleChange = useCallback25(
|
|
6588
6583
|
(event) => {
|
|
6589
6584
|
const newValue = event.target.value;
|
|
6590
6585
|
setValue(newValue);
|
|
@@ -6594,14 +6589,14 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
6594
6589
|
},
|
|
6595
6590
|
[setValue, getFormattedDisplayValue, isControlled]
|
|
6596
6591
|
);
|
|
6597
|
-
const handleCalendarToggle =
|
|
6592
|
+
const handleCalendarToggle = useCallback25(
|
|
6598
6593
|
(event) => {
|
|
6599
6594
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
6600
6595
|
innerRef.current?.focus();
|
|
6601
6596
|
},
|
|
6602
6597
|
[anchorEl, setAnchorEl, innerRef]
|
|
6603
6598
|
);
|
|
6604
|
-
const handleInputMouseDown =
|
|
6599
|
+
const handleInputMouseDown = useCallback25(
|
|
6605
6600
|
(event) => {
|
|
6606
6601
|
event.preventDefault();
|
|
6607
6602
|
buttonRef.current?.focus();
|
|
@@ -6725,7 +6720,7 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
6725
6720
|
});
|
|
6726
6721
|
|
|
6727
6722
|
// src/components/MonthRangePicker/MonthRangePicker.tsx
|
|
6728
|
-
import React47, { forwardRef as forwardRef10, useCallback as
|
|
6723
|
+
import React47, { forwardRef as forwardRef10, useCallback as useCallback26, useEffect as useEffect13, useImperativeHandle as useImperativeHandle5, useMemo as useMemo16, useRef as useRef11, useState as useState16 } from "react";
|
|
6729
6724
|
import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
|
|
6730
6725
|
import CalendarTodayIcon4 from "@mui/icons-material/CalendarToday";
|
|
6731
6726
|
import { styled as styled23, useThemeProps as useThemeProps8 } from "@mui/joy";
|
|
@@ -6833,35 +6828,35 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
6833
6828
|
size,
|
|
6834
6829
|
...innerProps
|
|
6835
6830
|
} = props;
|
|
6836
|
-
const innerRef =
|
|
6831
|
+
const innerRef = useRef11(null);
|
|
6837
6832
|
const [value, setValue] = useControlledState(
|
|
6838
6833
|
props.value,
|
|
6839
6834
|
props.defaultValue || "",
|
|
6840
|
-
|
|
6835
|
+
useCallback26((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
6841
6836
|
);
|
|
6842
|
-
const [anchorEl, setAnchorEl] =
|
|
6837
|
+
const [anchorEl, setAnchorEl] = useState16(null);
|
|
6843
6838
|
const open = Boolean(anchorEl);
|
|
6844
6839
|
const calendarValue = useMemo16(() => value ? parseDates2(value) : void 0, [value]);
|
|
6845
|
-
|
|
6840
|
+
useEffect13(() => {
|
|
6846
6841
|
if (!anchorEl) {
|
|
6847
6842
|
innerRef.current?.blur();
|
|
6848
6843
|
}
|
|
6849
6844
|
}, [anchorEl, innerRef]);
|
|
6850
6845
|
useImperativeHandle5(ref, () => innerRef.current, [innerRef]);
|
|
6851
|
-
const handleChange =
|
|
6846
|
+
const handleChange = useCallback26(
|
|
6852
6847
|
(event) => {
|
|
6853
6848
|
setValue(event.target.value);
|
|
6854
6849
|
},
|
|
6855
6850
|
[setValue]
|
|
6856
6851
|
);
|
|
6857
|
-
const handleCalendarToggle =
|
|
6852
|
+
const handleCalendarToggle = useCallback26(
|
|
6858
6853
|
(event) => {
|
|
6859
6854
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
6860
6855
|
innerRef.current?.focus();
|
|
6861
6856
|
},
|
|
6862
6857
|
[anchorEl, setAnchorEl, innerRef]
|
|
6863
6858
|
);
|
|
6864
|
-
const handleCalendarChange =
|
|
6859
|
+
const handleCalendarChange = useCallback26(
|
|
6865
6860
|
([date1, date2]) => {
|
|
6866
6861
|
if (!date1 || !date2) return;
|
|
6867
6862
|
setValue(formatValueString4([date1, date2], format));
|
|
@@ -7088,7 +7083,7 @@ function Navigator(props) {
|
|
|
7088
7083
|
Navigator.displayName = "Navigator";
|
|
7089
7084
|
|
|
7090
7085
|
// src/components/ProfileMenu/ProfileMenu.tsx
|
|
7091
|
-
import React51, { useCallback as
|
|
7086
|
+
import React51, { useCallback as useCallback27, useMemo as useMemo17 } from "react";
|
|
7092
7087
|
import { Dropdown as Dropdown2, ListDivider, menuItemClasses, styled as styled26, MenuButton as MenuButton2 } from "@mui/joy";
|
|
7093
7088
|
import { ClickAwayListener as ClickAwayListener5 } from "@mui/base";
|
|
7094
7089
|
import DropdownIcon from "@mui/icons-material/ArrowDropDown";
|
|
@@ -7140,7 +7135,7 @@ function ProfileMenu(props) {
|
|
|
7140
7135
|
const [open, setOpen] = useControlledState(
|
|
7141
7136
|
_open,
|
|
7142
7137
|
defaultOpen ?? false,
|
|
7143
|
-
|
|
7138
|
+
useCallback27((value) => onOpenChange?.(value), [onOpenChange])
|
|
7144
7139
|
);
|
|
7145
7140
|
return /* @__PURE__ */ React51.createElement(ClickAwayListener5, { onClickAway: () => setOpen(false) }, /* @__PURE__ */ React51.createElement("div", null, /* @__PURE__ */ React51.createElement(Dropdown2, { open }, /* @__PURE__ */ React51.createElement(
|
|
7146
7141
|
ProfileMenuButton,
|
|
@@ -7338,8 +7333,90 @@ function RadioList(props) {
|
|
|
7338
7333
|
}
|
|
7339
7334
|
RadioList.displayName = "RadioList";
|
|
7340
7335
|
|
|
7336
|
+
// src/components/SearchBar/SearchBar.tsx
|
|
7337
|
+
import React54, { useState as useState17 } from "react";
|
|
7338
|
+
import SearchRoundedIcon from "@mui/icons-material/SearchRounded";
|
|
7339
|
+
import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
|
|
7340
|
+
function SearchBar(props) {
|
|
7341
|
+
const { hideSelect = false, options, value, onChange, onSearch } = props;
|
|
7342
|
+
const [selectVal, setSelectVal] = useState17(options?.[0]?.value ?? "");
|
|
7343
|
+
const [isHovered, setIsHovered] = useState17(false);
|
|
7344
|
+
const selectedOption = options?.find((o) => o.value === selectVal);
|
|
7345
|
+
const placeholder = selectedOption?.placeholder ?? "";
|
|
7346
|
+
const handleSearch = () => {
|
|
7347
|
+
onSearch?.({ selectValue: hideSelect ? void 0 : selectVal, inputValue: value });
|
|
7348
|
+
};
|
|
7349
|
+
const handleClear = () => {
|
|
7350
|
+
onChange("");
|
|
7351
|
+
};
|
|
7352
|
+
const handleKeyDown = (e) => {
|
|
7353
|
+
if (e.key === "Enter") {
|
|
7354
|
+
handleSearch();
|
|
7355
|
+
}
|
|
7356
|
+
};
|
|
7357
|
+
return /* @__PURE__ */ React54.createElement(
|
|
7358
|
+
Stack,
|
|
7359
|
+
{
|
|
7360
|
+
direction: "row",
|
|
7361
|
+
sx: {
|
|
7362
|
+
width: hideSelect ? "220px" : "300px",
|
|
7363
|
+
bgcolor: "background.surface",
|
|
7364
|
+
borderRadius: "sm",
|
|
7365
|
+
border: 1,
|
|
7366
|
+
borderColor: "neutral.outlinedBorder"
|
|
7367
|
+
}
|
|
7368
|
+
},
|
|
7369
|
+
!hideSelect && options && /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(
|
|
7370
|
+
Select,
|
|
7371
|
+
{
|
|
7372
|
+
variant: "plain",
|
|
7373
|
+
size: "sm",
|
|
7374
|
+
color: "neutral",
|
|
7375
|
+
value: selectVal,
|
|
7376
|
+
options,
|
|
7377
|
+
onChange: (_, newValue) => setSelectVal(newValue),
|
|
7378
|
+
sx: { flex: 1, maxWidth: "110px" },
|
|
7379
|
+
slotProps: {
|
|
7380
|
+
button: {
|
|
7381
|
+
style: { display: "block", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
|
|
7382
|
+
}
|
|
7383
|
+
}
|
|
7384
|
+
}
|
|
7385
|
+
), /* @__PURE__ */ React54.createElement(Divider, { orientation: "vertical", sx: { height: "16px", alignSelf: "center" } })),
|
|
7386
|
+
/* @__PURE__ */ React54.createElement(
|
|
7387
|
+
Input,
|
|
7388
|
+
{
|
|
7389
|
+
variant: "plain",
|
|
7390
|
+
size: "sm",
|
|
7391
|
+
color: "neutral",
|
|
7392
|
+
placeholder,
|
|
7393
|
+
value,
|
|
7394
|
+
onChange: (e) => onChange(e.target.value),
|
|
7395
|
+
onKeyDown: handleKeyDown,
|
|
7396
|
+
sx: { flex: 1, minWidth: 0 },
|
|
7397
|
+
onMouseEnter: () => setIsHovered(true),
|
|
7398
|
+
onMouseLeave: () => setIsHovered(false),
|
|
7399
|
+
endDecorator: isHovered && value ? /* @__PURE__ */ React54.createElement(
|
|
7400
|
+
IconButton,
|
|
7401
|
+
{
|
|
7402
|
+
variant: "plain",
|
|
7403
|
+
size: "sm",
|
|
7404
|
+
color: "neutral",
|
|
7405
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
7406
|
+
onClick: handleClear,
|
|
7407
|
+
"aria-label": "Clear"
|
|
7408
|
+
},
|
|
7409
|
+
/* @__PURE__ */ React54.createElement(CloseRoundedIcon, null)
|
|
7410
|
+
) : void 0
|
|
7411
|
+
}
|
|
7412
|
+
),
|
|
7413
|
+
/* @__PURE__ */ React54.createElement(IconButton, { variant: "plain", size: "sm", color: "neutral", onClick: handleSearch, "aria-label": "Search" }, /* @__PURE__ */ React54.createElement(SearchRoundedIcon, null))
|
|
7414
|
+
);
|
|
7415
|
+
}
|
|
7416
|
+
SearchBar.displayName = "SearchBar";
|
|
7417
|
+
|
|
7341
7418
|
// src/components/Stepper/Stepper.tsx
|
|
7342
|
-
import
|
|
7419
|
+
import React55 from "react";
|
|
7343
7420
|
import {
|
|
7344
7421
|
Stepper as JoyStepper,
|
|
7345
7422
|
Step as JoyStep,
|
|
@@ -7375,7 +7452,7 @@ function Stepper(props) {
|
|
|
7375
7452
|
stepOrientation = "horizontal"
|
|
7376
7453
|
} = props;
|
|
7377
7454
|
const effectiveStepOrientation = orientation === "vertical" ? "horizontal" : stepOrientation;
|
|
7378
|
-
return /* @__PURE__ */
|
|
7455
|
+
return /* @__PURE__ */ React55.createElement(
|
|
7379
7456
|
MotionStepper,
|
|
7380
7457
|
{
|
|
7381
7458
|
orientation,
|
|
@@ -7414,23 +7491,23 @@ function Stepper(props) {
|
|
|
7414
7491
|
const completed = activeStep > i + 1;
|
|
7415
7492
|
const disabled = activeStep < i + 1;
|
|
7416
7493
|
const hasContent = step.label || step.extraContent;
|
|
7417
|
-
return /* @__PURE__ */
|
|
7494
|
+
return /* @__PURE__ */ React55.createElement(
|
|
7418
7495
|
Step,
|
|
7419
7496
|
{
|
|
7420
7497
|
key: `step-${i}`,
|
|
7421
|
-
indicator: /* @__PURE__ */
|
|
7498
|
+
indicator: /* @__PURE__ */ React55.createElement(StepIndicator, { variant: disabled ? "outlined" : "solid", color: disabled ? "neutral" : "primary" }, completed ? /* @__PURE__ */ React55.createElement(CheckIcon, null) : step.indicatorContent),
|
|
7422
7499
|
active,
|
|
7423
7500
|
completed,
|
|
7424
7501
|
disabled,
|
|
7425
7502
|
orientation: effectiveStepOrientation
|
|
7426
7503
|
},
|
|
7427
|
-
hasContent && /* @__PURE__ */
|
|
7504
|
+
hasContent && /* @__PURE__ */ React55.createElement(
|
|
7428
7505
|
Stack_default,
|
|
7429
7506
|
{
|
|
7430
7507
|
sx: orientation === "horizontal" && effectiveStepOrientation === "vertical" ? { alignItems: "center" } : {}
|
|
7431
7508
|
},
|
|
7432
|
-
step.label && /* @__PURE__ */
|
|
7433
|
-
step.extraContent && /* @__PURE__ */
|
|
7509
|
+
step.label && /* @__PURE__ */ React55.createElement(Typography_default, { level: "title-sm" }, step.label),
|
|
7510
|
+
step.extraContent && /* @__PURE__ */ React55.createElement(Typography_default, { level: "body-xs" }, step.extraContent)
|
|
7434
7511
|
)
|
|
7435
7512
|
);
|
|
7436
7513
|
})
|
|
@@ -7439,7 +7516,7 @@ function Stepper(props) {
|
|
|
7439
7516
|
Stepper.displayName = "Stepper";
|
|
7440
7517
|
|
|
7441
7518
|
// src/components/Switch/Switch.tsx
|
|
7442
|
-
import
|
|
7519
|
+
import React56 from "react";
|
|
7443
7520
|
import { Switch as JoySwitch, styled as styled29, switchClasses } from "@mui/joy";
|
|
7444
7521
|
import { motion as motion27 } from "framer-motion";
|
|
7445
7522
|
var MotionSwitch = motion27(JoySwitch);
|
|
@@ -7461,14 +7538,14 @@ var StyledThumb = styled29(motion27.div)({
|
|
|
7461
7538
|
right: "var(--Switch-thumbOffset)"
|
|
7462
7539
|
}
|
|
7463
7540
|
});
|
|
7464
|
-
var Thumb = (props) => /* @__PURE__ */
|
|
7541
|
+
var Thumb = (props) => /* @__PURE__ */ React56.createElement(StyledThumb, { ...props, layout: true, transition: spring });
|
|
7465
7542
|
var spring = {
|
|
7466
7543
|
type: "spring",
|
|
7467
7544
|
stiffness: 700,
|
|
7468
7545
|
damping: 30
|
|
7469
7546
|
};
|
|
7470
7547
|
var Switch = (props) => {
|
|
7471
|
-
return /* @__PURE__ */
|
|
7548
|
+
return /* @__PURE__ */ React56.createElement(
|
|
7472
7549
|
MotionSwitch,
|
|
7473
7550
|
{
|
|
7474
7551
|
...props,
|
|
@@ -7482,7 +7559,7 @@ var Switch = (props) => {
|
|
|
7482
7559
|
Switch.displayName = "Switch";
|
|
7483
7560
|
|
|
7484
7561
|
// src/components/Tabs/Tabs.tsx
|
|
7485
|
-
import
|
|
7562
|
+
import React57, { forwardRef as forwardRef11 } from "react";
|
|
7486
7563
|
import {
|
|
7487
7564
|
Tabs as JoyTabs,
|
|
7488
7565
|
Tab as JoyTab,
|
|
@@ -7506,14 +7583,14 @@ var StyledTab = styled30(JoyTab)(({ theme }) => ({
|
|
|
7506
7583
|
}
|
|
7507
7584
|
}));
|
|
7508
7585
|
var Tab = forwardRef11(function Tab2({ startDecorator, endDecorator, children, ...props }, ref) {
|
|
7509
|
-
return /* @__PURE__ */
|
|
7586
|
+
return /* @__PURE__ */ React57.createElement(StyledTab, { ...props, ref }, startDecorator, children, endDecorator);
|
|
7510
7587
|
});
|
|
7511
7588
|
Tab.displayName = "Tab";
|
|
7512
7589
|
var TabList = JoyTabList;
|
|
7513
7590
|
var TabPanel = JoyTabPanel;
|
|
7514
7591
|
|
|
7515
7592
|
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
7516
|
-
import
|
|
7593
|
+
import React58 from "react";
|
|
7517
7594
|
import { CssBaseline, CssVarsProvider, checkboxClasses, extendTheme, inputClasses } from "@mui/joy";
|
|
7518
7595
|
var colorScheme = {
|
|
7519
7596
|
palette: {
|
|
@@ -7792,7 +7869,7 @@ var defaultTheme = extendTheme({
|
|
|
7792
7869
|
});
|
|
7793
7870
|
function ThemeProvider(props) {
|
|
7794
7871
|
const theme = props.theme || defaultTheme;
|
|
7795
|
-
return /* @__PURE__ */
|
|
7872
|
+
return /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(CssVarsProvider, { theme }, /* @__PURE__ */ React58.createElement(CssBaseline, null), props.children));
|
|
7796
7873
|
}
|
|
7797
7874
|
ThemeProvider.displayName = "ThemeProvider";
|
|
7798
7875
|
export {
|
|
@@ -7876,6 +7953,7 @@ export {
|
|
|
7876
7953
|
RadioGroup,
|
|
7877
7954
|
RadioList,
|
|
7878
7955
|
RadioTileGroup,
|
|
7956
|
+
SearchBar,
|
|
7879
7957
|
Select,
|
|
7880
7958
|
Sheet,
|
|
7881
7959
|
Skeleton2 as Skeleton,
|