@ceed/cds 1.28.1 → 1.29.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/SearchBar/SearchBar.d.ts +21 -0
- package/dist/components/SearchBar/index.d.ts +3 -0
- package/dist/components/data-display/DataTable.md +1 -1
- package/dist/components/data-display/InfoSign.md +91 -74
- package/dist/components/data-display/Typography.md +94 -411
- package/dist/components/feedback/Dialog.md +62 -76
- package/dist/components/feedback/Modal.md +138 -430
- package/dist/components/feedback/llms.txt +0 -2
- package/dist/components/index.d.ts +2 -1
- package/dist/components/inputs/Autocomplete.md +107 -356
- package/dist/components/inputs/ButtonGroup.md +104 -115
- 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/FilterableCheckboxGroup.md +19 -145
- package/dist/components/inputs/IconButton.md +88 -137
- package/dist/components/inputs/Input.md +73 -204
- 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/SearchBar.md +44 -0
- package/dist/components/inputs/Select.md +326 -222
- package/dist/components/inputs/Switch.md +376 -143
- package/dist/components/inputs/Textarea.md +10 -213
- package/dist/components/inputs/Uploader/Uploader.md +66 -145
- package/dist/components/inputs/llms.txt +1 -4
- package/dist/components/navigation/Breadcrumbs.md +308 -57
- package/dist/components/navigation/Drawer.md +0 -180
- package/dist/components/navigation/Dropdown.md +215 -98
- package/dist/components/navigation/IconMenuButton.md +502 -40
- package/dist/components/navigation/InsetDrawer.md +650 -281
- package/dist/components/navigation/Link.md +348 -31
- 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/Stepper.md +28 -160
- package/dist/components/navigation/Tabs.md +316 -57
- package/dist/components/surfaces/Accordions.md +804 -49
- package/dist/components/surfaces/Card.md +157 -97
- package/dist/components/surfaces/Divider.md +234 -83
- package/dist/components/surfaces/Sheet.md +328 -153
- package/dist/index.cjs +411 -574
- package/dist/index.d.ts +1 -1
- package/dist/index.js +400 -507
- package/dist/llms.txt +1 -9
- package/framer/index.js +1 -1
- package/package.json +17 -22
- package/dist/chunks/rehype-accent-FZRUD7VI.js +0 -39
- package/dist/components/RadioTileGroup/RadioTileGroup.d.ts +0 -56
- package/dist/components/RadioTileGroup/index.d.ts +0 -3
- 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/RadioTileGroup.md +0 -507
- package/dist/components/inputs/Slider.md +0 -334
- package/dist/guides/ThemeProvider.md +0 -89
- package/dist/guides/llms.txt +0 -9
- package/dist/index.browser.js +0 -224
- package/dist/index.browser.js.map +0 -7
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,
|
|
@@ -15,7 +71,7 @@ import {
|
|
|
15
71
|
menuButtonClasses,
|
|
16
72
|
menuItemClasses,
|
|
17
73
|
optionClasses,
|
|
18
|
-
radioClasses
|
|
74
|
+
radioClasses,
|
|
19
75
|
radioGroupClasses,
|
|
20
76
|
selectClasses,
|
|
21
77
|
switchClasses as switchClasses2,
|
|
@@ -27,7 +83,7 @@ import {
|
|
|
27
83
|
formHelperTextClasses,
|
|
28
84
|
gridClasses,
|
|
29
85
|
stackClasses,
|
|
30
|
-
sheetClasses
|
|
86
|
+
sheetClasses,
|
|
31
87
|
modalClasses,
|
|
32
88
|
modalCloseClasses,
|
|
33
89
|
modalDialogClasses,
|
|
@@ -96,7 +152,7 @@ import {
|
|
|
96
152
|
stepperClasses,
|
|
97
153
|
Skeleton as Skeleton2,
|
|
98
154
|
skeletonClasses,
|
|
99
|
-
styled as
|
|
155
|
+
styled as styled30
|
|
100
156
|
} from "@mui/joy";
|
|
101
157
|
|
|
102
158
|
// src/components/Accordions/Accordions.tsx
|
|
@@ -703,24 +759,11 @@ Button.displayName = "Button";
|
|
|
703
759
|
var Button_default = Button;
|
|
704
760
|
|
|
705
761
|
// src/components/Calendar/Calendar.tsx
|
|
706
|
-
import
|
|
762
|
+
import React11, { Fragment, forwardRef as forwardRef4, useMemo as useMemo4 } from "react";
|
|
707
763
|
import { styled as styled5 } from "@mui/joy";
|
|
708
764
|
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
|
|
709
765
|
import ChevronRightIcon from "@mui/icons-material/ChevronRight";
|
|
710
|
-
import { AnimatePresence, motion as
|
|
711
|
-
|
|
712
|
-
// src/components/Tooltip/Tooltip.tsx
|
|
713
|
-
import React10 from "react";
|
|
714
|
-
import { Tooltip as JoyTooltip } from "@mui/joy";
|
|
715
|
-
import { motion as motion12 } from "framer-motion";
|
|
716
|
-
var MotionTooltip = motion12(JoyTooltip);
|
|
717
|
-
var Tooltip = (props) => {
|
|
718
|
-
return /* @__PURE__ */ React10.createElement(MotionTooltip, { ...props });
|
|
719
|
-
};
|
|
720
|
-
Tooltip.displayName = "Tooltip";
|
|
721
|
-
|
|
722
|
-
// src/components/Tooltip/index.ts
|
|
723
|
-
var Tooltip_default = Tooltip;
|
|
766
|
+
import { AnimatePresence, motion as motion12 } from "framer-motion";
|
|
724
767
|
|
|
725
768
|
// src/components/Calendar/utils/index.ts
|
|
726
769
|
var getCalendarDates = (date) => {
|
|
@@ -1079,12 +1122,6 @@ var useCalendar = (ownerState) => {
|
|
|
1079
1122
|
};
|
|
1080
1123
|
|
|
1081
1124
|
// src/components/Calendar/Calendar.tsx
|
|
1082
|
-
var MONTH_VIEW_HINT_MESSAGE = "Click the month title to view all months.";
|
|
1083
|
-
var MONTH_NAV_CLICK_WINDOW_MS = 1200;
|
|
1084
|
-
var MONTH_NAV_CLICK_THRESHOLD = 3;
|
|
1085
|
-
var MONTH_VIEW_HINT_DURATION_MS = 5e3;
|
|
1086
|
-
var MONTH_VIEW_HINT_COOLDOWN_MS = 3e4;
|
|
1087
|
-
var lastMonthViewAssistHintShownAt = 0;
|
|
1088
1125
|
var CalendarRoot = styled5("div", {
|
|
1089
1126
|
name: "Calendar",
|
|
1090
1127
|
slot: "root"
|
|
@@ -1111,7 +1148,7 @@ var CalendarViewContainer = styled5("div", {
|
|
|
1111
1148
|
overflow: "hidden",
|
|
1112
1149
|
minHeight: calendarType === "datePicker" ? "250px" : "unset"
|
|
1113
1150
|
}));
|
|
1114
|
-
var CalendarViewTable = styled5(
|
|
1151
|
+
var CalendarViewTable = styled5(motion12.table, {
|
|
1115
1152
|
name: "Calendar",
|
|
1116
1153
|
slot: "viewTable"
|
|
1117
1154
|
})(({ theme }) => ({
|
|
@@ -1291,7 +1328,7 @@ var PickerDays = (props) => {
|
|
|
1291
1328
|
const { getPickerDayProps, getDayCellProps } = useCalendar(ownerState);
|
|
1292
1329
|
const calendarDates = useMemo4(() => getCalendarDates(ownerState.viewMonth), [ownerState.viewMonth]);
|
|
1293
1330
|
const weekdayNames = useMemo4(() => getWeekdayNames(ownerState.locale || "default"), [ownerState.locale]);
|
|
1294
|
-
return /* @__PURE__ */
|
|
1331
|
+
return /* @__PURE__ */ React11.createElement(CalendarViewContainer, { calendarType: "datePicker" }, /* @__PURE__ */ React11.createElement(AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ React11.createElement(
|
|
1295
1332
|
CalendarViewTable,
|
|
1296
1333
|
{
|
|
1297
1334
|
key: `${ownerState.viewMonth.toString()}_${ownerState.direction}`,
|
|
@@ -1320,10 +1357,10 @@ var PickerDays = (props) => {
|
|
|
1320
1357
|
}
|
|
1321
1358
|
}
|
|
1322
1359
|
},
|
|
1323
|
-
/* @__PURE__ */
|
|
1324
|
-
/* @__PURE__ */
|
|
1325
|
-
(date, i) => date ? /* @__PURE__ */
|
|
1326
|
-
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */
|
|
1360
|
+
/* @__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" }))))),
|
|
1361
|
+
/* @__PURE__ */ React11.createElement(CalendarDayPickerContainer, null, calendarDates.map((weekDates, rowIndex) => /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${rowIndex}` }, /* @__PURE__ */ React11.createElement("tr", null, weekDates.map(
|
|
1362
|
+
(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" }))
|
|
1363
|
+
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */ React11.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ React11.createElement("td", { colSpan: 13, style: { height: 4 } })))))
|
|
1327
1364
|
)));
|
|
1328
1365
|
};
|
|
1329
1366
|
var PickerMonths = (props) => {
|
|
@@ -1340,7 +1377,7 @@ var PickerMonths = (props) => {
|
|
|
1340
1377
|
[[]]
|
|
1341
1378
|
);
|
|
1342
1379
|
const isMonthPicker = !ownerState.views?.find((view) => view === "day");
|
|
1343
|
-
return /* @__PURE__ */
|
|
1380
|
+
return /* @__PURE__ */ React11.createElement(CalendarViewContainer, { calendarType: isMonthPicker ? "monthPicker" : "datePicker" }, /* @__PURE__ */ React11.createElement(AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ React11.createElement(
|
|
1344
1381
|
CalendarViewTable,
|
|
1345
1382
|
{
|
|
1346
1383
|
key: `${ownerState.viewMonth.getFullYear()}_${ownerState.direction}`,
|
|
@@ -1369,7 +1406,7 @@ var PickerMonths = (props) => {
|
|
|
1369
1406
|
}
|
|
1370
1407
|
}
|
|
1371
1408
|
},
|
|
1372
|
-
/* @__PURE__ */
|
|
1409
|
+
/* @__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 } })))))
|
|
1373
1410
|
)));
|
|
1374
1411
|
};
|
|
1375
1412
|
var Calendar = forwardRef4((inProps, ref) => {
|
|
@@ -1391,96 +1428,17 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1391
1428
|
...others
|
|
1392
1429
|
} = props;
|
|
1393
1430
|
const { calendarTitle, onPrev, onNext } = useCalendar(ownerState);
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
const monthViewAssistHintShownInSessionRef = useRef3(false);
|
|
1397
|
-
const monthViewAssistHintTimeoutRef = useRef3(null);
|
|
1398
|
-
const hasEndDate = Boolean(value?.[1]);
|
|
1399
|
-
const isRangeHintEligible = Boolean(rangeSelection && !hasEndDate);
|
|
1400
|
-
const isHintEligible = Boolean(view === "day" && (!rangeSelection || isRangeHintEligible));
|
|
1401
|
-
const monthViewHintMessage = MONTH_VIEW_HINT_MESSAGE;
|
|
1402
|
-
useEffect3(() => {
|
|
1403
|
-
if (!isHintEligible) {
|
|
1404
|
-
monthNavClickTimestampsRef.current = [];
|
|
1405
|
-
setIsMonthViewAssistHintOpen(false);
|
|
1406
|
-
}
|
|
1407
|
-
}, [isHintEligible]);
|
|
1408
|
-
useEffect3(() => {
|
|
1409
|
-
return () => {
|
|
1410
|
-
if (monthViewAssistHintTimeoutRef.current) {
|
|
1411
|
-
clearTimeout(monthViewAssistHintTimeoutRef.current);
|
|
1412
|
-
}
|
|
1413
|
-
};
|
|
1414
|
-
}, []);
|
|
1415
|
-
const closeMonthViewAssistHint = useCallback5(() => {
|
|
1416
|
-
if (monthViewAssistHintTimeoutRef.current) {
|
|
1417
|
-
clearTimeout(monthViewAssistHintTimeoutRef.current);
|
|
1418
|
-
monthViewAssistHintTimeoutRef.current = null;
|
|
1419
|
-
}
|
|
1420
|
-
setIsMonthViewAssistHintOpen(false);
|
|
1421
|
-
}, []);
|
|
1422
|
-
const showMonthViewAssistHint = useCallback5(() => {
|
|
1423
|
-
const now = Date.now();
|
|
1424
|
-
if (monthViewAssistHintShownInSessionRef.current) return;
|
|
1425
|
-
if (now - lastMonthViewAssistHintShownAt < MONTH_VIEW_HINT_COOLDOWN_MS) return;
|
|
1426
|
-
monthViewAssistHintShownInSessionRef.current = true;
|
|
1427
|
-
lastMonthViewAssistHintShownAt = now;
|
|
1428
|
-
setIsMonthViewAssistHintOpen(true);
|
|
1429
|
-
if (monthViewAssistHintTimeoutRef.current) {
|
|
1430
|
-
clearTimeout(monthViewAssistHintTimeoutRef.current);
|
|
1431
|
-
}
|
|
1432
|
-
monthViewAssistHintTimeoutRef.current = setTimeout(() => {
|
|
1433
|
-
setIsMonthViewAssistHintOpen(false);
|
|
1434
|
-
monthViewAssistHintTimeoutRef.current = null;
|
|
1435
|
-
}, MONTH_VIEW_HINT_DURATION_MS);
|
|
1436
|
-
}, []);
|
|
1437
|
-
const trackFastMonthNavigation = useCallback5(() => {
|
|
1438
|
-
if (!isHintEligible) return;
|
|
1439
|
-
const now = Date.now();
|
|
1440
|
-
monthNavClickTimestampsRef.current = [
|
|
1441
|
-
...monthNavClickTimestampsRef.current.filter((timestamp) => now - timestamp <= MONTH_NAV_CLICK_WINDOW_MS),
|
|
1442
|
-
now
|
|
1443
|
-
];
|
|
1444
|
-
if (monthNavClickTimestampsRef.current.length >= MONTH_NAV_CLICK_THRESHOLD) {
|
|
1445
|
-
showMonthViewAssistHint();
|
|
1446
|
-
}
|
|
1447
|
-
}, [isHintEligible, showMonthViewAssistHint]);
|
|
1448
|
-
const handlePrevClick = useCallback5(() => {
|
|
1449
|
-
onPrev();
|
|
1450
|
-
trackFastMonthNavigation();
|
|
1451
|
-
}, [onPrev, trackFastMonthNavigation]);
|
|
1452
|
-
const handleNextClick = useCallback5(() => {
|
|
1453
|
-
onNext();
|
|
1454
|
-
trackFastMonthNavigation();
|
|
1455
|
-
}, [onNext, trackFastMonthNavigation]);
|
|
1456
|
-
const handleSwitchViewClick = useCallback5(() => {
|
|
1457
|
-
closeMonthViewAssistHint();
|
|
1458
|
-
onViewChange?.();
|
|
1459
|
-
}, [closeMonthViewAssistHint, onViewChange]);
|
|
1460
|
-
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(
|
|
1461
|
-
Tooltip_default,
|
|
1431
|
+
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(
|
|
1432
|
+
CalendarSwitchViewButton,
|
|
1462
1433
|
{
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
disableHoverListener: true,
|
|
1469
|
-
disableTouchListener: true,
|
|
1470
|
-
variant: "solid"
|
|
1434
|
+
ownerState,
|
|
1435
|
+
variant: "plain",
|
|
1436
|
+
color: "neutral",
|
|
1437
|
+
onClick: onViewChange,
|
|
1438
|
+
"aria-label": "Switch Calendar View"
|
|
1471
1439
|
},
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
{
|
|
1475
|
-
ownerState,
|
|
1476
|
-
variant: "plain",
|
|
1477
|
-
color: "neutral",
|
|
1478
|
-
onClick: handleSwitchViewClick,
|
|
1479
|
-
"aria-label": "Switch Calendar View"
|
|
1480
|
-
},
|
|
1481
|
-
calendarTitle
|
|
1482
|
-
)
|
|
1483
|
-
), /* @__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 }));
|
|
1440
|
+
calendarTitle
|
|
1441
|
+
), /* @__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 }));
|
|
1484
1442
|
});
|
|
1485
1443
|
Calendar.displayName = "Calendar";
|
|
1486
1444
|
|
|
@@ -1495,30 +1453,30 @@ import {
|
|
|
1495
1453
|
CardActions as JoyCardActions,
|
|
1496
1454
|
CardOverflow as JoyCardOverflow
|
|
1497
1455
|
} from "@mui/joy";
|
|
1498
|
-
import { motion as
|
|
1499
|
-
var MotionCard =
|
|
1456
|
+
import { motion as motion13 } from "framer-motion";
|
|
1457
|
+
var MotionCard = motion13(JoyCard);
|
|
1500
1458
|
var Card = MotionCard;
|
|
1501
1459
|
Card.displayName = "Card";
|
|
1502
|
-
var MotionCardContent =
|
|
1460
|
+
var MotionCardContent = motion13(JoyCardContent);
|
|
1503
1461
|
var CardContent = MotionCardContent;
|
|
1504
1462
|
CardContent.displayName = "CardContent";
|
|
1505
|
-
var MotionCardCover =
|
|
1463
|
+
var MotionCardCover = motion13(JoyCardCover);
|
|
1506
1464
|
var CardCover = MotionCardCover;
|
|
1507
1465
|
CardCover.displayName = "CardCover";
|
|
1508
|
-
var MotionCardActions =
|
|
1466
|
+
var MotionCardActions = motion13(JoyCardActions);
|
|
1509
1467
|
var CardActions = MotionCardActions;
|
|
1510
1468
|
CardActions.displayName = "CardActions";
|
|
1511
|
-
var MotionCardOverflow =
|
|
1469
|
+
var MotionCardOverflow = motion13(JoyCardOverflow);
|
|
1512
1470
|
var CardOverflow = MotionCardOverflow;
|
|
1513
1471
|
CardOverflow.displayName = "CardOverflow";
|
|
1514
1472
|
|
|
1515
1473
|
// src/components/Checkbox/Checkbox.tsx
|
|
1516
|
-
import
|
|
1474
|
+
import React12 from "react";
|
|
1517
1475
|
import { Checkbox as JoyCheckbox } from "@mui/joy";
|
|
1518
|
-
import { motion as
|
|
1519
|
-
var MotionCheckbox =
|
|
1476
|
+
import { motion as motion14 } from "framer-motion";
|
|
1477
|
+
var MotionCheckbox = motion14(JoyCheckbox);
|
|
1520
1478
|
var Checkbox = (props) => {
|
|
1521
|
-
return /* @__PURE__ */
|
|
1479
|
+
return /* @__PURE__ */ React12.createElement(MotionCheckbox, { ...props });
|
|
1522
1480
|
};
|
|
1523
1481
|
Checkbox.displayName = "Checkbox";
|
|
1524
1482
|
|
|
@@ -1527,7 +1485,7 @@ var Checkbox_default = Checkbox;
|
|
|
1527
1485
|
|
|
1528
1486
|
// src/components/Container/Container.tsx
|
|
1529
1487
|
import { styled as styled6 } from "@mui/joy";
|
|
1530
|
-
import
|
|
1488
|
+
import React13, { forwardRef as forwardRef5 } from "react";
|
|
1531
1489
|
var ContainerRoot = styled6("div", {
|
|
1532
1490
|
name: "Container",
|
|
1533
1491
|
slot: "root",
|
|
@@ -1554,23 +1512,24 @@ var ContainerRoot = styled6("div", {
|
|
|
1554
1512
|
} : null
|
|
1555
1513
|
]);
|
|
1556
1514
|
var Container = forwardRef5(function Container2(props, ref) {
|
|
1557
|
-
return /* @__PURE__ */
|
|
1515
|
+
return /* @__PURE__ */ React13.createElement(ContainerRoot, { ref, ...props });
|
|
1558
1516
|
});
|
|
1559
1517
|
Container.displayName = "Container";
|
|
1560
1518
|
|
|
1561
1519
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
1562
|
-
import
|
|
1520
|
+
import React15, { useCallback as useCallback6, useMemo as useMemo5, useState as useState5 } from "react";
|
|
1521
|
+
import { IntlMessageFormat as IntlMessageFormat2 } from "intl-messageformat";
|
|
1563
1522
|
import { NumericFormat } from "react-number-format";
|
|
1564
1523
|
|
|
1565
1524
|
// src/components/Input/Input.tsx
|
|
1566
|
-
import
|
|
1525
|
+
import React14, { useCallback as useCallback5, useState as useState4 } from "react";
|
|
1567
1526
|
import { Input as JoyInput } from "@mui/joy";
|
|
1568
|
-
import { motion as
|
|
1527
|
+
import { motion as motion15 } from "framer-motion";
|
|
1569
1528
|
import ClearIcon from "@mui/icons-material/Close";
|
|
1570
1529
|
import VisibilityIcon from "@mui/icons-material/Visibility";
|
|
1571
1530
|
import VisibilityOffIcon from "@mui/icons-material/VisibilityOff";
|
|
1572
|
-
var MotionInput =
|
|
1573
|
-
var Input =
|
|
1531
|
+
var MotionInput = motion15(JoyInput);
|
|
1532
|
+
var Input = React14.forwardRef((props, ref) => {
|
|
1574
1533
|
const {
|
|
1575
1534
|
label,
|
|
1576
1535
|
helperText,
|
|
@@ -1593,11 +1552,11 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
1593
1552
|
if (type === "password" && innerProps.endDecorator) {
|
|
1594
1553
|
console.warn('Input: endDecorator is not supported when type="password"');
|
|
1595
1554
|
}
|
|
1596
|
-
const [passwordVisible, setPasswordVisible] =
|
|
1555
|
+
const [passwordVisible, setPasswordVisible] = useState4(false);
|
|
1597
1556
|
const [value, setValue] = useControlledState(
|
|
1598
1557
|
props.value,
|
|
1599
1558
|
props.defaultValue,
|
|
1600
|
-
|
|
1559
|
+
useCallback5(
|
|
1601
1560
|
(value2) => {
|
|
1602
1561
|
onChange?.({
|
|
1603
1562
|
/**
|
|
@@ -1623,7 +1582,7 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
1623
1582
|
const actualType = type === "password" && passwordVisible ? "text" : type;
|
|
1624
1583
|
const isPasswordType = type === "password";
|
|
1625
1584
|
const showPasswordToggle = isPasswordType && !disableTogglePasswordButton;
|
|
1626
|
-
const input = /* @__PURE__ */
|
|
1585
|
+
const input = /* @__PURE__ */ React14.createElement(
|
|
1627
1586
|
MotionInput,
|
|
1628
1587
|
{
|
|
1629
1588
|
value,
|
|
@@ -1638,7 +1597,7 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
1638
1597
|
...innerProps.slotProps
|
|
1639
1598
|
},
|
|
1640
1599
|
...innerProps,
|
|
1641
|
-
endDecorator: isPasswordType ? showPasswordToggle ? /* @__PURE__ */
|
|
1600
|
+
endDecorator: isPasswordType ? showPasswordToggle ? /* @__PURE__ */ React14.createElement(Stack_default, { gap: 1, direction: "row" }, /* @__PURE__ */ React14.createElement(
|
|
1642
1601
|
IconButton_default,
|
|
1643
1602
|
{
|
|
1644
1603
|
onMouseDown: (e) => e.preventDefault(),
|
|
@@ -1646,19 +1605,19 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
1646
1605
|
disabled,
|
|
1647
1606
|
"aria-label": passwordVisible ? "Hide password" : "Show password"
|
|
1648
1607
|
},
|
|
1649
|
-
passwordVisible ? /* @__PURE__ */
|
|
1650
|
-
)) : null : enableClearable ? /* @__PURE__ */
|
|
1608
|
+
passwordVisible ? /* @__PURE__ */ React14.createElement(VisibilityOffIcon, null) : /* @__PURE__ */ React14.createElement(VisibilityIcon, null)
|
|
1609
|
+
)) : null : enableClearable ? /* @__PURE__ */ React14.createElement(Stack_default, { gap: 1, direction: "row" }, innerProps.endDecorator, value && /* @__PURE__ */ React14.createElement(
|
|
1651
1610
|
IconButton_default,
|
|
1652
1611
|
{
|
|
1653
1612
|
onMouseDown: (e) => e.preventDefault(),
|
|
1654
1613
|
onClick: handleClear,
|
|
1655
1614
|
"aria-label": "Clear"
|
|
1656
1615
|
},
|
|
1657
|
-
/* @__PURE__ */
|
|
1616
|
+
/* @__PURE__ */ React14.createElement(ClearIcon, null)
|
|
1658
1617
|
)) : innerProps.endDecorator
|
|
1659
1618
|
}
|
|
1660
1619
|
);
|
|
1661
|
-
return /* @__PURE__ */
|
|
1620
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1662
1621
|
FormControl_default,
|
|
1663
1622
|
{
|
|
1664
1623
|
required,
|
|
@@ -1669,9 +1628,9 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
1669
1628
|
sx,
|
|
1670
1629
|
className
|
|
1671
1630
|
},
|
|
1672
|
-
label && /* @__PURE__ */
|
|
1631
|
+
label && /* @__PURE__ */ React14.createElement(FormLabel_default, null, label),
|
|
1673
1632
|
input,
|
|
1674
|
-
helperText && /* @__PURE__ */
|
|
1633
|
+
helperText && /* @__PURE__ */ React14.createElement(FormHelperText_default, null, helperText)
|
|
1675
1634
|
);
|
|
1676
1635
|
});
|
|
1677
1636
|
Input.displayName = "Input";
|
|
@@ -1683,6 +1642,7 @@ var Input_default = Input;
|
|
|
1683
1642
|
import { styled as styled7, useThemeProps as useThemeProps3 } from "@mui/joy";
|
|
1684
1643
|
|
|
1685
1644
|
// src/components/CurrencyInput/hooks/use-currency-setting.ts
|
|
1645
|
+
import IntlMessageFormat from "intl-messageformat";
|
|
1686
1646
|
var CURRENCY_DECIMAL_MAP = {
|
|
1687
1647
|
AED: 2,
|
|
1688
1648
|
ALL: 2,
|
|
@@ -1827,10 +1787,9 @@ var CURRENCY_DECIMAL_MAP = {
|
|
|
1827
1787
|
};
|
|
1828
1788
|
var useCurrencySetting = (props) => {
|
|
1829
1789
|
const { currency = "USD", placeholder } = props;
|
|
1830
|
-
const
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
const decimalSeparator = parts.find((p) => p.type === "decimal")?.value;
|
|
1790
|
+
const [symbol, thousandSeparator, decimalSeparator, ...rest] = new IntlMessageFormat(
|
|
1791
|
+
`{amount, number, ::currency/${currency} unit-width-narrow}`
|
|
1792
|
+
).format({ amount: 1e3 }).toString().replace(/\d/g, "").split("");
|
|
1834
1793
|
const decimalScale = CURRENCY_DECIMAL_MAP[currency];
|
|
1835
1794
|
return {
|
|
1836
1795
|
symbol: `${symbol} `,
|
|
@@ -1843,9 +1802,9 @@ var useCurrencySetting = (props) => {
|
|
|
1843
1802
|
};
|
|
1844
1803
|
|
|
1845
1804
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
1846
|
-
var TextMaskAdapter =
|
|
1805
|
+
var TextMaskAdapter = React15.forwardRef(function TextMaskAdapter2(props, ref) {
|
|
1847
1806
|
const { onChange, ...innerProps } = props;
|
|
1848
|
-
return /* @__PURE__ */
|
|
1807
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1849
1808
|
NumericFormat,
|
|
1850
1809
|
{
|
|
1851
1810
|
...innerProps,
|
|
@@ -1865,7 +1824,7 @@ var CurrencyInputRoot = styled7(Input_default, {
|
|
|
1865
1824
|
slot: "root",
|
|
1866
1825
|
overridesResolver: (props, styles) => styles.root
|
|
1867
1826
|
})({});
|
|
1868
|
-
var CurrencyInput =
|
|
1827
|
+
var CurrencyInput = React15.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
1869
1828
|
const props = useThemeProps3({ props: inProps, name: "CurrencyInput" });
|
|
1870
1829
|
const {
|
|
1871
1830
|
currency = "USD",
|
|
@@ -1886,7 +1845,7 @@ var CurrencyInput = React16.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
1886
1845
|
const [_value, setValue] = useControlledState(
|
|
1887
1846
|
props.value,
|
|
1888
1847
|
props.defaultValue,
|
|
1889
|
-
|
|
1848
|
+
useCallback6((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
1890
1849
|
);
|
|
1891
1850
|
const value = useMemo5(() => {
|
|
1892
1851
|
if (_value && useMinorUnit) {
|
|
@@ -1900,14 +1859,14 @@ var CurrencyInput = React16.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
1900
1859
|
}
|
|
1901
1860
|
return props.max;
|
|
1902
1861
|
}, [props.max, useMinorUnit, decimalScale]);
|
|
1903
|
-
const [isOverLimit, setIsOverLimit] =
|
|
1904
|
-
const handleChange =
|
|
1862
|
+
const [isOverLimit, setIsOverLimit] = useState5(!!max && !!value && value > max);
|
|
1863
|
+
const handleChange = useCallback6(
|
|
1905
1864
|
(event) => {
|
|
1906
1865
|
if (event.target.value === "") {
|
|
1907
1866
|
setValue(void 0);
|
|
1908
1867
|
return;
|
|
1909
1868
|
}
|
|
1910
|
-
const amount = useMinorUnit ? Number(
|
|
1869
|
+
const amount = useMinorUnit ? Number(event.target.value?.replace(decimalSeparator, "")) : Number(event.target.value);
|
|
1911
1870
|
if (!!max && Number(event.target.value) > max) {
|
|
1912
1871
|
setIsOverLimit(true);
|
|
1913
1872
|
} else {
|
|
@@ -1917,7 +1876,7 @@ var CurrencyInput = React16.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
1917
1876
|
},
|
|
1918
1877
|
[decimalSeparator, max, useMinorUnit, setValue]
|
|
1919
1878
|
);
|
|
1920
|
-
return /* @__PURE__ */
|
|
1879
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1921
1880
|
CurrencyInputRoot,
|
|
1922
1881
|
{
|
|
1923
1882
|
...innerProps,
|
|
@@ -1930,7 +1889,9 @@ var CurrencyInput = React16.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
1930
1889
|
required,
|
|
1931
1890
|
color: error || isOverLimit ? "danger" : props.color,
|
|
1932
1891
|
label,
|
|
1933
|
-
helperText: isOverLimit ? `limit:
|
|
1892
|
+
helperText: isOverLimit ? new IntlMessageFormat2(`limit: {amount, number, ::currency/${currency} unit-width-narrow}`).format({
|
|
1893
|
+
amount: max
|
|
1894
|
+
}) : helperText,
|
|
1934
1895
|
slotProps: {
|
|
1935
1896
|
input: {
|
|
1936
1897
|
component: TextMaskAdapter,
|
|
@@ -1955,9 +1916,9 @@ var CurrencyInput_default = CurrencyInput;
|
|
|
1955
1916
|
|
|
1956
1917
|
// src/components/DataTable/DataTable.tsx
|
|
1957
1918
|
import React25, {
|
|
1958
|
-
useCallback as
|
|
1919
|
+
useCallback as useCallback11,
|
|
1959
1920
|
useMemo as useMemo10,
|
|
1960
|
-
useRef as
|
|
1921
|
+
useRef as useRef6,
|
|
1961
1922
|
useId,
|
|
1962
1923
|
forwardRef as forwardRef7,
|
|
1963
1924
|
useImperativeHandle as useImperativeHandle2,
|
|
@@ -2192,9 +2153,9 @@ function computeAutoFitWidth(params) {
|
|
|
2192
2153
|
}
|
|
2193
2154
|
|
|
2194
2155
|
// src/components/DataTable/styled.tsx
|
|
2195
|
-
import
|
|
2156
|
+
import React16 from "react";
|
|
2196
2157
|
import { styled as styled8, LinearProgress, buttonClasses, iconButtonClasses, Typography as Typography3 } from "@mui/joy";
|
|
2197
|
-
import { motion as
|
|
2158
|
+
import { motion as motion16 } from "framer-motion";
|
|
2198
2159
|
import SortIcon from "@mui/icons-material/ArrowUpwardRounded";
|
|
2199
2160
|
var EllipsisDiv = styled8("div", {
|
|
2200
2161
|
name: "DataTable",
|
|
@@ -2278,7 +2239,7 @@ var Asterisk = styled8("span", {
|
|
|
2278
2239
|
color: "var(--ceed-palette-danger-500)",
|
|
2279
2240
|
marginLeft: theme.spacing(0.5)
|
|
2280
2241
|
}));
|
|
2281
|
-
var StyledTh = styled8(
|
|
2242
|
+
var StyledTh = styled8(motion16.th)(({ theme }) => ({
|
|
2282
2243
|
boxShadow: "1px 0 var(--TableCell-borderColor)"
|
|
2283
2244
|
}));
|
|
2284
2245
|
var StyledTd = styled8("td")(({ theme }) => ({
|
|
@@ -2297,10 +2258,10 @@ var StyledTd = styled8("td")(({ theme }) => ({
|
|
|
2297
2258
|
}
|
|
2298
2259
|
}
|
|
2299
2260
|
}));
|
|
2300
|
-
var MotionSortIcon =
|
|
2301
|
-
var DefaultLoadingOverlay = () => /* @__PURE__ */
|
|
2302
|
-
var DefaultNoRowsOverlay = () => /* @__PURE__ */
|
|
2303
|
-
var Resizer = (ref, targetRef = ref, onResizeStateChange, onAutoFit) => /* @__PURE__ */
|
|
2261
|
+
var MotionSortIcon = motion16(SortIcon);
|
|
2262
|
+
var DefaultLoadingOverlay = () => /* @__PURE__ */ React16.createElement(LinearProgress, { value: 8, variant: "plain" });
|
|
2263
|
+
var DefaultNoRowsOverlay = () => /* @__PURE__ */ React16.createElement(Typography3, { level: "body-sm", textColor: "text.tertiary" }, "No rows");
|
|
2264
|
+
var Resizer = (ref, targetRef = ref, onResizeStateChange, onAutoFit) => /* @__PURE__ */ React16.createElement(
|
|
2304
2265
|
Box_default,
|
|
2305
2266
|
{
|
|
2306
2267
|
sx: {
|
|
@@ -2378,12 +2339,12 @@ var Resizer = (ref, targetRef = ref, onResizeStateChange, onAutoFit) => /* @__PU
|
|
|
2378
2339
|
|
|
2379
2340
|
// src/components/DataTable/components.tsx
|
|
2380
2341
|
import React22, {
|
|
2381
|
-
useRef as
|
|
2382
|
-
useState as
|
|
2342
|
+
useRef as useRef4,
|
|
2343
|
+
useState as useState7,
|
|
2383
2344
|
useLayoutEffect,
|
|
2384
2345
|
useMemo as useMemo8,
|
|
2385
|
-
useCallback as
|
|
2386
|
-
useEffect as
|
|
2346
|
+
useCallback as useCallback8,
|
|
2347
|
+
useEffect as useEffect4,
|
|
2387
2348
|
memo,
|
|
2388
2349
|
createElement
|
|
2389
2350
|
} from "react";
|
|
@@ -2391,7 +2352,7 @@ import { styled as styled12, useTheme } from "@mui/joy";
|
|
|
2391
2352
|
import { AnimatePresence as AnimatePresence2 } from "framer-motion";
|
|
2392
2353
|
|
|
2393
2354
|
// src/components/DatePicker/DatePicker.tsx
|
|
2394
|
-
import
|
|
2355
|
+
import React17, { forwardRef as forwardRef6, useCallback as useCallback7, useEffect as useEffect3, useImperativeHandle, useRef as useRef3, useState as useState6 } from "react";
|
|
2395
2356
|
import { IMaskInput, IMask } from "react-imask";
|
|
2396
2357
|
import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
|
|
2397
2358
|
import { styled as styled10, useThemeProps as useThemeProps4 } from "@mui/joy";
|
|
@@ -2406,8 +2367,8 @@ var Sheet_default = Sheet;
|
|
|
2406
2367
|
|
|
2407
2368
|
// src/components/DialogActions/DialogActions.tsx
|
|
2408
2369
|
import { DialogActions as JoyDialogActions, styled as styled9 } from "@mui/joy";
|
|
2409
|
-
import { motion as
|
|
2410
|
-
var MotionDialogActions =
|
|
2370
|
+
import { motion as motion17 } from "framer-motion";
|
|
2371
|
+
var MotionDialogActions = motion17(JoyDialogActions);
|
|
2411
2372
|
var StyledDialogActions = styled9(MotionDialogActions)(({ theme }) => ({
|
|
2412
2373
|
padding: theme.spacing(2),
|
|
2413
2374
|
gap: theme.spacing(2),
|
|
@@ -2503,9 +2464,9 @@ function parseDate(dateString, format) {
|
|
|
2503
2464
|
var formatToPattern = (format) => {
|
|
2504
2465
|
return format.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
2505
2466
|
};
|
|
2506
|
-
var TextMaskAdapter3 =
|
|
2467
|
+
var TextMaskAdapter3 = React17.forwardRef(function TextMaskAdapter4(props, ref) {
|
|
2507
2468
|
const { onChange, format, ...other } = props;
|
|
2508
|
-
return /* @__PURE__ */
|
|
2469
|
+
return /* @__PURE__ */ React17.createElement(
|
|
2509
2470
|
IMaskInput,
|
|
2510
2471
|
{
|
|
2511
2472
|
...other,
|
|
@@ -2565,24 +2526,24 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2565
2526
|
shouldDisableDate,
|
|
2566
2527
|
...innerProps
|
|
2567
2528
|
} = props;
|
|
2568
|
-
const innerRef =
|
|
2569
|
-
const buttonRef =
|
|
2529
|
+
const innerRef = useRef3(null);
|
|
2530
|
+
const buttonRef = useRef3(null);
|
|
2570
2531
|
const [value, setValue] = useControlledState(
|
|
2571
2532
|
props.value,
|
|
2572
2533
|
props.defaultValue || "",
|
|
2573
|
-
|
|
2534
|
+
useCallback7((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
2574
2535
|
);
|
|
2575
|
-
const [displayValue, setDisplayValue] =
|
|
2536
|
+
const [displayValue, setDisplayValue] = useState6(
|
|
2576
2537
|
() => value ? formatValueString(parseDate(value, format), displayFormat) : ""
|
|
2577
2538
|
);
|
|
2578
|
-
const [anchorEl, setAnchorEl] =
|
|
2539
|
+
const [anchorEl, setAnchorEl] = useState6(null);
|
|
2579
2540
|
const open = Boolean(anchorEl);
|
|
2580
|
-
|
|
2541
|
+
useEffect3(() => {
|
|
2581
2542
|
if (!anchorEl) {
|
|
2582
2543
|
innerRef.current?.blur();
|
|
2583
2544
|
}
|
|
2584
2545
|
}, [anchorEl, innerRef]);
|
|
2585
|
-
|
|
2546
|
+
useEffect3(() => {
|
|
2586
2547
|
if (value === "") {
|
|
2587
2548
|
setDisplayValue("");
|
|
2588
2549
|
return;
|
|
@@ -2593,7 +2554,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2593
2554
|
}
|
|
2594
2555
|
}, [displayFormat, displayValue, format, value]);
|
|
2595
2556
|
useImperativeHandle(ref, () => innerRef.current, [innerRef]);
|
|
2596
|
-
const handleChange =
|
|
2557
|
+
const handleChange = useCallback7(
|
|
2597
2558
|
(event) => {
|
|
2598
2559
|
const value2 = event.target.value;
|
|
2599
2560
|
setDisplayValue(value2 ? formatValueString(parseDate(value2, format), displayFormat) : value2);
|
|
@@ -2601,7 +2562,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2601
2562
|
},
|
|
2602
2563
|
[displayFormat, format, setValue]
|
|
2603
2564
|
);
|
|
2604
|
-
const handleDisplayInputChange =
|
|
2565
|
+
const handleDisplayInputChange = useCallback7(
|
|
2605
2566
|
(event) => {
|
|
2606
2567
|
if (event.target.value === "") {
|
|
2607
2568
|
handleChange({
|
|
@@ -2626,7 +2587,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2626
2587
|
},
|
|
2627
2588
|
[displayFormat, format, handleChange, props.name]
|
|
2628
2589
|
);
|
|
2629
|
-
const handleCalendarToggle =
|
|
2590
|
+
const handleCalendarToggle = useCallback7(
|
|
2630
2591
|
(event) => {
|
|
2631
2592
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
2632
2593
|
setTimeout(() => {
|
|
@@ -2635,7 +2596,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2635
2596
|
},
|
|
2636
2597
|
[anchorEl, setAnchorEl, innerRef]
|
|
2637
2598
|
);
|
|
2638
|
-
const handleInputMouseDown =
|
|
2599
|
+
const handleInputMouseDown = useCallback7(
|
|
2639
2600
|
(event) => {
|
|
2640
2601
|
if (inputReadOnly) {
|
|
2641
2602
|
event.preventDefault();
|
|
@@ -2644,7 +2605,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2644
2605
|
},
|
|
2645
2606
|
[inputReadOnly, buttonRef]
|
|
2646
2607
|
);
|
|
2647
|
-
return /* @__PURE__ */
|
|
2608
|
+
return /* @__PURE__ */ React17.createElement(DatePickerRoot, null, /* @__PURE__ */ React17.createElement(FocusTrap, { open: true }, /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
2648
2609
|
Input_default,
|
|
2649
2610
|
{
|
|
2650
2611
|
...innerProps,
|
|
@@ -2672,7 +2633,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2672
2633
|
},
|
|
2673
2634
|
className,
|
|
2674
2635
|
sx,
|
|
2675
|
-
endDecorator: /* @__PURE__ */
|
|
2636
|
+
endDecorator: /* @__PURE__ */ React17.createElement(
|
|
2676
2637
|
CalendarButton,
|
|
2677
2638
|
{
|
|
2678
2639
|
ref: buttonRef,
|
|
@@ -2684,13 +2645,13 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2684
2645
|
"aria-expanded": open,
|
|
2685
2646
|
disabled
|
|
2686
2647
|
},
|
|
2687
|
-
/* @__PURE__ */
|
|
2648
|
+
/* @__PURE__ */ React17.createElement(CalendarTodayIcon, null)
|
|
2688
2649
|
),
|
|
2689
2650
|
label,
|
|
2690
2651
|
helperText,
|
|
2691
2652
|
readOnly: readOnly || inputReadOnly
|
|
2692
2653
|
}
|
|
2693
|
-
), open && /* @__PURE__ */
|
|
2654
|
+
), open && /* @__PURE__ */ React17.createElement(ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React17.createElement(
|
|
2694
2655
|
StyledPopper,
|
|
2695
2656
|
{
|
|
2696
2657
|
id: "date-picker-popper",
|
|
@@ -2709,7 +2670,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2709
2670
|
"aria-label": "Calendar Tooltip",
|
|
2710
2671
|
"aria-expanded": open
|
|
2711
2672
|
},
|
|
2712
|
-
/* @__PURE__ */
|
|
2673
|
+
/* @__PURE__ */ React17.createElement(CalendarSheet, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React17.createElement(
|
|
2713
2674
|
Calendar_default,
|
|
2714
2675
|
{
|
|
2715
2676
|
value: value && !Number.isNaN(parseDate(value, format).getTime()) ? [parseDate(value, format), void 0] : void 0,
|
|
@@ -2728,14 +2689,14 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2728
2689
|
disablePast,
|
|
2729
2690
|
shouldDisableDate: shouldDisableDate ? (date) => shouldDisableDate(formatValueString(date, format)) : void 0
|
|
2730
2691
|
}
|
|
2731
|
-
), !hideClearButton && /* @__PURE__ */
|
|
2692
|
+
), !hideClearButton && /* @__PURE__ */ React17.createElement(
|
|
2732
2693
|
DialogActions_default,
|
|
2733
2694
|
{
|
|
2734
2695
|
sx: {
|
|
2735
2696
|
p: 1
|
|
2736
2697
|
}
|
|
2737
2698
|
},
|
|
2738
|
-
/* @__PURE__ */
|
|
2699
|
+
/* @__PURE__ */ React17.createElement(
|
|
2739
2700
|
Button_default,
|
|
2740
2701
|
{
|
|
2741
2702
|
size,
|
|
@@ -2761,10 +2722,10 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2761
2722
|
var DatePicker_default = DatePicker;
|
|
2762
2723
|
|
|
2763
2724
|
// src/components/Textarea/Textarea.tsx
|
|
2764
|
-
import
|
|
2725
|
+
import React18 from "react";
|
|
2765
2726
|
import { Textarea as JoyTextarea } from "@mui/joy";
|
|
2766
|
-
import { motion as
|
|
2767
|
-
var MotionTextarea =
|
|
2727
|
+
import { motion as motion18 } from "framer-motion";
|
|
2728
|
+
var MotionTextarea = motion18(JoyTextarea);
|
|
2768
2729
|
var Textarea = (props) => {
|
|
2769
2730
|
const {
|
|
2770
2731
|
label,
|
|
@@ -2781,7 +2742,7 @@ var Textarea = (props) => {
|
|
|
2781
2742
|
className,
|
|
2782
2743
|
...innerProps
|
|
2783
2744
|
} = props;
|
|
2784
|
-
const textarea = /* @__PURE__ */
|
|
2745
|
+
const textarea = /* @__PURE__ */ React18.createElement(
|
|
2785
2746
|
MotionTextarea,
|
|
2786
2747
|
{
|
|
2787
2748
|
required,
|
|
@@ -2793,7 +2754,7 @@ var Textarea = (props) => {
|
|
|
2793
2754
|
...innerProps
|
|
2794
2755
|
}
|
|
2795
2756
|
);
|
|
2796
|
-
return /* @__PURE__ */
|
|
2757
|
+
return /* @__PURE__ */ React18.createElement(
|
|
2797
2758
|
FormControl_default,
|
|
2798
2759
|
{
|
|
2799
2760
|
required,
|
|
@@ -2804,9 +2765,9 @@ var Textarea = (props) => {
|
|
|
2804
2765
|
sx,
|
|
2805
2766
|
className
|
|
2806
2767
|
},
|
|
2807
|
-
label && /* @__PURE__ */
|
|
2768
|
+
label && /* @__PURE__ */ React18.createElement(FormLabel_default, null, label),
|
|
2808
2769
|
textarea,
|
|
2809
|
-
helperText && /* @__PURE__ */
|
|
2770
|
+
helperText && /* @__PURE__ */ React18.createElement(FormHelperText_default, null, helperText)
|
|
2810
2771
|
);
|
|
2811
2772
|
};
|
|
2812
2773
|
Textarea.displayName = "Textarea";
|
|
@@ -2815,10 +2776,10 @@ Textarea.displayName = "Textarea";
|
|
|
2815
2776
|
var Textarea_default = Textarea;
|
|
2816
2777
|
|
|
2817
2778
|
// src/components/Select/Select.tsx
|
|
2818
|
-
import
|
|
2779
|
+
import React19, { useMemo as useMemo7 } from "react";
|
|
2819
2780
|
import { Select as JoySelect, Option as JoyOption, ListItemContent as ListItemContent2, Typography as Typography4 } from "@mui/joy";
|
|
2820
|
-
import { motion as
|
|
2821
|
-
var MotionOption =
|
|
2781
|
+
import { motion as motion19 } from "framer-motion";
|
|
2782
|
+
var MotionOption = motion19(JoyOption);
|
|
2822
2783
|
var Option = MotionOption;
|
|
2823
2784
|
var secondaryTextLevelMap2 = {
|
|
2824
2785
|
sm: "body-xs",
|
|
@@ -2873,7 +2834,7 @@ function Select(props) {
|
|
|
2873
2834
|
});
|
|
2874
2835
|
return map;
|
|
2875
2836
|
}, [options]);
|
|
2876
|
-
const select = /* @__PURE__ */
|
|
2837
|
+
const select = /* @__PURE__ */ React19.createElement(
|
|
2877
2838
|
JoySelect,
|
|
2878
2839
|
{
|
|
2879
2840
|
...innerProps,
|
|
@@ -2890,9 +2851,9 @@ function Select(props) {
|
|
|
2890
2851
|
return optionMap.get(selected.value)?.label;
|
|
2891
2852
|
}
|
|
2892
2853
|
},
|
|
2893
|
-
options.map((option) => /* @__PURE__ */
|
|
2854
|
+
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))
|
|
2894
2855
|
);
|
|
2895
|
-
return /* @__PURE__ */
|
|
2856
|
+
return /* @__PURE__ */ React19.createElement(
|
|
2896
2857
|
FormControl_default,
|
|
2897
2858
|
{
|
|
2898
2859
|
required,
|
|
@@ -2903,9 +2864,9 @@ function Select(props) {
|
|
|
2903
2864
|
sx,
|
|
2904
2865
|
className
|
|
2905
2866
|
},
|
|
2906
|
-
label && /* @__PURE__ */
|
|
2867
|
+
label && /* @__PURE__ */ React19.createElement(FormLabel_default, null, label),
|
|
2907
2868
|
select,
|
|
2908
|
-
helperText && /* @__PURE__ */
|
|
2869
|
+
helperText && /* @__PURE__ */ React19.createElement(FormHelperText_default, null, helperText)
|
|
2909
2870
|
);
|
|
2910
2871
|
}
|
|
2911
2872
|
Select.displayName = "Select";
|
|
@@ -2916,6 +2877,19 @@ var Select_default = Select;
|
|
|
2916
2877
|
// src/components/DataTable/components.tsx
|
|
2917
2878
|
import { Link } from "@mui/joy";
|
|
2918
2879
|
|
|
2880
|
+
// src/components/Tooltip/Tooltip.tsx
|
|
2881
|
+
import React20 from "react";
|
|
2882
|
+
import { Tooltip as JoyTooltip } from "@mui/joy";
|
|
2883
|
+
import { motion as motion20 } from "framer-motion";
|
|
2884
|
+
var MotionTooltip = motion20(JoyTooltip);
|
|
2885
|
+
var Tooltip = (props) => {
|
|
2886
|
+
return /* @__PURE__ */ React20.createElement(MotionTooltip, { ...props });
|
|
2887
|
+
};
|
|
2888
|
+
Tooltip.displayName = "Tooltip";
|
|
2889
|
+
|
|
2890
|
+
// src/components/Tooltip/index.ts
|
|
2891
|
+
var Tooltip_default = Tooltip;
|
|
2892
|
+
|
|
2919
2893
|
// src/components/InfoSign/InfoSign.tsx
|
|
2920
2894
|
import React21 from "react";
|
|
2921
2895
|
import { styled as styled11, tooltipClasses } from "@mui/joy";
|
|
@@ -2955,8 +2929,8 @@ var TextEllipsis = ({
|
|
|
2955
2929
|
lineClamp,
|
|
2956
2930
|
...rest
|
|
2957
2931
|
}) => {
|
|
2958
|
-
const textRef =
|
|
2959
|
-
const [showTooltip, setShowTooltip] =
|
|
2932
|
+
const textRef = useRef4(null);
|
|
2933
|
+
const [showTooltip, setShowTooltip] = useState7(false);
|
|
2960
2934
|
useLayoutEffect(() => {
|
|
2961
2935
|
const element = textRef.current;
|
|
2962
2936
|
if (!element) return;
|
|
@@ -2972,8 +2946,8 @@ var TextEllipsis = ({
|
|
|
2972
2946
|
return /* @__PURE__ */ React22.createElement(Tooltip_default, { title: showTooltip ? children : "", placement: "top" }, /* @__PURE__ */ React22.createElement(EllipsisDiv, { ref: textRef, lineClamp, ...rest }, children));
|
|
2973
2947
|
};
|
|
2974
2948
|
var CellTextEllipsis = ({ children }) => {
|
|
2975
|
-
const textRef =
|
|
2976
|
-
const [showTooltip, setShowTooltip] =
|
|
2949
|
+
const textRef = useRef4(null);
|
|
2950
|
+
const [showTooltip, setShowTooltip] = useState7(false);
|
|
2977
2951
|
useLayoutEffect(() => {
|
|
2978
2952
|
const element = textRef.current;
|
|
2979
2953
|
if (element) {
|
|
@@ -3027,17 +3001,17 @@ var HeadCell = (props) => {
|
|
|
3027
3001
|
const theme = useTheme();
|
|
3028
3002
|
const ref = headerRef;
|
|
3029
3003
|
const colRef = tableColRef;
|
|
3030
|
-
const localRef =
|
|
3004
|
+
const localRef = useRef4(null);
|
|
3031
3005
|
useLayoutEffect(() => {
|
|
3032
3006
|
ref.current = localRef.current;
|
|
3033
3007
|
}, [ref]);
|
|
3034
|
-
const [isHovered, setIsHovered] =
|
|
3008
|
+
const [isHovered, setIsHovered] = useState7(false);
|
|
3035
3009
|
const sortable = type === "actions" ? false : _sortable;
|
|
3036
3010
|
const headId = useMemo8(
|
|
3037
3011
|
() => `${tableId}_header_${headerName ?? field}`.trim(),
|
|
3038
3012
|
[tableId, headerName, field]
|
|
3039
3013
|
);
|
|
3040
|
-
const isResizingRef =
|
|
3014
|
+
const isResizingRef = useRef4(false);
|
|
3041
3015
|
const resizer = useMemo8(
|
|
3042
3016
|
() => resizable ?? true ? Resizer(
|
|
3043
3017
|
ref,
|
|
@@ -3121,7 +3095,7 @@ var HeadCell = (props) => {
|
|
|
3121
3095
|
ref: localRef,
|
|
3122
3096
|
key: field,
|
|
3123
3097
|
style,
|
|
3124
|
-
onClick:
|
|
3098
|
+
onClick: useCallback8(
|
|
3125
3099
|
(e) => {
|
|
3126
3100
|
if (isResizingRef.current) return;
|
|
3127
3101
|
if (!(e.target instanceof Element) || !e.currentTarget.contains(e.target)) return;
|
|
@@ -3160,8 +3134,8 @@ var BodyCell = (props) => {
|
|
|
3160
3134
|
onCellEditStop
|
|
3161
3135
|
} = props;
|
|
3162
3136
|
const theme = useTheme();
|
|
3163
|
-
const [value, setValue] =
|
|
3164
|
-
const cellRef =
|
|
3137
|
+
const [value, setValue] = useState7(row[field]);
|
|
3138
|
+
const cellRef = useRef4(null);
|
|
3165
3139
|
const params = useMemo8(
|
|
3166
3140
|
() => ({
|
|
3167
3141
|
row,
|
|
@@ -3306,7 +3280,7 @@ var BodyCell = (props) => {
|
|
|
3306
3280
|
() => (typeof cellClassName === "function" ? cellClassName(params) : cellClassName) || "",
|
|
3307
3281
|
[cellClassName, params]
|
|
3308
3282
|
);
|
|
3309
|
-
|
|
3283
|
+
useEffect4(() => {
|
|
3310
3284
|
setValue(row[field]);
|
|
3311
3285
|
}, [row, field]);
|
|
3312
3286
|
return /* @__PURE__ */ React22.createElement(
|
|
@@ -3376,10 +3350,10 @@ var VirtualizedTableRow = memo(StyledTableRow2, (prevProps, nextProps) => {
|
|
|
3376
3350
|
});
|
|
3377
3351
|
|
|
3378
3352
|
// src/components/DataTable/hooks.ts
|
|
3379
|
-
import { useState as
|
|
3353
|
+
import { useState as useState8, useLayoutEffect as useLayoutEffect2, useRef as useRef5, useMemo as useMemo9, useCallback as useCallback9, useEffect as useEffect5, createRef } from "react";
|
|
3380
3354
|
function useColumnWidths(columnsByField) {
|
|
3381
|
-
const [widths, setWidths] =
|
|
3382
|
-
const roRef =
|
|
3355
|
+
const [widths, setWidths] = useState8({});
|
|
3356
|
+
const roRef = useRef5();
|
|
3383
3357
|
useLayoutEffect2(() => {
|
|
3384
3358
|
if (roRef.current) roRef.current.disconnect();
|
|
3385
3359
|
roRef.current = new ResizeObserver((entries) => {
|
|
@@ -3437,19 +3411,19 @@ function useDataTableRenderer({
|
|
|
3437
3411
|
"You cannot use both `pinnedColumns` and `columnGroupingModel` at the same time. Please choose one of them."
|
|
3438
3412
|
);
|
|
3439
3413
|
}
|
|
3440
|
-
const onSelectionModelChangeRef =
|
|
3414
|
+
const onSelectionModelChangeRef = useRef5(onSelectionModelChange);
|
|
3441
3415
|
onSelectionModelChangeRef.current = onSelectionModelChange;
|
|
3442
|
-
const [focusedRowId, setFocusedRowId] =
|
|
3443
|
-
const [selectionAnchor, setSelectionAnchor] =
|
|
3416
|
+
const [focusedRowId, setFocusedRowId] = useState8(null);
|
|
3417
|
+
const [selectionAnchor, setSelectionAnchor] = useState8(null);
|
|
3444
3418
|
const [sortModel, setSortModel] = useControlledState(
|
|
3445
3419
|
controlledSortModel,
|
|
3446
3420
|
initialState?.sorting?.sortModel ?? [],
|
|
3447
|
-
|
|
3421
|
+
useCallback9((sortModel2) => onSortModelChange?.(sortModel2), [onSortModelChange])
|
|
3448
3422
|
);
|
|
3449
3423
|
const [visibilityModel] = useControlledState(
|
|
3450
3424
|
columnVisibilityModel,
|
|
3451
3425
|
initialState?.columns?.columnVisibilityModel ?? {},
|
|
3452
|
-
|
|
3426
|
+
useCallback9(
|
|
3453
3427
|
(model) => onColumnVisibilityModelChange?.(model),
|
|
3454
3428
|
[onColumnVisibilityModelChange]
|
|
3455
3429
|
)
|
|
@@ -3495,7 +3469,7 @@ function useDataTableRenderer({
|
|
|
3495
3469
|
),
|
|
3496
3470
|
[visibleColumns]
|
|
3497
3471
|
);
|
|
3498
|
-
const sortComparator =
|
|
3472
|
+
const sortComparator = useCallback9(
|
|
3499
3473
|
(rowA, rowB) => {
|
|
3500
3474
|
for (const sort of sortModel) {
|
|
3501
3475
|
const { field, sort: direction } = sort;
|
|
@@ -3532,9 +3506,9 @@ function useDataTableRenderer({
|
|
|
3532
3506
|
() => Array.from(new Set(_sortOrder || ["asc", "desc", null])),
|
|
3533
3507
|
[_sortOrder]
|
|
3534
3508
|
);
|
|
3535
|
-
const [page, setPage] =
|
|
3509
|
+
const [page, setPage] = useState8(paginationModel?.page || 1);
|
|
3536
3510
|
const pageSize = paginationModel?.pageSize || 20;
|
|
3537
|
-
const getId =
|
|
3511
|
+
const getId = useCallback9(
|
|
3538
3512
|
(row, index) => _getId?.(row) ?? row.id ?? `${(index || 0) + (page - 1) * pageSize}`,
|
|
3539
3513
|
[_getId, page, pageSize]
|
|
3540
3514
|
);
|
|
@@ -3550,7 +3524,7 @@ function useDataTableRenderer({
|
|
|
3550
3524
|
}),
|
|
3551
3525
|
[dataInPage, isRowSelectable, getId]
|
|
3552
3526
|
);
|
|
3553
|
-
const handleRangeSelection =
|
|
3527
|
+
const handleRangeSelection = useCallback9(
|
|
3554
3528
|
(anchor, targetIndex) => {
|
|
3555
3529
|
const startIndex = Math.min(anchor.rowIndex, targetIndex);
|
|
3556
3530
|
const endIndex = Math.max(anchor.rowIndex, targetIndex);
|
|
@@ -3587,7 +3561,7 @@ function useDataTableRenderer({
|
|
|
3587
3561
|
[_isTotalSelected, selectionModel, selectableRowCount]
|
|
3588
3562
|
);
|
|
3589
3563
|
const columnWidths = useColumnWidths(visibleColumnsByField);
|
|
3590
|
-
const getWidth =
|
|
3564
|
+
const getWidth = useCallback9(
|
|
3591
3565
|
(f) => columnWidths[f] ?? allColumnsByField[f]?.width ?? // Column prop 으로 지정된 width
|
|
3592
3566
|
allColumnsByField[f]?.minWidth ?? 0,
|
|
3593
3567
|
[columnWidths, allColumnsByField]
|
|
@@ -3639,14 +3613,14 @@ function useDataTableRenderer({
|
|
|
3639
3613
|
sortOrder,
|
|
3640
3614
|
getWidth
|
|
3641
3615
|
]);
|
|
3642
|
-
const handlePageChange =
|
|
3616
|
+
const handlePageChange = useCallback9(
|
|
3643
3617
|
(newPage) => {
|
|
3644
3618
|
setPage(newPage);
|
|
3645
3619
|
onPaginationModelChange?.({ page: newPage, pageSize });
|
|
3646
3620
|
},
|
|
3647
3621
|
[onPaginationModelChange, pageSize]
|
|
3648
3622
|
);
|
|
3649
|
-
const handleSortChange =
|
|
3623
|
+
const handleSortChange = useCallback9(
|
|
3650
3624
|
(props) => {
|
|
3651
3625
|
const { field, currentSort, multiple } = props;
|
|
3652
3626
|
const column = allColumnsByField[field];
|
|
@@ -3669,29 +3643,29 @@ function useDataTableRenderer({
|
|
|
3669
3643
|
},
|
|
3670
3644
|
[sortOrder, allColumnsByField, sortModel, setSortModel]
|
|
3671
3645
|
);
|
|
3672
|
-
|
|
3646
|
+
useEffect5(() => {
|
|
3673
3647
|
if (!paginationModel) {
|
|
3674
3648
|
handlePageChange(1);
|
|
3675
3649
|
}
|
|
3676
3650
|
}, [rowCount, handlePageChange, paginationModel]);
|
|
3677
|
-
|
|
3651
|
+
useEffect5(() => {
|
|
3678
3652
|
const lastPage = Math.max(1, Math.ceil(rowCount / pageSize));
|
|
3679
3653
|
if (page > lastPage) {
|
|
3680
3654
|
handlePageChange(lastPage);
|
|
3681
3655
|
}
|
|
3682
3656
|
}, [page, rowCount, pageSize, handlePageChange]);
|
|
3683
|
-
|
|
3657
|
+
useEffect5(() => {
|
|
3684
3658
|
onSelectionModelChangeRef.current?.([]);
|
|
3685
3659
|
setSelectionAnchor(null);
|
|
3686
3660
|
}, [page]);
|
|
3687
|
-
const prevRowsRef =
|
|
3688
|
-
|
|
3661
|
+
const prevRowsRef = useRef5(_rows);
|
|
3662
|
+
useEffect5(() => {
|
|
3689
3663
|
if (prevRowsRef.current !== _rows) {
|
|
3690
3664
|
setSelectionAnchor(null);
|
|
3691
3665
|
prevRowsRef.current = _rows;
|
|
3692
3666
|
}
|
|
3693
3667
|
}, [_rows]);
|
|
3694
|
-
const handleAutoFit =
|
|
3668
|
+
const handleAutoFit = useCallback9(
|
|
3695
3669
|
(field) => {
|
|
3696
3670
|
const colDef = visibleColumnsByField[field];
|
|
3697
3671
|
if (!colDef?.headerRef.current) return;
|
|
@@ -3724,8 +3698,8 @@ function useDataTableRenderer({
|
|
|
3724
3698
|
handleAutoFit,
|
|
3725
3699
|
isAllSelected,
|
|
3726
3700
|
isTotalSelected,
|
|
3727
|
-
isSelectedRow:
|
|
3728
|
-
isRowSelectable:
|
|
3701
|
+
isSelectedRow: useCallback9((model) => selectedModelSet.has(model), [selectedModelSet]),
|
|
3702
|
+
isRowSelectable: useCallback9(
|
|
3729
3703
|
(rowId, row) => {
|
|
3730
3704
|
if (!isRowSelectable) return true;
|
|
3731
3705
|
return isRowSelectable({ row, id: rowId });
|
|
@@ -3733,13 +3707,13 @@ function useDataTableRenderer({
|
|
|
3733
3707
|
[isRowSelectable]
|
|
3734
3708
|
),
|
|
3735
3709
|
focusedRowId,
|
|
3736
|
-
onRowFocus:
|
|
3710
|
+
onRowFocus: useCallback9((rowId) => {
|
|
3737
3711
|
setFocusedRowId(rowId);
|
|
3738
3712
|
}, []),
|
|
3739
|
-
onAllCheckboxChange:
|
|
3713
|
+
onAllCheckboxChange: useCallback9(() => {
|
|
3740
3714
|
onSelectionModelChange?.(isAllSelected ? [] : selectableDataInPage.map(getId));
|
|
3741
3715
|
}, [isAllSelected, selectableDataInPage, onSelectionModelChange, getId]),
|
|
3742
|
-
onCheckboxChange:
|
|
3716
|
+
onCheckboxChange: useCallback9(
|
|
3743
3717
|
(event, selectedModel) => {
|
|
3744
3718
|
const isShiftClick = "shiftKey" in event && event.shiftKey;
|
|
3745
3719
|
const rowIndex = dataInPage.findIndex((row, i) => getId(row, i) === selectedModel);
|
|
@@ -3773,7 +3747,7 @@ function useDataTableRenderer({
|
|
|
3773
3747
|
columns,
|
|
3774
3748
|
tableMinWidth,
|
|
3775
3749
|
processedColumnGroups,
|
|
3776
|
-
onTotalSelect:
|
|
3750
|
+
onTotalSelect: useCallback9(() => {
|
|
3777
3751
|
const selectableRows = rows.filter((row, i) => {
|
|
3778
3752
|
if (!isRowSelectable) return true;
|
|
3779
3753
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
@@ -3858,7 +3832,7 @@ function TableBody(props) {
|
|
|
3858
3832
|
TableBody.displayName = "TableBody";
|
|
3859
3833
|
|
|
3860
3834
|
// src/components/Pagination/Pagination.tsx
|
|
3861
|
-
import React24, { useCallback as
|
|
3835
|
+
import React24, { useCallback as useCallback10, useEffect as useEffect6 } from "react";
|
|
3862
3836
|
import PreviousIcon from "@mui/icons-material/ChevronLeftRounded";
|
|
3863
3837
|
import NextIcon from "@mui/icons-material/ChevronRightRounded";
|
|
3864
3838
|
import FirstPageIcon from "@mui/icons-material/FirstPageRounded";
|
|
@@ -3927,7 +3901,7 @@ function Pagination(props) {
|
|
|
3927
3901
|
const [paginationModel, setPaginationModel] = useControlledState(
|
|
3928
3902
|
_paginationModel,
|
|
3929
3903
|
defaultPaginationModel,
|
|
3930
|
-
|
|
3904
|
+
useCallback10(
|
|
3931
3905
|
(newPage) => {
|
|
3932
3906
|
onPageChange(newPage.page);
|
|
3933
3907
|
},
|
|
@@ -3943,7 +3917,7 @@ function Pagination(props) {
|
|
|
3943
3917
|
const afterPages = [paginationModel.page + 1, paginationModel.page + 2].filter((p) => p <= lastPage - 1);
|
|
3944
3918
|
const isMoreAfterPages = lastPage > 1 && paginationModel.page < lastPage - 3;
|
|
3945
3919
|
const isMoreBeforePages = lastPage > 1 && paginationModel.page > 4;
|
|
3946
|
-
|
|
3920
|
+
useEffect6(() => {
|
|
3947
3921
|
if (paginationModel.page > lastPage) {
|
|
3948
3922
|
setPaginationModel({ ...paginationModel, page: lastPage });
|
|
3949
3923
|
}
|
|
@@ -4136,8 +4110,8 @@ function Component(props, apiRef) {
|
|
|
4136
4110
|
...innerProps
|
|
4137
4111
|
} = props;
|
|
4138
4112
|
const tableId = useId();
|
|
4139
|
-
const parentRef =
|
|
4140
|
-
const tableBodyRef =
|
|
4113
|
+
const parentRef = useRef6(null);
|
|
4114
|
+
const tableBodyRef = useRef6(null);
|
|
4141
4115
|
const {
|
|
4142
4116
|
columns,
|
|
4143
4117
|
processedColumnGroups,
|
|
@@ -4178,20 +4152,20 @@ function Component(props, apiRef) {
|
|
|
4178
4152
|
const virtualizedItems = virtualizer.getVirtualItems();
|
|
4179
4153
|
const showNoRowsOverlay = !loading && rowCount === 0;
|
|
4180
4154
|
const totalColCount = Math.max(1, columns.length + (checkboxSelection ? 1 : 0));
|
|
4181
|
-
const getRowClickHandler =
|
|
4155
|
+
const getRowClickHandler = useCallback11(
|
|
4182
4156
|
(row, rowId) => (e) => {
|
|
4183
4157
|
onRowClick?.({ row, rowId }, e);
|
|
4184
4158
|
checkboxSelection && !disableSelectionOnClick && isRowSelectableCheck(rowId, row) && onCheckboxChange(e, rowId);
|
|
4185
4159
|
},
|
|
4186
4160
|
[onRowClick, checkboxSelection, disableSelectionOnClick, onCheckboxChange, isRowSelectableCheck]
|
|
4187
4161
|
);
|
|
4188
|
-
const getRowFocusHandler =
|
|
4162
|
+
const getRowFocusHandler = useCallback11(
|
|
4189
4163
|
(rowId) => () => {
|
|
4190
4164
|
onRowFocus(rowId);
|
|
4191
4165
|
},
|
|
4192
4166
|
[onRowFocus]
|
|
4193
4167
|
);
|
|
4194
|
-
const getCheckboxClickHandler =
|
|
4168
|
+
const getCheckboxClickHandler = useCallback11(
|
|
4195
4169
|
(rowId, row) => (e) => {
|
|
4196
4170
|
e.stopPropagation();
|
|
4197
4171
|
if (isRowSelectableCheck(rowId, row)) {
|
|
@@ -4201,7 +4175,7 @@ function Component(props, apiRef) {
|
|
|
4201
4175
|
},
|
|
4202
4176
|
[onCheckboxChange, isRowSelectableCheck, onRowFocus]
|
|
4203
4177
|
);
|
|
4204
|
-
const handleTableKeyDown =
|
|
4178
|
+
const handleTableKeyDown = useCallback11(
|
|
4205
4179
|
(e) => {
|
|
4206
4180
|
const supportedKeys = ["ArrowUp", "ArrowDown", " ", "Home", "End", "PageUp", "PageDown"];
|
|
4207
4181
|
if (!supportedKeys.includes(e.key)) return;
|
|
@@ -4557,7 +4531,7 @@ var DataTable = forwardRef7(Component);
|
|
|
4557
4531
|
DataTable.displayName = "DataTable";
|
|
4558
4532
|
|
|
4559
4533
|
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
4560
|
-
import React26, { forwardRef as forwardRef8, useCallback as
|
|
4534
|
+
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";
|
|
4561
4535
|
import { IMaskInput as IMaskInput2, IMask as IMask2 } from "react-imask";
|
|
4562
4536
|
import CalendarTodayIcon2 from "@mui/icons-material/CalendarToday";
|
|
4563
4537
|
import { styled as styled14, useThemeProps as useThemeProps5 } from "@mui/joy";
|
|
@@ -4718,23 +4692,23 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4718
4692
|
readOnly,
|
|
4719
4693
|
...innerProps
|
|
4720
4694
|
} = props;
|
|
4721
|
-
const innerRef =
|
|
4722
|
-
const buttonRef =
|
|
4695
|
+
const innerRef = useRef7(null);
|
|
4696
|
+
const buttonRef = useRef7(null);
|
|
4723
4697
|
const [value, setValue] = useControlledState(
|
|
4724
4698
|
props.value,
|
|
4725
4699
|
props.defaultValue || "",
|
|
4726
|
-
|
|
4700
|
+
useCallback12((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
4727
4701
|
);
|
|
4728
|
-
const [displayValue, setDisplayValue] =
|
|
4702
|
+
const [displayValue, setDisplayValue] = useState9(
|
|
4729
4703
|
() => value ? formatValueString2(parseDates(value, format), displayFormat) : ""
|
|
4730
4704
|
);
|
|
4731
|
-
const [anchorEl, setAnchorEl] =
|
|
4705
|
+
const [anchorEl, setAnchorEl] = useState9(null);
|
|
4732
4706
|
const open = Boolean(anchorEl);
|
|
4733
4707
|
const calendarValue = useMemo11(
|
|
4734
4708
|
() => value ? parseDates(value, format) : void 0,
|
|
4735
4709
|
[value, format]
|
|
4736
4710
|
);
|
|
4737
|
-
|
|
4711
|
+
useEffect7(() => {
|
|
4738
4712
|
if (value) {
|
|
4739
4713
|
try {
|
|
4740
4714
|
const dates = parseDates(value, format);
|
|
@@ -4746,13 +4720,13 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4746
4720
|
setDisplayValue("");
|
|
4747
4721
|
}
|
|
4748
4722
|
}, [displayFormat, value, format]);
|
|
4749
|
-
|
|
4723
|
+
useEffect7(() => {
|
|
4750
4724
|
if (!anchorEl) {
|
|
4751
4725
|
innerRef.current?.blur();
|
|
4752
4726
|
}
|
|
4753
4727
|
}, [anchorEl, innerRef]);
|
|
4754
4728
|
useImperativeHandle3(ref, () => innerRef.current, [innerRef]);
|
|
4755
|
-
const handleChange =
|
|
4729
|
+
const handleChange = useCallback12(
|
|
4756
4730
|
(event) => {
|
|
4757
4731
|
const value2 = event.target.value;
|
|
4758
4732
|
setDisplayValue(value2 ? formatValueString2(parseDates(value2, format), displayFormat) : value2);
|
|
@@ -4760,7 +4734,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4760
4734
|
},
|
|
4761
4735
|
[displayFormat, format, setValue]
|
|
4762
4736
|
);
|
|
4763
|
-
const handleDisplayInputChange =
|
|
4737
|
+
const handleDisplayInputChange = useCallback12(
|
|
4764
4738
|
(event) => {
|
|
4765
4739
|
if (event.target.value === "") {
|
|
4766
4740
|
handleChange({
|
|
@@ -4785,14 +4759,14 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4785
4759
|
},
|
|
4786
4760
|
[displayFormat, format, handleChange, props.name]
|
|
4787
4761
|
);
|
|
4788
|
-
const handleCalendarToggle =
|
|
4762
|
+
const handleCalendarToggle = useCallback12(
|
|
4789
4763
|
(event) => {
|
|
4790
4764
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4791
4765
|
innerRef.current?.focus();
|
|
4792
4766
|
},
|
|
4793
4767
|
[anchorEl, setAnchorEl, innerRef]
|
|
4794
4768
|
);
|
|
4795
|
-
const handleCalendarChange =
|
|
4769
|
+
const handleCalendarChange = useCallback12(
|
|
4796
4770
|
([date1, date2]) => {
|
|
4797
4771
|
if (!date1 || !date2) return;
|
|
4798
4772
|
const formattedValue = formatValueString2([date1, date2], format);
|
|
@@ -4806,7 +4780,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
4806
4780
|
},
|
|
4807
4781
|
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat]
|
|
4808
4782
|
);
|
|
4809
|
-
const handleInputMouseDown =
|
|
4783
|
+
const handleInputMouseDown = useCallback12(
|
|
4810
4784
|
(event) => {
|
|
4811
4785
|
if (inputReadOnly) {
|
|
4812
4786
|
event.preventDefault();
|
|
@@ -5038,13 +5012,13 @@ var InsetDrawer = styled20(JoyDrawer2)(({ theme }) => ({
|
|
|
5038
5012
|
}));
|
|
5039
5013
|
|
|
5040
5014
|
// src/components/FilterableCheckboxGroup/FilterableCheckboxGroup.tsx
|
|
5041
|
-
import React31, { useCallback as
|
|
5015
|
+
import React31, { useCallback as useCallback13, useEffect as useEffect8, useMemo as useMemo12, useRef as useRef8, useState as useState10 } from "react";
|
|
5042
5016
|
import SearchIcon from "@mui/icons-material/Search";
|
|
5043
5017
|
import { useVirtualizer as useVirtualizer3 } from "@tanstack/react-virtual";
|
|
5044
5018
|
function LabelWithTooltip(props) {
|
|
5045
5019
|
const { label, size } = props;
|
|
5046
|
-
const labelContentRef =
|
|
5047
|
-
const [isOverflowing, setIsOverflowing] =
|
|
5020
|
+
const labelContentRef = useRef8(null);
|
|
5021
|
+
const [isOverflowing, setIsOverflowing] = useState10(false);
|
|
5048
5022
|
const labelContent = /* @__PURE__ */ React31.createElement(
|
|
5049
5023
|
"span",
|
|
5050
5024
|
{
|
|
@@ -5061,7 +5035,7 @@ function LabelWithTooltip(props) {
|
|
|
5061
5035
|
},
|
|
5062
5036
|
label
|
|
5063
5037
|
);
|
|
5064
|
-
|
|
5038
|
+
useEffect8(() => {
|
|
5065
5039
|
const element = labelContentRef.current;
|
|
5066
5040
|
if (element) {
|
|
5067
5041
|
setIsOverflowing(element.scrollWidth > element.clientWidth);
|
|
@@ -5085,16 +5059,16 @@ function FilterableCheckboxGroup(props) {
|
|
|
5085
5059
|
maxHeight = 300,
|
|
5086
5060
|
disabled
|
|
5087
5061
|
} = props;
|
|
5088
|
-
const [searchTerm, setSearchTerm] =
|
|
5089
|
-
const [sortedOptions, setSortedOptions] =
|
|
5062
|
+
const [searchTerm, setSearchTerm] = useState10("");
|
|
5063
|
+
const [sortedOptions, setSortedOptions] = useState10(options);
|
|
5090
5064
|
const [internalValue, setInternalValue] = useControlledState(
|
|
5091
5065
|
value,
|
|
5092
5066
|
value ?? [],
|
|
5093
|
-
|
|
5067
|
+
useCallback13((newValue) => onChange?.(newValue), [onChange])
|
|
5094
5068
|
);
|
|
5095
|
-
const parentRef =
|
|
5096
|
-
const isInitialSortRef =
|
|
5097
|
-
const prevOptionsRef =
|
|
5069
|
+
const parentRef = useRef8(null);
|
|
5070
|
+
const isInitialSortRef = useRef8(false);
|
|
5071
|
+
const prevOptionsRef = useRef8([...options]);
|
|
5098
5072
|
const filteredOptions = useMemo12(() => {
|
|
5099
5073
|
if (!searchTerm) return sortedOptions;
|
|
5100
5074
|
return sortedOptions.filter((option) => option.label.toLowerCase().includes(searchTerm.toLowerCase()));
|
|
@@ -5117,7 +5091,7 @@ function FilterableCheckboxGroup(props) {
|
|
|
5117
5091
|
overscan: 5
|
|
5118
5092
|
});
|
|
5119
5093
|
const items = virtualizer.getVirtualItems();
|
|
5120
|
-
|
|
5094
|
+
useEffect8(() => {
|
|
5121
5095
|
const optionsChanged = prevOptionsRef.current.length !== options.length || prevOptionsRef.current.some(
|
|
5122
5096
|
(prevOption, index) => prevOption.value !== options[index]?.value || prevOption.label !== options[index]?.label || prevOption.disabled !== options[index]?.disabled
|
|
5123
5097
|
);
|
|
@@ -5143,13 +5117,13 @@ function FilterableCheckboxGroup(props) {
|
|
|
5143
5117
|
}
|
|
5144
5118
|
}
|
|
5145
5119
|
}, [options, value]);
|
|
5146
|
-
|
|
5120
|
+
useEffect8(() => {
|
|
5147
5121
|
virtualizer.measure();
|
|
5148
5122
|
}, [virtualizer, filteredOptions, size]);
|
|
5149
|
-
const handleSearchChange =
|
|
5123
|
+
const handleSearchChange = useCallback13((event) => {
|
|
5150
5124
|
setSearchTerm(event.target.value);
|
|
5151
5125
|
}, []);
|
|
5152
|
-
const handleCheckboxChange =
|
|
5126
|
+
const handleCheckboxChange = useCallback13(
|
|
5153
5127
|
(optionValue) => (event) => {
|
|
5154
5128
|
const checked = event.target.checked;
|
|
5155
5129
|
const newValue = checked ? [...internalValue, optionValue] : internalValue.filter((v) => v !== optionValue);
|
|
@@ -5157,7 +5131,7 @@ function FilterableCheckboxGroup(props) {
|
|
|
5157
5131
|
},
|
|
5158
5132
|
[internalValue, setInternalValue]
|
|
5159
5133
|
);
|
|
5160
|
-
const handleSelectAll =
|
|
5134
|
+
const handleSelectAll = useCallback13(
|
|
5161
5135
|
(event) => {
|
|
5162
5136
|
const checked = event.target.checked;
|
|
5163
5137
|
const enabledOptions = filteredOptions.filter((option) => !option.disabled);
|
|
@@ -5314,16 +5288,16 @@ function IconMenuButton(props) {
|
|
|
5314
5288
|
IconMenuButton.displayName = "IconMenuButton";
|
|
5315
5289
|
|
|
5316
5290
|
// src/components/Markdown/Markdown.tsx
|
|
5317
|
-
import React33, { lazy, Suspense, useEffect as
|
|
5291
|
+
import React33, { lazy, Suspense, useEffect as useEffect9, useState as useState11 } from "react";
|
|
5318
5292
|
import { Skeleton } from "@mui/joy";
|
|
5319
5293
|
import { Link as Link2 } from "@mui/joy";
|
|
5320
5294
|
import remarkGfm from "remark-gfm";
|
|
5321
5295
|
var LazyReactMarkdown = lazy(() => import("react-markdown"));
|
|
5322
5296
|
var Markdown = (props) => {
|
|
5323
|
-
const [
|
|
5324
|
-
|
|
5297
|
+
const [rehypeAccent2, setRehypeAccent] = useState11(null);
|
|
5298
|
+
useEffect9(() => {
|
|
5325
5299
|
const loadRehypeAccent = async () => {
|
|
5326
|
-
const module = await
|
|
5300
|
+
const module = await Promise.resolve().then(() => (init_rehype_accent(), rehype_accent_exports));
|
|
5327
5301
|
setRehypeAccent(() => module.rehypeAccent);
|
|
5328
5302
|
};
|
|
5329
5303
|
loadRehypeAccent();
|
|
@@ -5340,7 +5314,7 @@ var Markdown = (props) => {
|
|
|
5340
5314
|
fallback,
|
|
5341
5315
|
...innerProps
|
|
5342
5316
|
} = props;
|
|
5343
|
-
if (!
|
|
5317
|
+
if (!rehypeAccent2) {
|
|
5344
5318
|
return null;
|
|
5345
5319
|
}
|
|
5346
5320
|
return /* @__PURE__ */ React33.createElement(Typography, { component: "div", color, textColor, level: defaultLevel, ...innerProps }, /* @__PURE__ */ React33.createElement(
|
|
@@ -5353,7 +5327,7 @@ var Markdown = (props) => {
|
|
|
5353
5327
|
{
|
|
5354
5328
|
...markdownOptions,
|
|
5355
5329
|
children: content,
|
|
5356
|
-
rehypePlugins: [[
|
|
5330
|
+
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
5357
5331
|
remarkPlugins: [remarkGfm],
|
|
5358
5332
|
components: {
|
|
5359
5333
|
a: ({ children, href }) => /* @__PURE__ */ React33.createElement(Link2, { href, target: defaultLinkAction }, children),
|
|
@@ -5495,7 +5469,7 @@ function MenuButton(props) {
|
|
|
5495
5469
|
MenuButton.displayName = "MenuButton";
|
|
5496
5470
|
|
|
5497
5471
|
// src/components/MonthPicker/MonthPicker.tsx
|
|
5498
|
-
import React35, { forwardRef as forwardRef9, useCallback as
|
|
5472
|
+
import React35, { forwardRef as forwardRef9, useCallback as useCallback14, useEffect as useEffect10, useImperativeHandle as useImperativeHandle4, useRef as useRef9, useState as useState12 } from "react";
|
|
5499
5473
|
import CalendarTodayIcon3 from "@mui/icons-material/CalendarToday";
|
|
5500
5474
|
import { styled as styled21, useThemeProps as useThemeProps6 } from "@mui/joy";
|
|
5501
5475
|
import { FocusTrap as FocusTrap3, ClickAwayListener as ClickAwayListener3, Popper as Popper4 } from "@mui/base";
|
|
@@ -5577,14 +5551,14 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
5577
5551
|
locale,
|
|
5578
5552
|
...innerProps
|
|
5579
5553
|
} = props;
|
|
5580
|
-
const innerRef =
|
|
5581
|
-
const buttonRef =
|
|
5554
|
+
const innerRef = useRef9(null);
|
|
5555
|
+
const buttonRef = useRef9(null);
|
|
5582
5556
|
const [value, setValue, isControlled] = useControlledState(
|
|
5583
5557
|
props.value,
|
|
5584
5558
|
props.defaultValue || "",
|
|
5585
|
-
|
|
5559
|
+
useCallback14((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
5586
5560
|
);
|
|
5587
|
-
const getFormattedDisplayValue =
|
|
5561
|
+
const getFormattedDisplayValue = useCallback14(
|
|
5588
5562
|
(inputValue) => {
|
|
5589
5563
|
if (!inputValue) return "";
|
|
5590
5564
|
try {
|
|
@@ -5595,19 +5569,19 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
5595
5569
|
},
|
|
5596
5570
|
[format, displayFormat, locale]
|
|
5597
5571
|
);
|
|
5598
|
-
const [displayValue, setDisplayValue] =
|
|
5599
|
-
const [anchorEl, setAnchorEl] =
|
|
5572
|
+
const [displayValue, setDisplayValue] = useState12(() => getFormattedDisplayValue(value));
|
|
5573
|
+
const [anchorEl, setAnchorEl] = useState12(null);
|
|
5600
5574
|
const open = Boolean(anchorEl);
|
|
5601
|
-
|
|
5575
|
+
useEffect10(() => {
|
|
5602
5576
|
if (!anchorEl) {
|
|
5603
5577
|
innerRef.current?.blur();
|
|
5604
5578
|
}
|
|
5605
5579
|
}, [anchorEl, innerRef]);
|
|
5606
5580
|
useImperativeHandle4(ref, () => innerRef.current, [innerRef]);
|
|
5607
|
-
|
|
5581
|
+
useEffect10(() => {
|
|
5608
5582
|
setDisplayValue(getFormattedDisplayValue(value));
|
|
5609
5583
|
}, [value, getFormattedDisplayValue]);
|
|
5610
|
-
const handleChange =
|
|
5584
|
+
const handleChange = useCallback14(
|
|
5611
5585
|
(event) => {
|
|
5612
5586
|
const newValue = event.target.value;
|
|
5613
5587
|
setValue(newValue);
|
|
@@ -5617,14 +5591,14 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
5617
5591
|
},
|
|
5618
5592
|
[setValue, getFormattedDisplayValue, isControlled]
|
|
5619
5593
|
);
|
|
5620
|
-
const handleCalendarToggle =
|
|
5594
|
+
const handleCalendarToggle = useCallback14(
|
|
5621
5595
|
(event) => {
|
|
5622
5596
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
5623
5597
|
innerRef.current?.focus();
|
|
5624
5598
|
},
|
|
5625
5599
|
[anchorEl, setAnchorEl, innerRef]
|
|
5626
5600
|
);
|
|
5627
|
-
const handleInputMouseDown =
|
|
5601
|
+
const handleInputMouseDown = useCallback14(
|
|
5628
5602
|
(event) => {
|
|
5629
5603
|
event.preventDefault();
|
|
5630
5604
|
buttonRef.current?.focus();
|
|
@@ -5748,7 +5722,7 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
5748
5722
|
});
|
|
5749
5723
|
|
|
5750
5724
|
// src/components/MonthRangePicker/MonthRangePicker.tsx
|
|
5751
|
-
import React36, { forwardRef as forwardRef10, useCallback as
|
|
5725
|
+
import React36, { forwardRef as forwardRef10, useCallback as useCallback15, useEffect as useEffect11, useImperativeHandle as useImperativeHandle5, useMemo as useMemo13, useRef as useRef10, useState as useState13 } from "react";
|
|
5752
5726
|
import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
|
|
5753
5727
|
import CalendarTodayIcon4 from "@mui/icons-material/CalendarToday";
|
|
5754
5728
|
import { styled as styled22, useThemeProps as useThemeProps7 } from "@mui/joy";
|
|
@@ -5856,35 +5830,35 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
5856
5830
|
size,
|
|
5857
5831
|
...innerProps
|
|
5858
5832
|
} = props;
|
|
5859
|
-
const innerRef =
|
|
5833
|
+
const innerRef = useRef10(null);
|
|
5860
5834
|
const [value, setValue] = useControlledState(
|
|
5861
5835
|
props.value,
|
|
5862
5836
|
props.defaultValue || "",
|
|
5863
|
-
|
|
5837
|
+
useCallback15((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
5864
5838
|
);
|
|
5865
|
-
const [anchorEl, setAnchorEl] =
|
|
5839
|
+
const [anchorEl, setAnchorEl] = useState13(null);
|
|
5866
5840
|
const open = Boolean(anchorEl);
|
|
5867
5841
|
const calendarValue = useMemo13(() => value ? parseDates2(value) : void 0, [value]);
|
|
5868
|
-
|
|
5842
|
+
useEffect11(() => {
|
|
5869
5843
|
if (!anchorEl) {
|
|
5870
5844
|
innerRef.current?.blur();
|
|
5871
5845
|
}
|
|
5872
5846
|
}, [anchorEl, innerRef]);
|
|
5873
5847
|
useImperativeHandle5(ref, () => innerRef.current, [innerRef]);
|
|
5874
|
-
const handleChange =
|
|
5848
|
+
const handleChange = useCallback15(
|
|
5875
5849
|
(event) => {
|
|
5876
5850
|
setValue(event.target.value);
|
|
5877
5851
|
},
|
|
5878
5852
|
[setValue]
|
|
5879
5853
|
);
|
|
5880
|
-
const handleCalendarToggle =
|
|
5854
|
+
const handleCalendarToggle = useCallback15(
|
|
5881
5855
|
(event) => {
|
|
5882
5856
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
5883
5857
|
innerRef.current?.focus();
|
|
5884
5858
|
},
|
|
5885
5859
|
[anchorEl, setAnchorEl, innerRef]
|
|
5886
5860
|
);
|
|
5887
|
-
const handleCalendarChange =
|
|
5861
|
+
const handleCalendarChange = useCallback15(
|
|
5888
5862
|
([date1, date2]) => {
|
|
5889
5863
|
if (!date1 || !date2) return;
|
|
5890
5864
|
setValue(formatValueString4([date1, date2], format));
|
|
@@ -6111,7 +6085,7 @@ function Navigator(props) {
|
|
|
6111
6085
|
Navigator.displayName = "Navigator";
|
|
6112
6086
|
|
|
6113
6087
|
// src/components/PercentageInput/PercentageInput.tsx
|
|
6114
|
-
import React40, { useCallback as
|
|
6088
|
+
import React40, { useCallback as useCallback16, useMemo as useMemo14, useState as useState14 } from "react";
|
|
6115
6089
|
import { NumericFormat as NumericFormat2 } from "react-number-format";
|
|
6116
6090
|
import { styled as styled25, useThemeProps as useThemeProps8 } from "@mui/joy";
|
|
6117
6091
|
var padDecimal = (value, decimalScale) => {
|
|
@@ -6168,9 +6142,9 @@ var PercentageInput = React40.forwardRef(
|
|
|
6168
6142
|
const [_value, setValue] = useControlledState(
|
|
6169
6143
|
props.value,
|
|
6170
6144
|
props.defaultValue,
|
|
6171
|
-
|
|
6145
|
+
useCallback16((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
6172
6146
|
);
|
|
6173
|
-
const [internalError, setInternalError] =
|
|
6147
|
+
const [internalError, setInternalError] = useState14(
|
|
6174
6148
|
max && _value && _value > max || min && _value && _value < min
|
|
6175
6149
|
);
|
|
6176
6150
|
const value = useMemo14(() => {
|
|
@@ -6179,7 +6153,7 @@ var PercentageInput = React40.forwardRef(
|
|
|
6179
6153
|
}
|
|
6180
6154
|
return _value;
|
|
6181
6155
|
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
6182
|
-
const handleChange =
|
|
6156
|
+
const handleChange = useCallback16(
|
|
6183
6157
|
(event) => {
|
|
6184
6158
|
if (event.target.value === "") {
|
|
6185
6159
|
setValue(void 0);
|
|
@@ -6236,176 +6210,95 @@ var MotionRadioGroup = motion26(JoyRadioGroup);
|
|
|
6236
6210
|
var RadioGroup = MotionRadioGroup;
|
|
6237
6211
|
RadioGroup.displayName = "RadioGroup";
|
|
6238
6212
|
|
|
6239
|
-
// src/components/
|
|
6213
|
+
// src/components/RadioList/RadioList.tsx
|
|
6240
6214
|
import React41 from "react";
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
[
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
},
|
|
6267
|
-
[`&.${radioClasses.disabled}`]: {
|
|
6268
|
-
[`& .${radioClasses.action}`]: {
|
|
6269
|
-
borderColor: theme.palette.neutral.outlinedBorder
|
|
6270
|
-
}
|
|
6271
|
-
}
|
|
6272
|
-
}
|
|
6273
|
-
}
|
|
6274
|
-
}));
|
|
6275
|
-
var RadioTileSheet = styled26(Sheet, {
|
|
6276
|
-
name: "RadioTileGroup",
|
|
6277
|
-
slot: "tile",
|
|
6278
|
-
shouldForwardProp: (prop) => prop !== "disabled" && prop !== "size" && prop !== "flex" && prop !== "textAlign"
|
|
6279
|
-
})(({
|
|
6280
|
-
theme,
|
|
6281
|
-
disabled,
|
|
6282
|
-
size = "sm",
|
|
6283
|
-
flex,
|
|
6284
|
-
textAlign
|
|
6285
|
-
}) => {
|
|
6286
|
-
const px = { sm: theme.spacing(3), md: theme.spacing(3), lg: theme.spacing(4) }[size];
|
|
6287
|
-
const py = { sm: theme.spacing(3), md: theme.spacing(4), lg: theme.spacing(4) }[size];
|
|
6288
|
-
return {
|
|
6289
|
-
borderRadius: theme.radius.md,
|
|
6290
|
-
display: "flex",
|
|
6291
|
-
gap: { sm: theme.spacing(2), md: theme.spacing(3), lg: theme.spacing(4) }[size],
|
|
6292
|
-
padding: `${py} ${px}`,
|
|
6293
|
-
// NOTE: Radio에도 Label과의 정렬을 맞추기 위해 중복 코드가 있지만 Icon과 RadioButton 의 정렬도 일치시켜야 해서 코드가 중복으로 존재할수밖에 없다.
|
|
6294
|
-
flexDirection: textAlign === "start" ? "row-reverse" : "column-reverse",
|
|
6295
|
-
justifyContent: textAlign === "start" ? "space-between" : "center",
|
|
6296
|
-
alignItems: "center",
|
|
6297
|
-
...flex ? { flex: 1 } : {},
|
|
6298
|
-
...disabled ? { borderColor: theme.palette.neutral.outlinedDisabledBorder } : {
|
|
6299
|
-
":hover": {
|
|
6300
|
-
backgroundColor: theme.palette.neutral.outlinedHoverBg
|
|
6301
|
-
},
|
|
6302
|
-
":active": {
|
|
6303
|
-
backgroundColor: theme.palette.neutral.outlinedActiveBg
|
|
6304
|
-
}
|
|
6215
|
+
function RadioList(props) {
|
|
6216
|
+
const { items, ...innerProps } = props;
|
|
6217
|
+
return /* @__PURE__ */ React41.createElement(RadioGroup, { ...innerProps }, items.map((item) => /* @__PURE__ */ React41.createElement(Radio, { key: `${item.value}`, value: item.value, label: item.label })));
|
|
6218
|
+
}
|
|
6219
|
+
RadioList.displayName = "RadioList";
|
|
6220
|
+
|
|
6221
|
+
// src/components/SearchBar/SearchBar.tsx
|
|
6222
|
+
import React42, { useState as useState15 } from "react";
|
|
6223
|
+
import SearchRoundedIcon from "@mui/icons-material/SearchRounded";
|
|
6224
|
+
import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
|
|
6225
|
+
function SearchBar(props) {
|
|
6226
|
+
const { hideSelect = false, options, value, onChange, onSearch } = props;
|
|
6227
|
+
const [selectVal, setSelectVal] = useState15(options?.[0]?.value ?? "");
|
|
6228
|
+
const [isHovered, setIsHovered] = useState15(false);
|
|
6229
|
+
const selectedOption = options?.find((o) => o.value === selectVal);
|
|
6230
|
+
const placeholder = selectedOption?.placeholder ?? "";
|
|
6231
|
+
const handleSearch = () => {
|
|
6232
|
+
onSearch?.({ selectValue: hideSelect ? void 0 : selectVal, inputValue: value });
|
|
6233
|
+
};
|
|
6234
|
+
const handleClear = () => {
|
|
6235
|
+
onChange("");
|
|
6236
|
+
};
|
|
6237
|
+
const handleKeyDown = (e) => {
|
|
6238
|
+
if (e.key === "Enter") {
|
|
6239
|
+
handleSearch();
|
|
6305
6240
|
}
|
|
6306
6241
|
};
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
const {
|
|
6310
|
-
options,
|
|
6311
|
-
value,
|
|
6312
|
-
defaultValue,
|
|
6313
|
-
onChange,
|
|
6314
|
-
name,
|
|
6315
|
-
disabled: allDisabled,
|
|
6316
|
-
sx,
|
|
6317
|
-
className,
|
|
6318
|
-
useIndicator,
|
|
6319
|
-
textAlign = "center",
|
|
6320
|
-
size = "sm",
|
|
6321
|
-
flex,
|
|
6322
|
-
columns,
|
|
6323
|
-
label,
|
|
6324
|
-
helperText,
|
|
6325
|
-
error,
|
|
6326
|
-
required
|
|
6327
|
-
} = props;
|
|
6328
|
-
const radioGroup = /* @__PURE__ */ React41.createElement(
|
|
6329
|
-
RadioTileGroupRoot,
|
|
6242
|
+
return /* @__PURE__ */ React42.createElement(
|
|
6243
|
+
Stack,
|
|
6330
6244
|
{
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6245
|
+
direction: "row",
|
|
6246
|
+
sx: {
|
|
6247
|
+
width: hideSelect ? "220px" : "300px",
|
|
6248
|
+
bgcolor: "background.surface",
|
|
6249
|
+
borderRadius: "sm",
|
|
6250
|
+
border: 1,
|
|
6251
|
+
borderColor: "neutral.outlinedBorder"
|
|
6252
|
+
}
|
|
6338
6253
|
},
|
|
6339
|
-
options.
|
|
6340
|
-
|
|
6254
|
+
!hideSelect && options && /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(
|
|
6255
|
+
Select,
|
|
6341
6256
|
{
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
id: `${option.value}`,
|
|
6353
|
-
value: option.value,
|
|
6354
|
-
label: option.label,
|
|
6355
|
-
disableIcon: !useIndicator,
|
|
6356
|
-
disabled: allDisabled ?? option.disabled,
|
|
6357
|
-
size,
|
|
6358
|
-
slotProps: {
|
|
6359
|
-
root: {
|
|
6360
|
-
sx: {
|
|
6361
|
-
width: "100%",
|
|
6362
|
-
flexDirection: textAlign === "start" ? "row-reverse" : "column-reverse",
|
|
6363
|
-
justifyContent: textAlign === "start" ? "space-between" : "center",
|
|
6364
|
-
alignItems: "center",
|
|
6365
|
-
gap: { sm: 2, md: 3, lg: 4 }[size]
|
|
6366
|
-
}
|
|
6367
|
-
},
|
|
6368
|
-
label: ({ disabled }) => ({
|
|
6369
|
-
sx: (theme) => ({
|
|
6370
|
-
...theme.typography[{ sm: "body-sm", md: "body-md", lg: "body-lg" }[size]],
|
|
6371
|
-
color: disabled ? theme.palette.neutral.outlinedDisabledColor : theme.palette.neutral.outlinedColor
|
|
6372
|
-
})
|
|
6373
|
-
})
|
|
6257
|
+
variant: "plain",
|
|
6258
|
+
size: "sm",
|
|
6259
|
+
color: "neutral",
|
|
6260
|
+
value: selectVal,
|
|
6261
|
+
options,
|
|
6262
|
+
onChange: (_, newValue) => setSelectVal(newValue),
|
|
6263
|
+
sx: { flex: 1, maxWidth: "110px" },
|
|
6264
|
+
slotProps: {
|
|
6265
|
+
button: {
|
|
6266
|
+
style: { display: "block", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
|
|
6374
6267
|
}
|
|
6375
6268
|
}
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6269
|
+
}
|
|
6270
|
+
), /* @__PURE__ */ React42.createElement(Divider, { orientation: "vertical", sx: { height: "16px", alignSelf: "center" } })),
|
|
6271
|
+
/* @__PURE__ */ React42.createElement(
|
|
6272
|
+
Input,
|
|
6273
|
+
{
|
|
6274
|
+
variant: "plain",
|
|
6275
|
+
size: "sm",
|
|
6276
|
+
color: "neutral",
|
|
6277
|
+
placeholder,
|
|
6278
|
+
value,
|
|
6279
|
+
onChange: (e) => onChange(e.target.value),
|
|
6280
|
+
onKeyDown: handleKeyDown,
|
|
6281
|
+
sx: { flex: 1, minWidth: 0 },
|
|
6282
|
+
onMouseEnter: () => setIsHovered(true),
|
|
6283
|
+
onMouseLeave: () => setIsHovered(false),
|
|
6284
|
+
endDecorator: isHovered && value ? /* @__PURE__ */ React42.createElement(
|
|
6285
|
+
IconButton,
|
|
6286
|
+
{
|
|
6287
|
+
variant: "plain",
|
|
6288
|
+
size: "sm",
|
|
6289
|
+
color: "neutral",
|
|
6290
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
6291
|
+
onClick: handleClear,
|
|
6292
|
+
"aria-label": "Clear"
|
|
6293
|
+
},
|
|
6294
|
+
/* @__PURE__ */ React42.createElement(CloseRoundedIcon, null)
|
|
6295
|
+
) : void 0
|
|
6296
|
+
}
|
|
6297
|
+
),
|
|
6298
|
+
/* @__PURE__ */ React42.createElement(IconButton, { variant: "plain", size: "sm", color: "neutral", onClick: handleSearch, "aria-label": "Search" }, /* @__PURE__ */ React42.createElement(SearchRoundedIcon, null))
|
|
6397
6299
|
);
|
|
6398
|
-
return /* @__PURE__ */ React41.createElement(FormControl_default, { required, disabled: allDisabled, error, size, sx, className }, label && /* @__PURE__ */ React41.createElement(FormLabel_default, null, label), radioGroup, helperText && /* @__PURE__ */ React41.createElement(FormHelperText_default, null, helperText));
|
|
6399
6300
|
}
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
// src/components/RadioList/RadioList.tsx
|
|
6403
|
-
import React42 from "react";
|
|
6404
|
-
function RadioList(props) {
|
|
6405
|
-
const { items, ...innerProps } = props;
|
|
6406
|
-
return /* @__PURE__ */ React42.createElement(RadioGroup, { ...innerProps }, items.map((item) => /* @__PURE__ */ React42.createElement(Radio, { key: `${item.value}`, value: item.value, label: item.label })));
|
|
6407
|
-
}
|
|
6408
|
-
RadioList.displayName = "RadioList";
|
|
6301
|
+
SearchBar.displayName = "SearchBar";
|
|
6409
6302
|
|
|
6410
6303
|
// src/components/Stepper/Stepper.tsx
|
|
6411
6304
|
import React43 from "react";
|
|
@@ -6415,15 +6308,15 @@ import {
|
|
|
6415
6308
|
StepIndicator as JoyStepIndicator,
|
|
6416
6309
|
stepClasses,
|
|
6417
6310
|
stepIndicatorClasses,
|
|
6418
|
-
styled as
|
|
6311
|
+
styled as styled26
|
|
6419
6312
|
} from "@mui/joy";
|
|
6420
6313
|
import CheckIcon from "@mui/icons-material/Check";
|
|
6421
6314
|
import { motion as motion27 } from "framer-motion";
|
|
6422
|
-
var Step =
|
|
6315
|
+
var Step = styled26(JoyStep)({});
|
|
6423
6316
|
Step.displayName = "Step";
|
|
6424
|
-
var StepIndicator =
|
|
6317
|
+
var StepIndicator = styled26(JoyStepIndicator)({});
|
|
6425
6318
|
StepIndicator.displayName = "StepIndicator";
|
|
6426
|
-
var StyledStepper =
|
|
6319
|
+
var StyledStepper = styled26(JoyStepper)(({ theme }) => ({
|
|
6427
6320
|
"--StepIndicator-size": "24px",
|
|
6428
6321
|
"--Step-gap": theme.spacing(2),
|
|
6429
6322
|
"--joy-palette-success-solidBg": "var(--joy-palette-success-400)",
|
|
@@ -6509,10 +6402,10 @@ Stepper.displayName = "Stepper";
|
|
|
6509
6402
|
|
|
6510
6403
|
// src/components/Switch/Switch.tsx
|
|
6511
6404
|
import React44 from "react";
|
|
6512
|
-
import { Switch as JoySwitch, styled as
|
|
6405
|
+
import { Switch as JoySwitch, styled as styled27, switchClasses } from "@mui/joy";
|
|
6513
6406
|
import { motion as motion28 } from "framer-motion";
|
|
6514
6407
|
var MotionSwitch = motion28(JoySwitch);
|
|
6515
|
-
var StyledThumb =
|
|
6408
|
+
var StyledThumb = styled27(motion28.div)({
|
|
6516
6409
|
"--Icon-fontSize": "calc(var(--Switch-thumbSize) * 0.75)",
|
|
6517
6410
|
display: "inline-flex",
|
|
6518
6411
|
justifyContent: "center",
|
|
@@ -6557,15 +6450,15 @@ import {
|
|
|
6557
6450
|
Tab as JoyTab,
|
|
6558
6451
|
TabList as JoyTabList,
|
|
6559
6452
|
TabPanel as JoyTabPanel,
|
|
6560
|
-
styled as
|
|
6453
|
+
styled as styled28,
|
|
6561
6454
|
tabClasses
|
|
6562
6455
|
} from "@mui/joy";
|
|
6563
|
-
var StyledTabs =
|
|
6456
|
+
var StyledTabs = styled28(JoyTabs)(({ theme }) => ({
|
|
6564
6457
|
backgroundColor: theme.palette.background.body
|
|
6565
6458
|
}));
|
|
6566
6459
|
var Tabs = StyledTabs;
|
|
6567
6460
|
Tabs.displayName = "Tabs";
|
|
6568
|
-
var StyledTab =
|
|
6461
|
+
var StyledTab = styled28(JoyTab)(({ theme }) => ({
|
|
6569
6462
|
gap: theme.spacing(2),
|
|
6570
6463
|
[`&:not(.${tabClasses.selected})`]: {
|
|
6571
6464
|
color: theme.palette.neutral[700]
|
|
@@ -6843,8 +6736,8 @@ function ThemeProvider(props) {
|
|
|
6843
6736
|
ThemeProvider.displayName = "ThemeProvider";
|
|
6844
6737
|
|
|
6845
6738
|
// src/components/Uploader/Uploader.tsx
|
|
6846
|
-
import React47, { useCallback as
|
|
6847
|
-
import { styled as
|
|
6739
|
+
import React47, { useCallback as useCallback17, useEffect as useEffect12, useMemo as useMemo15, useRef as useRef11, useState as useState16 } from "react";
|
|
6740
|
+
import { styled as styled29, Input as Input2 } from "@mui/joy";
|
|
6848
6741
|
import MuiFileUploadIcon from "@mui/icons-material/CloudUploadRounded";
|
|
6849
6742
|
import MuiUploadFileIcon from "@mui/icons-material/UploadFileRounded";
|
|
6850
6743
|
import MuiClearIcon from "@mui/icons-material/ClearRounded";
|
|
@@ -6866,7 +6759,7 @@ var esmFiles = {
|
|
|
6866
6759
|
"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/prevent-unhandled.js"
|
|
6867
6760
|
)
|
|
6868
6761
|
};
|
|
6869
|
-
var VisuallyHiddenInput =
|
|
6762
|
+
var VisuallyHiddenInput = styled29(Input2)({
|
|
6870
6763
|
width: "1px",
|
|
6871
6764
|
height: "1px",
|
|
6872
6765
|
overflow: "hidden",
|
|
@@ -6875,18 +6768,18 @@ var VisuallyHiddenInput = styled30(Input2)({
|
|
|
6875
6768
|
clipPath: "inset(50%)",
|
|
6876
6769
|
position: "absolute"
|
|
6877
6770
|
});
|
|
6878
|
-
var PreviewRoot =
|
|
6771
|
+
var PreviewRoot = styled29(Stack_default, {
|
|
6879
6772
|
name: "Uploader",
|
|
6880
6773
|
slot: "PreviewRoot"
|
|
6881
6774
|
})({});
|
|
6882
|
-
var UploadCard =
|
|
6775
|
+
var UploadCard = styled29(Card, {
|
|
6883
6776
|
name: "Uploader",
|
|
6884
6777
|
slot: "UploadCard"
|
|
6885
6778
|
})(({ theme }) => ({
|
|
6886
6779
|
padding: theme.spacing(2.5),
|
|
6887
6780
|
border: `1px solid ${theme.palette.neutral.outlinedBorder}`
|
|
6888
6781
|
}));
|
|
6889
|
-
var UploadFileIcon =
|
|
6782
|
+
var UploadFileIcon = styled29(MuiUploadFileIcon, {
|
|
6890
6783
|
name: "Uploader",
|
|
6891
6784
|
slot: "UploadFileIcon"
|
|
6892
6785
|
})(({ theme }) => ({
|
|
@@ -6894,7 +6787,7 @@ var UploadFileIcon = styled30(MuiUploadFileIcon, {
|
|
|
6894
6787
|
width: "32px",
|
|
6895
6788
|
height: "32px"
|
|
6896
6789
|
}));
|
|
6897
|
-
var ClearIcon2 =
|
|
6790
|
+
var ClearIcon2 = styled29(MuiClearIcon, {
|
|
6898
6791
|
name: "Uploader",
|
|
6899
6792
|
slot: "ClearIcon"
|
|
6900
6793
|
})(({ theme }) => ({
|
|
@@ -6934,13 +6827,13 @@ var Preview = (props) => {
|
|
|
6934
6827
|
file.name
|
|
6935
6828
|
), !!file.size && /* @__PURE__ */ React47.createElement(Typography_default, { level: "body-xs", fontWeight: "300", lineHeight: "1.33", textColor: "text.tertiary" }, getFileSize(file.size))), /* @__PURE__ */ React47.createElement(IconButton_default, { onClick: () => onDelete?.(file) }, /* @__PURE__ */ React47.createElement(ClearIcon2, null))))));
|
|
6936
6829
|
};
|
|
6937
|
-
var UploaderRoot =
|
|
6830
|
+
var UploaderRoot = styled29(Stack_default, {
|
|
6938
6831
|
name: "Uploader",
|
|
6939
6832
|
slot: "root"
|
|
6940
6833
|
})(({ theme }) => ({
|
|
6941
6834
|
gap: theme.spacing(2)
|
|
6942
6835
|
}));
|
|
6943
|
-
var FileDropZone =
|
|
6836
|
+
var FileDropZone = styled29(Sheet_default, {
|
|
6944
6837
|
name: "Uploader",
|
|
6945
6838
|
slot: "dropZone",
|
|
6946
6839
|
shouldForwardProp: (prop) => prop !== "error" && prop !== "disabled"
|
|
@@ -6961,7 +6854,7 @@ var FileDropZone = styled30(Sheet_default, {
|
|
|
6961
6854
|
}
|
|
6962
6855
|
})
|
|
6963
6856
|
);
|
|
6964
|
-
var UploaderIcon =
|
|
6857
|
+
var UploaderIcon = styled29(MuiFileUploadIcon, {
|
|
6965
6858
|
name: "Uploader",
|
|
6966
6859
|
slot: "iconContainer",
|
|
6967
6860
|
shouldForwardProp: (prop) => prop !== "error" && prop !== "disabled"
|
|
@@ -6992,8 +6885,8 @@ var Uploader = React47.memo(
|
|
|
6992
6885
|
error: errorProp,
|
|
6993
6886
|
helperText: helperTextProp
|
|
6994
6887
|
} = props;
|
|
6995
|
-
const dropZoneRef =
|
|
6996
|
-
const inputRef =
|
|
6888
|
+
const dropZoneRef = useRef11(null);
|
|
6889
|
+
const inputRef = useRef11(null);
|
|
6997
6890
|
const [errorText, setErrorText] = useState16();
|
|
6998
6891
|
const [files, setFiles] = useState16([]);
|
|
6999
6892
|
const [uploaded, setUploaded] = useState16(props.uploaded || []);
|
|
@@ -7043,7 +6936,7 @@ var Uploader = React47.memo(
|
|
|
7043
6936
|
() => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
|
|
7044
6937
|
[files, maxCount, uploaded]
|
|
7045
6938
|
);
|
|
7046
|
-
const addFiles =
|
|
6939
|
+
const addFiles = useCallback17(
|
|
7047
6940
|
(uploads) => {
|
|
7048
6941
|
try {
|
|
7049
6942
|
const types = parsedAccepts.map((type) => type.replace(".", "")) || [];
|
|
@@ -7088,7 +6981,7 @@ var Uploader = React47.memo(
|
|
|
7088
6981
|
},
|
|
7089
6982
|
[files, uploaded, maxCount, parsedAccepts, maxFileSize, maxFileTotalSize, name, onChange]
|
|
7090
6983
|
);
|
|
7091
|
-
|
|
6984
|
+
useEffect12(() => {
|
|
7092
6985
|
if (!dropZoneRef.current || disabled) {
|
|
7093
6986
|
return;
|
|
7094
6987
|
}
|
|
@@ -7126,7 +7019,7 @@ var Uploader = React47.memo(
|
|
|
7126
7019
|
);
|
|
7127
7020
|
return () => cleanup?.();
|
|
7128
7021
|
}, [disabled, addFiles]);
|
|
7129
|
-
|
|
7022
|
+
useEffect12(() => {
|
|
7130
7023
|
if (inputRef.current && minCount) {
|
|
7131
7024
|
if (files.length < minCount) {
|
|
7132
7025
|
inputRef.current.setCustomValidity(`At least ${minCount} files are required.`);
|
|
@@ -7135,14 +7028,14 @@ var Uploader = React47.memo(
|
|
|
7135
7028
|
}
|
|
7136
7029
|
}
|
|
7137
7030
|
}, [inputRef, files, minCount]);
|
|
7138
|
-
const handleFileChanged =
|
|
7031
|
+
const handleFileChanged = useCallback17(
|
|
7139
7032
|
(event) => {
|
|
7140
7033
|
const files2 = Array.from(event.target.files || []);
|
|
7141
7034
|
addFiles(files2);
|
|
7142
7035
|
},
|
|
7143
7036
|
[addFiles]
|
|
7144
7037
|
);
|
|
7145
|
-
const handleDeleteFile =
|
|
7038
|
+
const handleDeleteFile = useCallback17(
|
|
7146
7039
|
(deletedFile) => {
|
|
7147
7040
|
if (deletedFile instanceof File) {
|
|
7148
7041
|
setFiles((current) => {
|
|
@@ -7162,7 +7055,7 @@ var Uploader = React47.memo(
|
|
|
7162
7055
|
},
|
|
7163
7056
|
[name, onChange, onDelete]
|
|
7164
7057
|
);
|
|
7165
|
-
const handleUploaderButtonClick =
|
|
7058
|
+
const handleUploaderButtonClick = useCallback17(() => {
|
|
7166
7059
|
inputRef.current?.click();
|
|
7167
7060
|
}, []);
|
|
7168
7061
|
const uploader = /* @__PURE__ */ React47.createElement(
|
|
@@ -7279,7 +7172,7 @@ export {
|
|
|
7279
7172
|
Radio,
|
|
7280
7173
|
RadioGroup,
|
|
7281
7174
|
RadioList,
|
|
7282
|
-
|
|
7175
|
+
SearchBar,
|
|
7283
7176
|
Select,
|
|
7284
7177
|
Sheet,
|
|
7285
7178
|
Skeleton2 as Skeleton,
|
|
@@ -7354,17 +7247,17 @@ export {
|
|
|
7354
7247
|
modalDialogClasses,
|
|
7355
7248
|
modalOverflowClasses,
|
|
7356
7249
|
optionClasses,
|
|
7357
|
-
|
|
7250
|
+
radioClasses,
|
|
7358
7251
|
radioGroupClasses,
|
|
7359
7252
|
selectClasses,
|
|
7360
|
-
|
|
7253
|
+
sheetClasses,
|
|
7361
7254
|
skeletonClasses,
|
|
7362
7255
|
sliderClasses,
|
|
7363
7256
|
stackClasses,
|
|
7364
7257
|
stepButtonClasses,
|
|
7365
7258
|
stepClasses2 as stepClasses,
|
|
7366
7259
|
stepperClasses,
|
|
7367
|
-
|
|
7260
|
+
styled30 as styled,
|
|
7368
7261
|
switchClasses2 as switchClasses,
|
|
7369
7262
|
tabListClasses,
|
|
7370
7263
|
tabPanelClasses,
|