@ceed/ads 1.25.1-next.3 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/rehype-accent-FZRUD7VI.js +39 -0
- package/dist/components/CurrencyInput/CurrencyInput.d.ts +1 -1
- package/dist/components/CurrencyInput/hooks/use-currency-setting.d.ts +2 -2
- package/dist/components/DataTable/components.d.ts +2 -1
- package/dist/components/DataTable/hooks.d.ts +1 -1
- package/dist/components/DataTable/styled.d.ts +3 -1
- package/dist/components/DataTable/types.d.ts +11 -0
- package/dist/components/DataTable/utils.d.ts +2 -2
- package/dist/components/ProfileMenu/ProfileMenu.d.ts +1 -1
- package/dist/components/data-display/Badge.md +71 -39
- package/dist/components/data-display/DataTable.md +177 -1
- package/dist/components/data-display/InfoSign.md +74 -98
- package/dist/components/data-display/Typography.md +363 -97
- package/dist/components/feedback/CircularProgress.md +257 -0
- package/dist/components/feedback/Dialog.md +76 -62
- package/dist/components/feedback/Modal.md +259 -44
- package/dist/components/feedback/Skeleton.md +280 -0
- package/dist/components/feedback/llms.txt +2 -0
- package/dist/components/inputs/Autocomplete.md +356 -107
- package/dist/components/inputs/ButtonGroup.md +115 -106
- package/dist/components/inputs/Calendar.md +98 -459
- package/dist/components/inputs/CurrencyInput.md +183 -5
- package/dist/components/inputs/DatePicker.md +108 -431
- package/dist/components/inputs/DateRangePicker.md +131 -492
- package/dist/components/inputs/FilterMenu.md +169 -19
- package/dist/components/inputs/FilterableCheckboxGroup.md +123 -23
- package/dist/components/inputs/FormControl.md +361 -0
- package/dist/components/inputs/IconButton.md +137 -88
- package/dist/components/inputs/Input.md +5 -0
- package/dist/components/inputs/MonthPicker.md +95 -422
- package/dist/components/inputs/MonthRangePicker.md +89 -466
- package/dist/components/inputs/PercentageInput.md +185 -16
- package/dist/components/inputs/RadioButton.md +163 -35
- package/dist/components/inputs/RadioList.md +241 -0
- package/dist/components/inputs/RadioTileGroup.md +150 -61
- package/dist/components/inputs/Select.md +222 -326
- package/dist/components/inputs/Slider.md +334 -0
- package/dist/components/inputs/Switch.md +136 -376
- package/dist/components/inputs/Textarea.md +213 -10
- package/dist/components/inputs/Uploader/Uploader.md +145 -66
- package/dist/components/inputs/llms.txt +3 -0
- package/dist/components/navigation/Breadcrumbs.md +80 -322
- package/dist/components/navigation/Dropdown.md +92 -221
- package/dist/components/navigation/IconMenuButton.md +40 -502
- package/dist/components/navigation/InsetDrawer.md +68 -738
- package/dist/components/navigation/Link.md +39 -298
- package/dist/components/navigation/Menu.md +92 -285
- package/dist/components/navigation/MenuButton.md +55 -448
- package/dist/components/navigation/Pagination.md +47 -338
- package/dist/components/navigation/ProfileMenu.md +45 -268
- package/dist/components/navigation/Stepper.md +160 -28
- package/dist/components/navigation/Tabs.md +57 -316
- package/dist/components/surfaces/Sheet.md +151 -334
- package/dist/guides/ThemeProvider.md +116 -0
- package/dist/guides/llms.txt +9 -0
- package/dist/index.browser.js +16 -18
- package/dist/index.browser.js.map +4 -4
- package/dist/index.cjs +381 -244
- package/dist/index.js +459 -378
- package/dist/llms.txt +8 -0
- package/framer/index.js +1 -166
- package/package.json +15 -16
package/dist/index.cjs
CHANGED
|
@@ -841,11 +841,24 @@ Button.displayName = "Button";
|
|
|
841
841
|
var Button_default = Button;
|
|
842
842
|
|
|
843
843
|
// src/components/Calendar/Calendar.tsx
|
|
844
|
-
var
|
|
845
|
-
var
|
|
844
|
+
var import_react14 = __toESM(require("react"));
|
|
845
|
+
var import_joy19 = require("@mui/joy");
|
|
846
846
|
var import_ChevronLeft = __toESM(require("@mui/icons-material/ChevronLeft"));
|
|
847
847
|
var import_ChevronRight = __toESM(require("@mui/icons-material/ChevronRight"));
|
|
848
|
+
var import_framer_motion13 = require("framer-motion");
|
|
849
|
+
|
|
850
|
+
// src/components/Tooltip/Tooltip.tsx
|
|
851
|
+
var import_react11 = __toESM(require("react"));
|
|
852
|
+
var import_joy17 = require("@mui/joy");
|
|
848
853
|
var import_framer_motion12 = require("framer-motion");
|
|
854
|
+
var MotionTooltip = (0, import_framer_motion12.motion)(import_joy17.Tooltip);
|
|
855
|
+
var Tooltip = (props) => {
|
|
856
|
+
return /* @__PURE__ */ import_react11.default.createElement(MotionTooltip, { ...props });
|
|
857
|
+
};
|
|
858
|
+
Tooltip.displayName = "Tooltip";
|
|
859
|
+
|
|
860
|
+
// src/components/Tooltip/index.ts
|
|
861
|
+
var Tooltip_default = Tooltip;
|
|
849
862
|
|
|
850
863
|
// src/components/Calendar/utils/index.ts
|
|
851
864
|
var getCalendarDates = (date) => {
|
|
@@ -919,43 +932,43 @@ var isSameMonth = (date1, date2) => {
|
|
|
919
932
|
};
|
|
920
933
|
|
|
921
934
|
// src/components/Calendar/hooks/use-calendar-props.ts
|
|
922
|
-
var
|
|
923
|
-
var
|
|
935
|
+
var import_react12 = require("react");
|
|
936
|
+
var import_joy18 = require("@mui/joy");
|
|
924
937
|
var resolveView = (view, views) => {
|
|
925
938
|
return views.includes(view) ? view : views[0];
|
|
926
939
|
};
|
|
927
940
|
var useCalendarProps = (inProps) => {
|
|
928
|
-
const [uncontrolledView, setUncontrolledView] = (0,
|
|
941
|
+
const [uncontrolledView, setUncontrolledView] = (0, import_react12.useState)(
|
|
929
942
|
() => resolveView(inProps.view || "day", inProps.views || ["day", "month"])
|
|
930
943
|
);
|
|
931
|
-
const [uncontrolledValue, setUncontrolledValue] = (0,
|
|
944
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react12.useState)(
|
|
932
945
|
inProps.defaultValue
|
|
933
946
|
);
|
|
934
|
-
const [viewMonth, setViewMonth] = (0,
|
|
947
|
+
const [viewMonth, setViewMonth] = (0, import_react12.useState)(() => {
|
|
935
948
|
const today = /* @__PURE__ */ new Date();
|
|
936
949
|
today.setDate(1);
|
|
937
950
|
today.setHours(0, 0, 0, 0);
|
|
938
951
|
return inProps.value?.[0] || inProps.defaultValue?.[0] || today;
|
|
939
952
|
});
|
|
940
|
-
const [[page, direction], setPage] = (0,
|
|
953
|
+
const [[page, direction], setPage] = (0, import_react12.useState)([0, 0]);
|
|
941
954
|
const resolvedView = inProps.view ?? uncontrolledView;
|
|
942
|
-
const resolvedMinDate = (0,
|
|
955
|
+
const resolvedMinDate = (0, import_react12.useMemo)(() => {
|
|
943
956
|
const minDate = inProps.minDate || /* @__PURE__ */ new Date(0);
|
|
944
957
|
minDate.setHours(0, 0, 0, 0);
|
|
945
958
|
return minDate;
|
|
946
959
|
}, [inProps.minDate]);
|
|
947
|
-
const resolvedMaxDate = (0,
|
|
960
|
+
const resolvedMaxDate = (0, import_react12.useMemo)(() => {
|
|
948
961
|
const maxDate = inProps.maxDate || /* @__PURE__ */ new Date(864e13);
|
|
949
962
|
maxDate.setHours(0, 0, 0, 0);
|
|
950
963
|
return maxDate;
|
|
951
964
|
}, [inProps.maxDate]);
|
|
952
|
-
const paginate = (0,
|
|
965
|
+
const paginate = (0, import_react12.useCallback)(
|
|
953
966
|
(newDirection) => {
|
|
954
967
|
setPage([page + newDirection, newDirection]);
|
|
955
968
|
},
|
|
956
969
|
[page]
|
|
957
970
|
);
|
|
958
|
-
const handleViewMonthChange = (0,
|
|
971
|
+
const handleViewMonthChange = (0, import_react12.useCallback)(
|
|
959
972
|
(newMonth) => {
|
|
960
973
|
setViewMonth(newMonth);
|
|
961
974
|
if (resolvedView === "month") {
|
|
@@ -969,7 +982,7 @@ var useCalendarProps = (inProps) => {
|
|
|
969
982
|
},
|
|
970
983
|
[resolvedView, inProps, viewMonth, paginate]
|
|
971
984
|
);
|
|
972
|
-
const props = (0,
|
|
985
|
+
const props = (0, import_joy18.useThemeProps)({
|
|
973
986
|
props: {
|
|
974
987
|
locale: "default",
|
|
975
988
|
views: ["day", "month"],
|
|
@@ -1003,18 +1016,18 @@ var useCalendarProps = (inProps) => {
|
|
|
1003
1016
|
},
|
|
1004
1017
|
name: "Calendar"
|
|
1005
1018
|
});
|
|
1006
|
-
const ownerState = (0,
|
|
1019
|
+
const ownerState = (0, import_react12.useMemo)(() => ({ ...props, viewMonth, direction }), [props, viewMonth, direction]);
|
|
1007
1020
|
return [props, ownerState];
|
|
1008
1021
|
};
|
|
1009
1022
|
|
|
1010
1023
|
// src/components/Calendar/hooks/use-calendar.ts
|
|
1011
|
-
var
|
|
1024
|
+
var import_react13 = require("react");
|
|
1012
1025
|
var useCalendar = (ownerState) => {
|
|
1013
|
-
const [hoverDay, setHoverDay] = (0,
|
|
1014
|
-
const [hoverMonth, setHoverMonth] = (0,
|
|
1026
|
+
const [hoverDay, setHoverDay] = (0, import_react13.useState)(null);
|
|
1027
|
+
const [hoverMonth, setHoverMonth] = (0, import_react13.useState)(null);
|
|
1015
1028
|
return {
|
|
1016
1029
|
calendarTitle: ownerState.view === "month" ? getYearName(ownerState.viewMonth, ownerState.locale || "default") : getMonthName(ownerState.viewMonth, ownerState.locale || "default"),
|
|
1017
|
-
onPrev: (0,
|
|
1030
|
+
onPrev: (0, import_react13.useCallback)(() => {
|
|
1018
1031
|
if (ownerState.view === "day") {
|
|
1019
1032
|
const currentDate = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1020
1033
|
const currentYear = currentDate.getFullYear();
|
|
@@ -1031,7 +1044,7 @@ var useCalendar = (ownerState) => {
|
|
|
1031
1044
|
ownerState.onMonthChange?.(prevYear);
|
|
1032
1045
|
}
|
|
1033
1046
|
}, [ownerState.onMonthChange, ownerState.viewMonth, ownerState.view]),
|
|
1034
|
-
onNext: (0,
|
|
1047
|
+
onNext: (0, import_react13.useCallback)(() => {
|
|
1035
1048
|
if (ownerState.view === "day") {
|
|
1036
1049
|
const currentDate = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1037
1050
|
const currentYear = currentDate.getFullYear();
|
|
@@ -1048,7 +1061,7 @@ var useCalendar = (ownerState) => {
|
|
|
1048
1061
|
ownerState.onMonthChange?.(nextYear);
|
|
1049
1062
|
}
|
|
1050
1063
|
}, [ownerState.onMonthChange, ownerState.viewMonth, ownerState.view]),
|
|
1051
|
-
getDayCellProps: (0,
|
|
1064
|
+
getDayCellProps: (0, import_react13.useCallback)(
|
|
1052
1065
|
(day) => {
|
|
1053
1066
|
const thisDay = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1054
1067
|
thisDay.setHours(0, 0, 0, 0);
|
|
@@ -1063,7 +1076,7 @@ var useCalendar = (ownerState) => {
|
|
|
1063
1076
|
},
|
|
1064
1077
|
[ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverDay]
|
|
1065
1078
|
),
|
|
1066
|
-
getMonthCellProps: (0,
|
|
1079
|
+
getMonthCellProps: (0, import_react13.useCallback)(
|
|
1067
1080
|
(monthIndex) => {
|
|
1068
1081
|
const thisMonth = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1069
1082
|
thisMonth.setDate(1);
|
|
@@ -1080,7 +1093,7 @@ var useCalendar = (ownerState) => {
|
|
|
1080
1093
|
},
|
|
1081
1094
|
[ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverMonth]
|
|
1082
1095
|
),
|
|
1083
|
-
getPickerDayProps: (0,
|
|
1096
|
+
getPickerDayProps: (0, import_react13.useCallback)(
|
|
1084
1097
|
(day) => {
|
|
1085
1098
|
const thisDay = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1086
1099
|
thisDay.setHours(0, 0, 0, 0);
|
|
@@ -1134,7 +1147,7 @@ var useCalendar = (ownerState) => {
|
|
|
1134
1147
|
hoverDay
|
|
1135
1148
|
]
|
|
1136
1149
|
),
|
|
1137
|
-
getPickerMonthProps: (0,
|
|
1150
|
+
getPickerMonthProps: (0, import_react13.useCallback)(
|
|
1138
1151
|
(monthIndex) => {
|
|
1139
1152
|
const thisMonth = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1140
1153
|
thisMonth.setDate(1);
|
|
@@ -1204,13 +1217,19 @@ var useCalendar = (ownerState) => {
|
|
|
1204
1217
|
};
|
|
1205
1218
|
|
|
1206
1219
|
// src/components/Calendar/Calendar.tsx
|
|
1207
|
-
var
|
|
1220
|
+
var MONTH_VIEW_HINT_MESSAGE = "Click the month title to view all months.";
|
|
1221
|
+
var MONTH_NAV_CLICK_WINDOW_MS = 1200;
|
|
1222
|
+
var MONTH_NAV_CLICK_THRESHOLD = 3;
|
|
1223
|
+
var MONTH_VIEW_HINT_DURATION_MS = 5e3;
|
|
1224
|
+
var MONTH_VIEW_HINT_COOLDOWN_MS = 3e4;
|
|
1225
|
+
var lastMonthViewAssistHintShownAt = 0;
|
|
1226
|
+
var CalendarRoot = (0, import_joy19.styled)("div", {
|
|
1208
1227
|
name: "Calendar",
|
|
1209
1228
|
slot: "root"
|
|
1210
1229
|
})({
|
|
1211
1230
|
maxWidth: "264px"
|
|
1212
1231
|
});
|
|
1213
|
-
var CalendarHeader = (0,
|
|
1232
|
+
var CalendarHeader = (0, import_joy19.styled)("div", {
|
|
1214
1233
|
name: "Calendar",
|
|
1215
1234
|
slot: "calendarHeader"
|
|
1216
1235
|
})(({ theme }) => ({
|
|
@@ -1219,7 +1238,7 @@ var CalendarHeader = (0, import_joy18.styled)("div", {
|
|
|
1219
1238
|
alignItems: "center",
|
|
1220
1239
|
padding: theme.spacing(2)
|
|
1221
1240
|
}));
|
|
1222
|
-
var CalendarViewContainer = (0,
|
|
1241
|
+
var CalendarViewContainer = (0, import_joy19.styled)("div", {
|
|
1223
1242
|
name: "Calendar",
|
|
1224
1243
|
slot: "viewContainer",
|
|
1225
1244
|
shouldForwardProp: (prop) => prop !== "calendarType"
|
|
@@ -1230,7 +1249,7 @@ var CalendarViewContainer = (0, import_joy18.styled)("div", {
|
|
|
1230
1249
|
overflow: "hidden",
|
|
1231
1250
|
minHeight: calendarType === "datePicker" ? "250px" : "unset"
|
|
1232
1251
|
}));
|
|
1233
|
-
var CalendarViewTable = (0,
|
|
1252
|
+
var CalendarViewTable = (0, import_joy19.styled)(import_framer_motion13.motion.table, {
|
|
1234
1253
|
name: "Calendar",
|
|
1235
1254
|
slot: "viewTable"
|
|
1236
1255
|
})(({ theme }) => ({
|
|
@@ -1243,15 +1262,15 @@ var CalendarViewTable = (0, import_joy18.styled)(import_framer_motion12.motion.t
|
|
|
1243
1262
|
paddingBottom: theme.spacing(2)
|
|
1244
1263
|
}
|
|
1245
1264
|
}));
|
|
1246
|
-
var CalendarWeekHeaderContainer = (0,
|
|
1265
|
+
var CalendarWeekHeaderContainer = (0, import_joy19.styled)("thead", {
|
|
1247
1266
|
name: "Calendar",
|
|
1248
1267
|
slot: "weekHeaderContainer"
|
|
1249
1268
|
})({});
|
|
1250
|
-
var CalendarDayPickerContainer = (0,
|
|
1269
|
+
var CalendarDayPickerContainer = (0, import_joy19.styled)("tbody", {
|
|
1251
1270
|
name: "Calendar",
|
|
1252
1271
|
slot: "dayPickerContainer"
|
|
1253
1272
|
})({});
|
|
1254
|
-
var CalendarSwitchViewButton = (0,
|
|
1273
|
+
var CalendarSwitchViewButton = (0, import_joy19.styled)(Button_default, {
|
|
1255
1274
|
name: "Calendar",
|
|
1256
1275
|
slot: "switchViewButton"
|
|
1257
1276
|
})(({ ownerState }) => [
|
|
@@ -1259,7 +1278,7 @@ var CalendarSwitchViewButton = (0, import_joy18.styled)(Button_default, {
|
|
|
1259
1278
|
pointerEvents: "none"
|
|
1260
1279
|
}
|
|
1261
1280
|
]);
|
|
1262
|
-
var CalendarDayCell = (0,
|
|
1281
|
+
var CalendarDayCell = (0, import_joy19.styled)("td", {
|
|
1263
1282
|
name: "Calendar",
|
|
1264
1283
|
slot: "dayCell"
|
|
1265
1284
|
})(({ theme }) => ({
|
|
@@ -1281,7 +1300,7 @@ var CalendarDayCell = (0, import_joy18.styled)("td", {
|
|
|
1281
1300
|
}
|
|
1282
1301
|
}
|
|
1283
1302
|
}));
|
|
1284
|
-
var CalendarMonthCell = (0,
|
|
1303
|
+
var CalendarMonthCell = (0, import_joy19.styled)("td", {
|
|
1285
1304
|
name: "Calendar",
|
|
1286
1305
|
slot: "monthCell"
|
|
1287
1306
|
})(({ theme }) => ({
|
|
@@ -1303,7 +1322,7 @@ var CalendarMonthCell = (0, import_joy18.styled)("td", {
|
|
|
1303
1322
|
}
|
|
1304
1323
|
}
|
|
1305
1324
|
}));
|
|
1306
|
-
var CalendarMonth = (0,
|
|
1325
|
+
var CalendarMonth = (0, import_joy19.styled)(Button_default, {
|
|
1307
1326
|
name: "Calendar",
|
|
1308
1327
|
slot: "month",
|
|
1309
1328
|
shouldForwardProp: (prop) => prop !== "isSelected"
|
|
@@ -1338,7 +1357,7 @@ var CalendarMonth = (0, import_joy18.styled)(Button_default, {
|
|
|
1338
1357
|
backgroundColor: theme.palette.neutral.solidDisabledBg
|
|
1339
1358
|
}
|
|
1340
1359
|
]);
|
|
1341
|
-
var CalendarDay = (0,
|
|
1360
|
+
var CalendarDay = (0, import_joy19.styled)(Button_default, {
|
|
1342
1361
|
name: "Calendar",
|
|
1343
1362
|
slot: "day",
|
|
1344
1363
|
shouldForwardProp: (prop) => !["isToday", "isSelected"].includes(prop)
|
|
@@ -1408,9 +1427,9 @@ var swipePower = (offset, velocity) => {
|
|
|
1408
1427
|
var PickerDays = (props) => {
|
|
1409
1428
|
const { ownerState } = props;
|
|
1410
1429
|
const { getPickerDayProps, getDayCellProps } = useCalendar(ownerState);
|
|
1411
|
-
const calendarDates = (0,
|
|
1412
|
-
const weekdayNames = (0,
|
|
1413
|
-
return /* @__PURE__ */
|
|
1430
|
+
const calendarDates = (0, import_react14.useMemo)(() => getCalendarDates(ownerState.viewMonth), [ownerState.viewMonth]);
|
|
1431
|
+
const weekdayNames = (0, import_react14.useMemo)(() => getWeekdayNames(ownerState.locale || "default"), [ownerState.locale]);
|
|
1432
|
+
return /* @__PURE__ */ import_react14.default.createElement(CalendarViewContainer, { calendarType: "datePicker" }, /* @__PURE__ */ import_react14.default.createElement(import_framer_motion13.AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ import_react14.default.createElement(
|
|
1414
1433
|
CalendarViewTable,
|
|
1415
1434
|
{
|
|
1416
1435
|
key: `${ownerState.viewMonth.toString()}_${ownerState.direction}`,
|
|
@@ -1439,10 +1458,10 @@ var PickerDays = (props) => {
|
|
|
1439
1458
|
}
|
|
1440
1459
|
}
|
|
1441
1460
|
},
|
|
1442
|
-
/* @__PURE__ */
|
|
1443
|
-
/* @__PURE__ */
|
|
1444
|
-
(date, i) => date ? /* @__PURE__ */
|
|
1445
|
-
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */
|
|
1461
|
+
/* @__PURE__ */ import_react14.default.createElement(CalendarWeekHeaderContainer, null, /* @__PURE__ */ import_react14.default.createElement("tr", null, weekdayNames.map((name, i) => /* @__PURE__ */ import_react14.default.createElement(import_react14.Fragment, { key: `${ownerState.viewMonth}_${name}_${i}` }, /* @__PURE__ */ import_react14.default.createElement("th", null, /* @__PURE__ */ import_react14.default.createElement(Typography_default, { level: "body-xs", textAlign: "center" }, name)), i < 6 && /* @__PURE__ */ import_react14.default.createElement("th", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" }))))),
|
|
1462
|
+
/* @__PURE__ */ import_react14.default.createElement(CalendarDayPickerContainer, null, calendarDates.map((weekDates, rowIndex) => /* @__PURE__ */ import_react14.default.createElement(import_react14.Fragment, { key: `${ownerState.viewMonth}_${rowIndex}` }, /* @__PURE__ */ import_react14.default.createElement("tr", null, weekDates.map(
|
|
1463
|
+
(date, i) => date ? /* @__PURE__ */ import_react14.default.createElement(import_react14.Fragment, { key: `${ownerState.viewMonth}_${date}_${i}` }, /* @__PURE__ */ import_react14.default.createElement(CalendarDayCell, { ...getDayCellProps(date) }, /* @__PURE__ */ import_react14.default.createElement(CalendarDay, { size: "sm", variant: "plain", color: "neutral", ...getPickerDayProps(date) }, date)), i < 6 && /* @__PURE__ */ import_react14.default.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })) : /* @__PURE__ */ import_react14.default.createElement(import_react14.Fragment, { key: `${ownerState.viewMonth}_${i}` }, /* @__PURE__ */ import_react14.default.createElement("td", null), i < 6 && /* @__PURE__ */ import_react14.default.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" }))
|
|
1464
|
+
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */ import_react14.default.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ import_react14.default.createElement("td", { colSpan: 13, style: { height: 4 } })))))
|
|
1446
1465
|
)));
|
|
1447
1466
|
};
|
|
1448
1467
|
var PickerMonths = (props) => {
|
|
@@ -1459,7 +1478,7 @@ var PickerMonths = (props) => {
|
|
|
1459
1478
|
[[]]
|
|
1460
1479
|
);
|
|
1461
1480
|
const isMonthPicker = !ownerState.views?.find((view) => view === "day");
|
|
1462
|
-
return /* @__PURE__ */
|
|
1481
|
+
return /* @__PURE__ */ import_react14.default.createElement(CalendarViewContainer, { calendarType: isMonthPicker ? "monthPicker" : "datePicker" }, /* @__PURE__ */ import_react14.default.createElement(import_framer_motion13.AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ import_react14.default.createElement(
|
|
1463
1482
|
CalendarViewTable,
|
|
1464
1483
|
{
|
|
1465
1484
|
key: `${ownerState.viewMonth.getFullYear()}_${ownerState.direction}`,
|
|
@@ -1488,10 +1507,10 @@ var PickerMonths = (props) => {
|
|
|
1488
1507
|
}
|
|
1489
1508
|
}
|
|
1490
1509
|
},
|
|
1491
|
-
/* @__PURE__ */
|
|
1510
|
+
/* @__PURE__ */ import_react14.default.createElement("tbody", null, chunkedMonths.map((months, i) => /* @__PURE__ */ import_react14.default.createElement(import_react14.Fragment, { key: months.join("_") }, /* @__PURE__ */ import_react14.default.createElement("tr", null, months.map((monthIndex, j) => /* @__PURE__ */ import_react14.default.createElement(import_react14.Fragment, { key: monthIndex }, /* @__PURE__ */ import_react14.default.createElement(CalendarMonthCell, { ...getMonthCellProps(monthIndex) }, /* @__PURE__ */ import_react14.default.createElement(CalendarMonth, { size: "sm", variant: "plain", color: "neutral", ...getPickerMonthProps(monthIndex) }, getMonthNameFromIndex(monthIndex, ownerState.locale))), j < 3 && /* @__PURE__ */ import_react14.default.createElement("td", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" })))), i < chunkedMonths.length - 1 && /* @__PURE__ */ import_react14.default.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ import_react14.default.createElement("td", { colSpan: 7, style: { height: 4 } })))))
|
|
1492
1511
|
)));
|
|
1493
1512
|
};
|
|
1494
|
-
var Calendar = (0,
|
|
1513
|
+
var Calendar = (0, import_react14.forwardRef)((inProps, ref) => {
|
|
1495
1514
|
const [props, ownerState] = useCalendarProps(inProps);
|
|
1496
1515
|
const {
|
|
1497
1516
|
value,
|
|
@@ -1510,17 +1529,96 @@ var Calendar = (0, import_react13.forwardRef)((inProps, ref) => {
|
|
|
1510
1529
|
...others
|
|
1511
1530
|
} = props;
|
|
1512
1531
|
const { calendarTitle, onPrev, onNext } = useCalendar(ownerState);
|
|
1513
|
-
|
|
1514
|
-
|
|
1532
|
+
const [isMonthViewAssistHintOpen, setIsMonthViewAssistHintOpen] = (0, import_react14.useState)(false);
|
|
1533
|
+
const monthNavClickTimestampsRef = (0, import_react14.useRef)([]);
|
|
1534
|
+
const monthViewAssistHintShownInSessionRef = (0, import_react14.useRef)(false);
|
|
1535
|
+
const monthViewAssistHintTimeoutRef = (0, import_react14.useRef)(null);
|
|
1536
|
+
const hasEndDate = Boolean(value?.[1]);
|
|
1537
|
+
const isRangeHintEligible = Boolean(rangeSelection && !hasEndDate);
|
|
1538
|
+
const isHintEligible = Boolean(view === "day" && (!rangeSelection || isRangeHintEligible));
|
|
1539
|
+
const monthViewHintMessage = MONTH_VIEW_HINT_MESSAGE;
|
|
1540
|
+
(0, import_react14.useEffect)(() => {
|
|
1541
|
+
if (!isHintEligible) {
|
|
1542
|
+
monthNavClickTimestampsRef.current = [];
|
|
1543
|
+
setIsMonthViewAssistHintOpen(false);
|
|
1544
|
+
}
|
|
1545
|
+
}, [isHintEligible]);
|
|
1546
|
+
(0, import_react14.useEffect)(() => {
|
|
1547
|
+
return () => {
|
|
1548
|
+
if (monthViewAssistHintTimeoutRef.current) {
|
|
1549
|
+
clearTimeout(monthViewAssistHintTimeoutRef.current);
|
|
1550
|
+
}
|
|
1551
|
+
};
|
|
1552
|
+
}, []);
|
|
1553
|
+
const closeMonthViewAssistHint = (0, import_react14.useCallback)(() => {
|
|
1554
|
+
if (monthViewAssistHintTimeoutRef.current) {
|
|
1555
|
+
clearTimeout(monthViewAssistHintTimeoutRef.current);
|
|
1556
|
+
monthViewAssistHintTimeoutRef.current = null;
|
|
1557
|
+
}
|
|
1558
|
+
setIsMonthViewAssistHintOpen(false);
|
|
1559
|
+
}, []);
|
|
1560
|
+
const showMonthViewAssistHint = (0, import_react14.useCallback)(() => {
|
|
1561
|
+
const now = Date.now();
|
|
1562
|
+
if (monthViewAssistHintShownInSessionRef.current) return;
|
|
1563
|
+
if (now - lastMonthViewAssistHintShownAt < MONTH_VIEW_HINT_COOLDOWN_MS) return;
|
|
1564
|
+
monthViewAssistHintShownInSessionRef.current = true;
|
|
1565
|
+
lastMonthViewAssistHintShownAt = now;
|
|
1566
|
+
setIsMonthViewAssistHintOpen(true);
|
|
1567
|
+
if (monthViewAssistHintTimeoutRef.current) {
|
|
1568
|
+
clearTimeout(monthViewAssistHintTimeoutRef.current);
|
|
1569
|
+
}
|
|
1570
|
+
monthViewAssistHintTimeoutRef.current = setTimeout(() => {
|
|
1571
|
+
setIsMonthViewAssistHintOpen(false);
|
|
1572
|
+
monthViewAssistHintTimeoutRef.current = null;
|
|
1573
|
+
}, MONTH_VIEW_HINT_DURATION_MS);
|
|
1574
|
+
}, []);
|
|
1575
|
+
const trackFastMonthNavigation = (0, import_react14.useCallback)(() => {
|
|
1576
|
+
if (!isHintEligible) return;
|
|
1577
|
+
const now = Date.now();
|
|
1578
|
+
monthNavClickTimestampsRef.current = [
|
|
1579
|
+
...monthNavClickTimestampsRef.current.filter((timestamp) => now - timestamp <= MONTH_NAV_CLICK_WINDOW_MS),
|
|
1580
|
+
now
|
|
1581
|
+
];
|
|
1582
|
+
if (monthNavClickTimestampsRef.current.length >= MONTH_NAV_CLICK_THRESHOLD) {
|
|
1583
|
+
showMonthViewAssistHint();
|
|
1584
|
+
}
|
|
1585
|
+
}, [isHintEligible, showMonthViewAssistHint]);
|
|
1586
|
+
const handlePrevClick = (0, import_react14.useCallback)(() => {
|
|
1587
|
+
onPrev();
|
|
1588
|
+
trackFastMonthNavigation();
|
|
1589
|
+
}, [onPrev, trackFastMonthNavigation]);
|
|
1590
|
+
const handleNextClick = (0, import_react14.useCallback)(() => {
|
|
1591
|
+
onNext();
|
|
1592
|
+
trackFastMonthNavigation();
|
|
1593
|
+
}, [onNext, trackFastMonthNavigation]);
|
|
1594
|
+
const handleSwitchViewClick = (0, import_react14.useCallback)(() => {
|
|
1595
|
+
closeMonthViewAssistHint();
|
|
1596
|
+
onViewChange?.();
|
|
1597
|
+
}, [closeMonthViewAssistHint, onViewChange]);
|
|
1598
|
+
return /* @__PURE__ */ import_react14.default.createElement(CalendarRoot, { ref, ...others }, /* @__PURE__ */ import_react14.default.createElement(CalendarHeader, null, /* @__PURE__ */ import_react14.default.createElement(IconButton_default, { size: "sm", onClick: handlePrevClick, "aria-label": `Previous ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ import_react14.default.createElement(import_ChevronLeft.default, null)), /* @__PURE__ */ import_react14.default.createElement(
|
|
1599
|
+
Tooltip_default,
|
|
1515
1600
|
{
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1601
|
+
title: monthViewHintMessage,
|
|
1602
|
+
arrow: true,
|
|
1603
|
+
open: isMonthViewAssistHintOpen,
|
|
1604
|
+
placement: "bottom",
|
|
1605
|
+
disableFocusListener: true,
|
|
1606
|
+
disableHoverListener: true,
|
|
1607
|
+
disableTouchListener: true,
|
|
1608
|
+
variant: "solid"
|
|
1521
1609
|
},
|
|
1522
|
-
|
|
1523
|
-
|
|
1610
|
+
/* @__PURE__ */ import_react14.default.createElement(
|
|
1611
|
+
CalendarSwitchViewButton,
|
|
1612
|
+
{
|
|
1613
|
+
ownerState,
|
|
1614
|
+
variant: "plain",
|
|
1615
|
+
color: "neutral",
|
|
1616
|
+
onClick: handleSwitchViewClick,
|
|
1617
|
+
"aria-label": "Switch Calendar View"
|
|
1618
|
+
},
|
|
1619
|
+
calendarTitle
|
|
1620
|
+
)
|
|
1621
|
+
), /* @__PURE__ */ import_react14.default.createElement(IconButton_default, { size: "sm", onClick: handleNextClick, "aria-label": `Next ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ import_react14.default.createElement(import_ChevronRight.default, null))), view === "day" && /* @__PURE__ */ import_react14.default.createElement(PickerDays, { ownerState }), view === "month" && /* @__PURE__ */ import_react14.default.createElement(PickerMonths, { ownerState }));
|
|
1524
1622
|
});
|
|
1525
1623
|
Calendar.displayName = "Calendar";
|
|
1526
1624
|
|
|
@@ -1528,31 +1626,31 @@ Calendar.displayName = "Calendar";
|
|
|
1528
1626
|
var Calendar_default = Calendar;
|
|
1529
1627
|
|
|
1530
1628
|
// src/components/Card/Card.tsx
|
|
1531
|
-
var
|
|
1532
|
-
var
|
|
1533
|
-
var MotionCard = (0,
|
|
1629
|
+
var import_joy20 = require("@mui/joy");
|
|
1630
|
+
var import_framer_motion14 = require("framer-motion");
|
|
1631
|
+
var MotionCard = (0, import_framer_motion14.motion)(import_joy20.Card);
|
|
1534
1632
|
var Card = MotionCard;
|
|
1535
1633
|
Card.displayName = "Card";
|
|
1536
|
-
var MotionCardContent = (0,
|
|
1634
|
+
var MotionCardContent = (0, import_framer_motion14.motion)(import_joy20.CardContent);
|
|
1537
1635
|
var CardContent = MotionCardContent;
|
|
1538
1636
|
CardContent.displayName = "CardContent";
|
|
1539
|
-
var MotionCardCover = (0,
|
|
1637
|
+
var MotionCardCover = (0, import_framer_motion14.motion)(import_joy20.CardCover);
|
|
1540
1638
|
var CardCover = MotionCardCover;
|
|
1541
1639
|
CardCover.displayName = "CardCover";
|
|
1542
|
-
var MotionCardActions = (0,
|
|
1640
|
+
var MotionCardActions = (0, import_framer_motion14.motion)(import_joy20.CardActions);
|
|
1543
1641
|
var CardActions = MotionCardActions;
|
|
1544
1642
|
CardActions.displayName = "CardActions";
|
|
1545
|
-
var MotionCardOverflow = (0,
|
|
1643
|
+
var MotionCardOverflow = (0, import_framer_motion14.motion)(import_joy20.CardOverflow);
|
|
1546
1644
|
var CardOverflow = MotionCardOverflow;
|
|
1547
1645
|
CardOverflow.displayName = "CardOverflow";
|
|
1548
1646
|
|
|
1549
1647
|
// src/components/Checkbox/Checkbox.tsx
|
|
1550
|
-
var
|
|
1551
|
-
var
|
|
1552
|
-
var
|
|
1553
|
-
var MotionCheckbox = (0,
|
|
1648
|
+
var import_react15 = __toESM(require("react"));
|
|
1649
|
+
var import_joy21 = require("@mui/joy");
|
|
1650
|
+
var import_framer_motion15 = require("framer-motion");
|
|
1651
|
+
var MotionCheckbox = (0, import_framer_motion15.motion)(import_joy21.Checkbox);
|
|
1554
1652
|
var Checkbox = (props) => {
|
|
1555
|
-
return /* @__PURE__ */
|
|
1653
|
+
return /* @__PURE__ */ import_react15.default.createElement(MotionCheckbox, { ...props });
|
|
1556
1654
|
};
|
|
1557
1655
|
Checkbox.displayName = "Checkbox";
|
|
1558
1656
|
|
|
@@ -1560,9 +1658,9 @@ Checkbox.displayName = "Checkbox";
|
|
|
1560
1658
|
var Checkbox_default = Checkbox;
|
|
1561
1659
|
|
|
1562
1660
|
// src/components/Container/Container.tsx
|
|
1563
|
-
var
|
|
1564
|
-
var
|
|
1565
|
-
var ContainerRoot = (0,
|
|
1661
|
+
var import_joy22 = require("@mui/joy");
|
|
1662
|
+
var import_react16 = __toESM(require("react"));
|
|
1663
|
+
var ContainerRoot = (0, import_joy22.styled)("div", {
|
|
1566
1664
|
name: "Container",
|
|
1567
1665
|
slot: "root",
|
|
1568
1666
|
shouldForwardProp: (prop) => prop !== "maxWidth" && prop !== "overrideBreakpoint"
|
|
@@ -1587,25 +1685,24 @@ var ContainerRoot = (0, import_joy21.styled)("div", {
|
|
|
1587
1685
|
paddingRight: theme.breakpoints.values[overrideBreakpoint] >= theme.breakpoints.values.lg ? theme.spacing(8) : theme.spacing(4)
|
|
1588
1686
|
} : null
|
|
1589
1687
|
]);
|
|
1590
|
-
var Container = (0,
|
|
1591
|
-
return /* @__PURE__ */
|
|
1688
|
+
var Container = (0, import_react16.forwardRef)(function Container2(props, ref) {
|
|
1689
|
+
return /* @__PURE__ */ import_react16.default.createElement(ContainerRoot, { ref, ...props });
|
|
1592
1690
|
});
|
|
1593
1691
|
Container.displayName = "Container";
|
|
1594
1692
|
|
|
1595
1693
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
1596
|
-
var
|
|
1597
|
-
var import_intl_messageformat2 = require("intl-messageformat");
|
|
1694
|
+
var import_react18 = __toESM(require("react"));
|
|
1598
1695
|
var import_react_number_format = require("react-number-format");
|
|
1599
1696
|
|
|
1600
1697
|
// src/components/Input/Input.tsx
|
|
1601
|
-
var
|
|
1602
|
-
var
|
|
1603
|
-
var
|
|
1698
|
+
var import_react17 = __toESM(require("react"));
|
|
1699
|
+
var import_joy23 = require("@mui/joy");
|
|
1700
|
+
var import_framer_motion16 = require("framer-motion");
|
|
1604
1701
|
var import_Close2 = __toESM(require("@mui/icons-material/Close"));
|
|
1605
1702
|
var import_Visibility = __toESM(require("@mui/icons-material/Visibility"));
|
|
1606
1703
|
var import_VisibilityOff = __toESM(require("@mui/icons-material/VisibilityOff"));
|
|
1607
|
-
var MotionInput = (0,
|
|
1608
|
-
var Input =
|
|
1704
|
+
var MotionInput = (0, import_framer_motion16.motion)(import_joy23.Input);
|
|
1705
|
+
var Input = import_react17.default.forwardRef((props, ref) => {
|
|
1609
1706
|
const {
|
|
1610
1707
|
label,
|
|
1611
1708
|
helperText,
|
|
@@ -1628,11 +1725,11 @@ var Input = import_react16.default.forwardRef((props, ref) => {
|
|
|
1628
1725
|
if (type === "password" && innerProps.endDecorator) {
|
|
1629
1726
|
console.warn('Input: endDecorator is not supported when type="password"');
|
|
1630
1727
|
}
|
|
1631
|
-
const [passwordVisible, setPasswordVisible] = (0,
|
|
1728
|
+
const [passwordVisible, setPasswordVisible] = (0, import_react17.useState)(false);
|
|
1632
1729
|
const [value, setValue] = useControlledState(
|
|
1633
1730
|
props.value,
|
|
1634
1731
|
props.defaultValue,
|
|
1635
|
-
(0,
|
|
1732
|
+
(0, import_react17.useCallback)(
|
|
1636
1733
|
(value2) => {
|
|
1637
1734
|
onChange?.({
|
|
1638
1735
|
/**
|
|
@@ -1658,7 +1755,7 @@ var Input = import_react16.default.forwardRef((props, ref) => {
|
|
|
1658
1755
|
const actualType = type === "password" && passwordVisible ? "text" : type;
|
|
1659
1756
|
const isPasswordType = type === "password";
|
|
1660
1757
|
const showPasswordToggle = isPasswordType && !disableTogglePasswordButton;
|
|
1661
|
-
const input = /* @__PURE__ */
|
|
1758
|
+
const input = /* @__PURE__ */ import_react17.default.createElement(
|
|
1662
1759
|
MotionInput,
|
|
1663
1760
|
{
|
|
1664
1761
|
value,
|
|
@@ -1673,7 +1770,7 @@ var Input = import_react16.default.forwardRef((props, ref) => {
|
|
|
1673
1770
|
...innerProps.slotProps
|
|
1674
1771
|
},
|
|
1675
1772
|
...innerProps,
|
|
1676
|
-
endDecorator: isPasswordType ? showPasswordToggle ? /* @__PURE__ */
|
|
1773
|
+
endDecorator: isPasswordType ? showPasswordToggle ? /* @__PURE__ */ import_react17.default.createElement(Stack_default, { gap: 1, direction: "row" }, /* @__PURE__ */ import_react17.default.createElement(
|
|
1677
1774
|
IconButton_default,
|
|
1678
1775
|
{
|
|
1679
1776
|
onMouseDown: (e) => e.preventDefault(),
|
|
@@ -1681,19 +1778,19 @@ var Input = import_react16.default.forwardRef((props, ref) => {
|
|
|
1681
1778
|
disabled,
|
|
1682
1779
|
"aria-label": passwordVisible ? "Hide password" : "Show password"
|
|
1683
1780
|
},
|
|
1684
|
-
passwordVisible ? /* @__PURE__ */
|
|
1685
|
-
)) : null : enableClearable ? /* @__PURE__ */
|
|
1781
|
+
passwordVisible ? /* @__PURE__ */ import_react17.default.createElement(import_VisibilityOff.default, null) : /* @__PURE__ */ import_react17.default.createElement(import_Visibility.default, null)
|
|
1782
|
+
)) : null : enableClearable ? /* @__PURE__ */ import_react17.default.createElement(Stack_default, { gap: 1, direction: "row" }, innerProps.endDecorator, value && /* @__PURE__ */ import_react17.default.createElement(
|
|
1686
1783
|
IconButton_default,
|
|
1687
1784
|
{
|
|
1688
1785
|
onMouseDown: (e) => e.preventDefault(),
|
|
1689
1786
|
onClick: handleClear,
|
|
1690
1787
|
"aria-label": "Clear"
|
|
1691
1788
|
},
|
|
1692
|
-
/* @__PURE__ */
|
|
1789
|
+
/* @__PURE__ */ import_react17.default.createElement(import_Close2.default, null)
|
|
1693
1790
|
)) : innerProps.endDecorator
|
|
1694
1791
|
}
|
|
1695
1792
|
);
|
|
1696
|
-
return /* @__PURE__ */
|
|
1793
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
1697
1794
|
FormControl_default,
|
|
1698
1795
|
{
|
|
1699
1796
|
required,
|
|
@@ -1704,9 +1801,9 @@ var Input = import_react16.default.forwardRef((props, ref) => {
|
|
|
1704
1801
|
sx,
|
|
1705
1802
|
className
|
|
1706
1803
|
},
|
|
1707
|
-
label && /* @__PURE__ */
|
|
1804
|
+
label && /* @__PURE__ */ import_react17.default.createElement(FormLabel_default, null, label),
|
|
1708
1805
|
input,
|
|
1709
|
-
helperText && /* @__PURE__ */
|
|
1806
|
+
helperText && /* @__PURE__ */ import_react17.default.createElement(FormHelperText_default, null, helperText)
|
|
1710
1807
|
);
|
|
1711
1808
|
});
|
|
1712
1809
|
Input.displayName = "Input";
|
|
@@ -1715,10 +1812,9 @@ Input.displayName = "Input";
|
|
|
1715
1812
|
var Input_default = Input;
|
|
1716
1813
|
|
|
1717
1814
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
1718
|
-
var
|
|
1815
|
+
var import_joy24 = require("@mui/joy");
|
|
1719
1816
|
|
|
1720
1817
|
// src/components/CurrencyInput/hooks/use-currency-setting.ts
|
|
1721
|
-
var import_intl_messageformat = __toESM(require("intl-messageformat"));
|
|
1722
1818
|
var CURRENCY_DECIMAL_MAP = {
|
|
1723
1819
|
AED: 2,
|
|
1724
1820
|
ALL: 2,
|
|
@@ -1863,9 +1959,10 @@ var CURRENCY_DECIMAL_MAP = {
|
|
|
1863
1959
|
};
|
|
1864
1960
|
var useCurrencySetting = (props) => {
|
|
1865
1961
|
const { currency = "USD", placeholder } = props;
|
|
1866
|
-
const
|
|
1867
|
-
|
|
1868
|
-
|
|
1962
|
+
const parts = new Intl.NumberFormat("en-US", { style: "currency", currency }).formatToParts(1000.01);
|
|
1963
|
+
const symbol = parts.find((p) => p.type === "currency")?.value ?? "$";
|
|
1964
|
+
const thousandSeparator = parts.find((p) => p.type === "group")?.value ?? ",";
|
|
1965
|
+
const decimalSeparator = parts.find((p) => p.type === "decimal")?.value;
|
|
1869
1966
|
const decimalScale = CURRENCY_DECIMAL_MAP[currency];
|
|
1870
1967
|
return {
|
|
1871
1968
|
symbol: `${symbol} `,
|
|
@@ -1878,9 +1975,9 @@ var useCurrencySetting = (props) => {
|
|
|
1878
1975
|
};
|
|
1879
1976
|
|
|
1880
1977
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
1881
|
-
var TextMaskAdapter =
|
|
1978
|
+
var TextMaskAdapter = import_react18.default.forwardRef(function TextMaskAdapter2(props, ref) {
|
|
1882
1979
|
const { onChange, ...innerProps } = props;
|
|
1883
|
-
return /* @__PURE__ */
|
|
1980
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
1884
1981
|
import_react_number_format.NumericFormat,
|
|
1885
1982
|
{
|
|
1886
1983
|
...innerProps,
|
|
@@ -1895,13 +1992,13 @@ var TextMaskAdapter = import_react17.default.forwardRef(function TextMaskAdapter
|
|
|
1895
1992
|
}
|
|
1896
1993
|
);
|
|
1897
1994
|
});
|
|
1898
|
-
var CurrencyInputRoot = (0,
|
|
1995
|
+
var CurrencyInputRoot = (0, import_joy24.styled)(Input_default, {
|
|
1899
1996
|
name: "CurrencyInput",
|
|
1900
1997
|
slot: "root",
|
|
1901
1998
|
overridesResolver: (props, styles) => styles.root
|
|
1902
1999
|
})({});
|
|
1903
|
-
var CurrencyInput =
|
|
1904
|
-
const props = (0,
|
|
2000
|
+
var CurrencyInput = import_react18.default.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
2001
|
+
const props = (0, import_joy24.useThemeProps)({ props: inProps, name: "CurrencyInput" });
|
|
1905
2002
|
const {
|
|
1906
2003
|
currency = "USD",
|
|
1907
2004
|
name,
|
|
@@ -1921,28 +2018,28 @@ var CurrencyInput = import_react17.default.forwardRef(function CurrencyInput2(in
|
|
|
1921
2018
|
const [_value, setValue] = useControlledState(
|
|
1922
2019
|
props.value,
|
|
1923
2020
|
props.defaultValue,
|
|
1924
|
-
(0,
|
|
2021
|
+
(0, import_react18.useCallback)((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
1925
2022
|
);
|
|
1926
|
-
const value = (0,
|
|
2023
|
+
const value = (0, import_react18.useMemo)(() => {
|
|
1927
2024
|
if (_value && useMinorUnit) {
|
|
1928
2025
|
return _value / Math.pow(10, decimalScale);
|
|
1929
2026
|
}
|
|
1930
2027
|
return _value;
|
|
1931
2028
|
}, [_value, useMinorUnit, decimalScale]);
|
|
1932
|
-
const max = (0,
|
|
2029
|
+
const max = (0, import_react18.useMemo)(() => {
|
|
1933
2030
|
if (props.max && useMinorUnit) {
|
|
1934
2031
|
return props.max / Math.pow(10, decimalScale);
|
|
1935
2032
|
}
|
|
1936
2033
|
return props.max;
|
|
1937
2034
|
}, [props.max, useMinorUnit, decimalScale]);
|
|
1938
|
-
const [isOverLimit, setIsOverLimit] = (0,
|
|
1939
|
-
const handleChange = (0,
|
|
2035
|
+
const [isOverLimit, setIsOverLimit] = (0, import_react18.useState)(!!max && !!value && value > max);
|
|
2036
|
+
const handleChange = (0, import_react18.useCallback)(
|
|
1940
2037
|
(event) => {
|
|
1941
2038
|
if (event.target.value === "") {
|
|
1942
2039
|
setValue(void 0);
|
|
1943
2040
|
return;
|
|
1944
2041
|
}
|
|
1945
|
-
const amount = useMinorUnit ? Number(event.target.value?.replace(decimalSeparator, "")) : Number(event.target.value);
|
|
2042
|
+
const amount = useMinorUnit ? Number(decimalSeparator ? event.target.value?.replace(decimalSeparator, "") : event.target.value) : Number(event.target.value);
|
|
1946
2043
|
if (!!max && Number(event.target.value) > max) {
|
|
1947
2044
|
setIsOverLimit(true);
|
|
1948
2045
|
} else {
|
|
@@ -1952,7 +2049,7 @@ var CurrencyInput = import_react17.default.forwardRef(function CurrencyInput2(in
|
|
|
1952
2049
|
},
|
|
1953
2050
|
[decimalSeparator, max, useMinorUnit, setValue]
|
|
1954
2051
|
);
|
|
1955
|
-
return /* @__PURE__ */
|
|
2052
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
1956
2053
|
CurrencyInputRoot,
|
|
1957
2054
|
{
|
|
1958
2055
|
...innerProps,
|
|
@@ -1965,9 +2062,7 @@ var CurrencyInput = import_react17.default.forwardRef(function CurrencyInput2(in
|
|
|
1965
2062
|
required,
|
|
1966
2063
|
color: error || isOverLimit ? "danger" : props.color,
|
|
1967
2064
|
label,
|
|
1968
|
-
helperText: isOverLimit ?
|
|
1969
|
-
amount: max
|
|
1970
|
-
}) : helperText,
|
|
2065
|
+
helperText: isOverLimit ? `limit: ${new Intl.NumberFormat("en-US", { style: "currency", currency }).format(max)}` : helperText,
|
|
1971
2066
|
slotProps: {
|
|
1972
2067
|
input: {
|
|
1973
2068
|
component: TextMaskAdapter,
|
|
@@ -2039,14 +2134,15 @@ function reorderColumnsByGroupingModel(columns, columnGroupingModel) {
|
|
|
2039
2134
|
}
|
|
2040
2135
|
return reorderedColumns;
|
|
2041
2136
|
}
|
|
2042
|
-
function flattenColumnGroups(items, groupPath = [], columnIndex = { current: 0 }) {
|
|
2137
|
+
function flattenColumnGroups(items, groupPath = [], columnIndex = { current: 0 }, visibleFields) {
|
|
2043
2138
|
const result = [];
|
|
2044
2139
|
for (const item of items) {
|
|
2045
2140
|
if ("groupId" in item) {
|
|
2046
2141
|
const newPath = [...groupPath, item.groupId];
|
|
2047
2142
|
const children = Array.isArray(item.children) ? item.children : [item.children];
|
|
2048
|
-
result.push(...flattenColumnGroups(children, newPath, columnIndex));
|
|
2143
|
+
result.push(...flattenColumnGroups(children, newPath, columnIndex, visibleFields));
|
|
2049
2144
|
} else {
|
|
2145
|
+
if (visibleFields && !visibleFields.has(item.field)) continue;
|
|
2050
2146
|
result.push({
|
|
2051
2147
|
...item,
|
|
2052
2148
|
groupPath,
|
|
@@ -2056,9 +2152,9 @@ function flattenColumnGroups(items, groupPath = [], columnIndex = { current: 0 }
|
|
|
2056
2152
|
}
|
|
2057
2153
|
return result;
|
|
2058
2154
|
}
|
|
2059
|
-
function calculateColumnGroups(columnGroupingModel, columns) {
|
|
2155
|
+
function calculateColumnGroups(columnGroupingModel, columns, visibleFields) {
|
|
2060
2156
|
const fieldsInGroupingModel = extractFieldsFromGroupingModel(columnGroupingModel);
|
|
2061
|
-
const flattenedColumns = flattenColumnGroups(columnGroupingModel);
|
|
2157
|
+
const flattenedColumns = flattenColumnGroups(columnGroupingModel, [], { current: 0 }, visibleFields);
|
|
2062
2158
|
const columnIndexMap = new Map(flattenedColumns.map((col) => [col.field, col.columnIndex]));
|
|
2063
2159
|
const processedGroups = /* @__PURE__ */ new Map();
|
|
2064
2160
|
const groupsByLevel = [];
|
|
@@ -2106,7 +2202,9 @@ function calculateColumnGroups(columnGroupingModel, columns) {
|
|
|
2106
2202
|
groupsByLevel.forEach((level) => {
|
|
2107
2203
|
level.sort((a, b) => a.startIndex - b.startIndex);
|
|
2108
2204
|
});
|
|
2109
|
-
|
|
2205
|
+
const filteredGroupsByLevel = groupsByLevel.map((level) => level.filter((g) => g.colspan > 0)).filter((level) => level.length > 0);
|
|
2206
|
+
const correctedMaxLevel = filteredGroupsByLevel.length > 0 ? filteredGroupsByLevel.length - 1 : -1;
|
|
2207
|
+
return { groups: filteredGroupsByLevel, maxLevel: correctedMaxLevel, fieldsInGroupingModel };
|
|
2110
2208
|
}
|
|
2111
2209
|
function getTextAlign(props) {
|
|
2112
2210
|
return !props.editMode && ["number", "date", "currency"].includes(props.type || "") ? "end" : "start";
|
|
@@ -2114,19 +2212,29 @@ function getTextAlign(props) {
|
|
|
2114
2212
|
var numberFormatter = (value) => "Intl" in window ? new Intl.NumberFormat().format(value) : value;
|
|
2115
2213
|
|
|
2116
2214
|
// src/components/DataTable/styled.tsx
|
|
2117
|
-
var
|
|
2118
|
-
var
|
|
2119
|
-
var
|
|
2215
|
+
var import_react19 = __toESM(require("react"));
|
|
2216
|
+
var import_joy25 = require("@mui/joy");
|
|
2217
|
+
var import_framer_motion17 = require("framer-motion");
|
|
2120
2218
|
var import_ArrowUpwardRounded = __toESM(require("@mui/icons-material/ArrowUpwardRounded"));
|
|
2121
|
-
var EllipsisDiv = (0,
|
|
2219
|
+
var EllipsisDiv = (0, import_joy25.styled)("div", {
|
|
2122
2220
|
name: "DataTable",
|
|
2123
|
-
slot: "textEllipsis"
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2221
|
+
slot: "textEllipsis",
|
|
2222
|
+
shouldForwardProp: (prop) => prop !== "lineClamp"
|
|
2223
|
+
})(
|
|
2224
|
+
({ lineClamp }) => lineClamp && lineClamp > 1 ? {
|
|
2225
|
+
overflow: "hidden",
|
|
2226
|
+
display: "-webkit-box !important",
|
|
2227
|
+
WebkitBoxOrient: "vertical",
|
|
2228
|
+
WebkitLineClamp: lineClamp,
|
|
2229
|
+
whiteSpace: "normal",
|
|
2230
|
+
overflowWrap: "anywhere"
|
|
2231
|
+
} : {
|
|
2232
|
+
overflow: "hidden",
|
|
2233
|
+
textOverflow: "ellipsis",
|
|
2234
|
+
whiteSpace: "nowrap"
|
|
2235
|
+
}
|
|
2236
|
+
);
|
|
2237
|
+
var OverlayWrapper = (0, import_joy25.styled)("tr", {
|
|
2130
2238
|
name: "DataTable",
|
|
2131
2239
|
slot: "overlayWrapper"
|
|
2132
2240
|
})({
|
|
@@ -2141,7 +2249,7 @@ var OverlayWrapper = (0, import_joy24.styled)("tr", {
|
|
|
2141
2249
|
border: "none !important"
|
|
2142
2250
|
}
|
|
2143
2251
|
});
|
|
2144
|
-
var VirtualizedTableBody = (0,
|
|
2252
|
+
var VirtualizedTableBody = (0, import_joy25.styled)("tbody", {
|
|
2145
2253
|
name: "DataTable",
|
|
2146
2254
|
slot: "tableBody"
|
|
2147
2255
|
})({
|
|
@@ -2150,21 +2258,21 @@ var VirtualizedTableBody = (0, import_joy24.styled)("tbody", {
|
|
|
2150
2258
|
display: "block",
|
|
2151
2259
|
height: "0.01em"
|
|
2152
2260
|
},
|
|
2153
|
-
[`& .${
|
|
2261
|
+
[`& .${import_joy25.buttonClasses.root}`]: {
|
|
2154
2262
|
"--Button-minHeight": "26px",
|
|
2155
2263
|
"--Button-paddingBlock": "0.25rem",
|
|
2156
2264
|
lineHeight: 1,
|
|
2157
2265
|
marginTop: "-2px",
|
|
2158
2266
|
marginBottom: "-2px"
|
|
2159
2267
|
},
|
|
2160
|
-
[`& .${
|
|
2268
|
+
[`& .${import_joy25.iconButtonClasses.root}`]: {
|
|
2161
2269
|
"--IconButton-size": "26px",
|
|
2162
2270
|
verticalAlign: "middle",
|
|
2163
2271
|
marginTop: "-2px",
|
|
2164
2272
|
marginBottom: "-2px"
|
|
2165
2273
|
}
|
|
2166
2274
|
});
|
|
2167
|
-
var StyledTableRow = (0,
|
|
2275
|
+
var StyledTableRow = (0, import_joy25.styled)("tr", {
|
|
2168
2276
|
name: "DataTable",
|
|
2169
2277
|
slot: "tableRow",
|
|
2170
2278
|
shouldForwardProp: (prop) => prop !== "striped"
|
|
@@ -2183,17 +2291,17 @@ var StyledTableRow = (0, import_joy24.styled)("tr", {
|
|
|
2183
2291
|
}
|
|
2184
2292
|
}
|
|
2185
2293
|
}));
|
|
2186
|
-
var Asterisk = (0,
|
|
2294
|
+
var Asterisk = (0, import_joy25.styled)("span", {
|
|
2187
2295
|
name: "DataTable",
|
|
2188
2296
|
slot: "headCellAsterisk"
|
|
2189
2297
|
})(({ theme }) => ({
|
|
2190
2298
|
color: "var(--ceed-palette-danger-500)",
|
|
2191
2299
|
marginLeft: theme.spacing(0.5)
|
|
2192
2300
|
}));
|
|
2193
|
-
var StyledTh = (0,
|
|
2301
|
+
var StyledTh = (0, import_joy25.styled)(import_framer_motion17.motion.th)(({ theme }) => ({
|
|
2194
2302
|
boxShadow: "1px 0 var(--TableCell-borderColor)"
|
|
2195
2303
|
}));
|
|
2196
|
-
var StyledTd = (0,
|
|
2304
|
+
var StyledTd = (0, import_joy25.styled)("td")(({ theme }) => ({
|
|
2197
2305
|
transition: `box-shadow 0.3s`,
|
|
2198
2306
|
"&:not(.is-last-left):not(.is-last-right)": {
|
|
2199
2307
|
boxShadow: "1px 0 var(--TableCell-borderColor)"
|
|
@@ -2209,9 +2317,9 @@ var StyledTd = (0, import_joy24.styled)("td")(({ theme }) => ({
|
|
|
2209
2317
|
}
|
|
2210
2318
|
}
|
|
2211
2319
|
}));
|
|
2212
|
-
var MotionSortIcon = (0,
|
|
2213
|
-
var DefaultLoadingOverlay = () => /* @__PURE__ */
|
|
2214
|
-
var Resizer = (ref, targetRef = ref) => /* @__PURE__ */
|
|
2320
|
+
var MotionSortIcon = (0, import_framer_motion17.motion)(import_ArrowUpwardRounded.default);
|
|
2321
|
+
var DefaultLoadingOverlay = () => /* @__PURE__ */ import_react19.default.createElement(import_joy25.LinearProgress, { value: 8, variant: "plain" });
|
|
2322
|
+
var Resizer = (ref, targetRef = ref) => /* @__PURE__ */ import_react19.default.createElement(
|
|
2215
2323
|
Box_default,
|
|
2216
2324
|
{
|
|
2217
2325
|
sx: {
|
|
@@ -2248,24 +2356,24 @@ var import_joy32 = require("@mui/joy");
|
|
|
2248
2356
|
var import_framer_motion21 = require("framer-motion");
|
|
2249
2357
|
|
|
2250
2358
|
// src/components/DatePicker/DatePicker.tsx
|
|
2251
|
-
var
|
|
2359
|
+
var import_react20 = __toESM(require("react"));
|
|
2252
2360
|
var import_react_imask = require("react-imask");
|
|
2253
2361
|
var import_CalendarToday = __toESM(require("@mui/icons-material/CalendarToday"));
|
|
2254
|
-
var
|
|
2362
|
+
var import_joy28 = require("@mui/joy");
|
|
2255
2363
|
var import_base3 = require("@mui/base");
|
|
2256
2364
|
|
|
2257
2365
|
// src/components/Sheet/Sheet.tsx
|
|
2258
|
-
var
|
|
2259
|
-
var Sheet =
|
|
2366
|
+
var import_joy26 = require("@mui/joy");
|
|
2367
|
+
var Sheet = import_joy26.Sheet;
|
|
2260
2368
|
|
|
2261
2369
|
// src/components/Sheet/index.ts
|
|
2262
2370
|
var Sheet_default = Sheet;
|
|
2263
2371
|
|
|
2264
2372
|
// src/components/DialogActions/DialogActions.tsx
|
|
2265
|
-
var
|
|
2266
|
-
var
|
|
2267
|
-
var MotionDialogActions = (0,
|
|
2268
|
-
var StyledDialogActions = (0,
|
|
2373
|
+
var import_joy27 = require("@mui/joy");
|
|
2374
|
+
var import_framer_motion18 = require("framer-motion");
|
|
2375
|
+
var MotionDialogActions = (0, import_framer_motion18.motion)(import_joy27.DialogActions);
|
|
2376
|
+
var StyledDialogActions = (0, import_joy27.styled)(MotionDialogActions)(({ theme }) => ({
|
|
2269
2377
|
padding: theme.spacing(2),
|
|
2270
2378
|
gap: theme.spacing(2),
|
|
2271
2379
|
flexDirection: "row",
|
|
@@ -2278,7 +2386,7 @@ DialogActions.displayName = "DialogActions";
|
|
|
2278
2386
|
var DialogActions_default = DialogActions;
|
|
2279
2387
|
|
|
2280
2388
|
// src/components/DatePicker/DatePicker.tsx
|
|
2281
|
-
var CalendarButton = (0,
|
|
2389
|
+
var CalendarButton = (0, import_joy28.styled)(IconButton_default, {
|
|
2282
2390
|
name: "DatePicker",
|
|
2283
2391
|
slot: "calendarButton"
|
|
2284
2392
|
})(({ theme }) => ({
|
|
@@ -2288,13 +2396,13 @@ var CalendarButton = (0, import_joy27.styled)(IconButton_default, {
|
|
|
2288
2396
|
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar("palette-focusVisible")}`
|
|
2289
2397
|
}
|
|
2290
2398
|
}));
|
|
2291
|
-
var StyledPopper = (0,
|
|
2399
|
+
var StyledPopper = (0, import_joy28.styled)(import_base3.Popper, {
|
|
2292
2400
|
name: "DatePicker",
|
|
2293
2401
|
slot: "popper"
|
|
2294
2402
|
})(({ theme }) => ({
|
|
2295
2403
|
zIndex: theme.zIndex.tooltip
|
|
2296
2404
|
}));
|
|
2297
|
-
var CalendarSheet = (0,
|
|
2405
|
+
var CalendarSheet = (0, import_joy28.styled)(Sheet_default, {
|
|
2298
2406
|
name: "DatePicker",
|
|
2299
2407
|
slot: "sheet",
|
|
2300
2408
|
overridesResolver: (props, styles) => styles.root
|
|
@@ -2303,7 +2411,7 @@ var CalendarSheet = (0, import_joy27.styled)(Sheet_default, {
|
|
|
2303
2411
|
boxShadow: theme.shadow.md,
|
|
2304
2412
|
borderRadius: theme.radius.md
|
|
2305
2413
|
}));
|
|
2306
|
-
var DatePickerRoot = (0,
|
|
2414
|
+
var DatePickerRoot = (0, import_joy28.styled)("div", {
|
|
2307
2415
|
name: "DatePicker",
|
|
2308
2416
|
slot: "root",
|
|
2309
2417
|
overridesResolver: (props, styles) => styles.root
|
|
@@ -2360,9 +2468,9 @@ function parseDate(dateString, format) {
|
|
|
2360
2468
|
var formatToPattern = (format) => {
|
|
2361
2469
|
return format.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
2362
2470
|
};
|
|
2363
|
-
var TextMaskAdapter3 =
|
|
2471
|
+
var TextMaskAdapter3 = import_react20.default.forwardRef(function TextMaskAdapter4(props, ref) {
|
|
2364
2472
|
const { onChange, format, ...other } = props;
|
|
2365
|
-
return /* @__PURE__ */
|
|
2473
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
2366
2474
|
import_react_imask.IMaskInput,
|
|
2367
2475
|
{
|
|
2368
2476
|
...other,
|
|
@@ -2397,8 +2505,8 @@ var TextMaskAdapter3 = import_react19.default.forwardRef(function TextMaskAdapte
|
|
|
2397
2505
|
}
|
|
2398
2506
|
);
|
|
2399
2507
|
});
|
|
2400
|
-
var DatePicker = (0,
|
|
2401
|
-
const props = (0,
|
|
2508
|
+
var DatePicker = (0, import_react20.forwardRef)((inProps, ref) => {
|
|
2509
|
+
const props = (0, import_joy28.useThemeProps)({ props: inProps, name: "DatePicker" });
|
|
2402
2510
|
const {
|
|
2403
2511
|
onChange,
|
|
2404
2512
|
disabled,
|
|
@@ -2422,24 +2530,24 @@ var DatePicker = (0, import_react19.forwardRef)((inProps, ref) => {
|
|
|
2422
2530
|
shouldDisableDate,
|
|
2423
2531
|
...innerProps
|
|
2424
2532
|
} = props;
|
|
2425
|
-
const innerRef = (0,
|
|
2426
|
-
const buttonRef = (0,
|
|
2533
|
+
const innerRef = (0, import_react20.useRef)(null);
|
|
2534
|
+
const buttonRef = (0, import_react20.useRef)(null);
|
|
2427
2535
|
const [value, setValue] = useControlledState(
|
|
2428
2536
|
props.value,
|
|
2429
2537
|
props.defaultValue || "",
|
|
2430
|
-
(0,
|
|
2538
|
+
(0, import_react20.useCallback)((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
2431
2539
|
);
|
|
2432
|
-
const [displayValue, setDisplayValue] = (0,
|
|
2540
|
+
const [displayValue, setDisplayValue] = (0, import_react20.useState)(
|
|
2433
2541
|
() => value ? formatValueString(parseDate(value, format), displayFormat) : ""
|
|
2434
2542
|
);
|
|
2435
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
2543
|
+
const [anchorEl, setAnchorEl] = (0, import_react20.useState)(null);
|
|
2436
2544
|
const open = Boolean(anchorEl);
|
|
2437
|
-
(0,
|
|
2545
|
+
(0, import_react20.useEffect)(() => {
|
|
2438
2546
|
if (!anchorEl) {
|
|
2439
2547
|
innerRef.current?.blur();
|
|
2440
2548
|
}
|
|
2441
2549
|
}, [anchorEl, innerRef]);
|
|
2442
|
-
(0,
|
|
2550
|
+
(0, import_react20.useEffect)(() => {
|
|
2443
2551
|
if (value === "") {
|
|
2444
2552
|
setDisplayValue("");
|
|
2445
2553
|
return;
|
|
@@ -2449,8 +2557,8 @@ var DatePicker = (0, import_react19.forwardRef)((inProps, ref) => {
|
|
|
2449
2557
|
setDisplayValue(formattedValue);
|
|
2450
2558
|
}
|
|
2451
2559
|
}, [displayFormat, displayValue, format, value]);
|
|
2452
|
-
(0,
|
|
2453
|
-
const handleChange = (0,
|
|
2560
|
+
(0, import_react20.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
2561
|
+
const handleChange = (0, import_react20.useCallback)(
|
|
2454
2562
|
(event) => {
|
|
2455
2563
|
const value2 = event.target.value;
|
|
2456
2564
|
setDisplayValue(value2 ? formatValueString(parseDate(value2, format), displayFormat) : value2);
|
|
@@ -2458,7 +2566,7 @@ var DatePicker = (0, import_react19.forwardRef)((inProps, ref) => {
|
|
|
2458
2566
|
},
|
|
2459
2567
|
[displayFormat, format, setValue]
|
|
2460
2568
|
);
|
|
2461
|
-
const handleDisplayInputChange = (0,
|
|
2569
|
+
const handleDisplayInputChange = (0, import_react20.useCallback)(
|
|
2462
2570
|
(event) => {
|
|
2463
2571
|
if (event.target.value === "") {
|
|
2464
2572
|
handleChange({
|
|
@@ -2483,7 +2591,7 @@ var DatePicker = (0, import_react19.forwardRef)((inProps, ref) => {
|
|
|
2483
2591
|
},
|
|
2484
2592
|
[displayFormat, format, handleChange, props.name]
|
|
2485
2593
|
);
|
|
2486
|
-
const handleCalendarToggle = (0,
|
|
2594
|
+
const handleCalendarToggle = (0, import_react20.useCallback)(
|
|
2487
2595
|
(event) => {
|
|
2488
2596
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
2489
2597
|
setTimeout(() => {
|
|
@@ -2492,7 +2600,7 @@ var DatePicker = (0, import_react19.forwardRef)((inProps, ref) => {
|
|
|
2492
2600
|
},
|
|
2493
2601
|
[anchorEl, setAnchorEl, innerRef]
|
|
2494
2602
|
);
|
|
2495
|
-
const handleInputMouseDown = (0,
|
|
2603
|
+
const handleInputMouseDown = (0, import_react20.useCallback)(
|
|
2496
2604
|
(event) => {
|
|
2497
2605
|
if (inputReadOnly) {
|
|
2498
2606
|
event.preventDefault();
|
|
@@ -2501,7 +2609,7 @@ var DatePicker = (0, import_react19.forwardRef)((inProps, ref) => {
|
|
|
2501
2609
|
},
|
|
2502
2610
|
[inputReadOnly, buttonRef]
|
|
2503
2611
|
);
|
|
2504
|
-
return /* @__PURE__ */
|
|
2612
|
+
return /* @__PURE__ */ import_react20.default.createElement(DatePickerRoot, null, /* @__PURE__ */ import_react20.default.createElement(import_base3.FocusTrap, { open: true }, /* @__PURE__ */ import_react20.default.createElement(import_react20.default.Fragment, null, /* @__PURE__ */ import_react20.default.createElement(
|
|
2505
2613
|
Input_default,
|
|
2506
2614
|
{
|
|
2507
2615
|
...innerProps,
|
|
@@ -2529,7 +2637,7 @@ var DatePicker = (0, import_react19.forwardRef)((inProps, ref) => {
|
|
|
2529
2637
|
},
|
|
2530
2638
|
className,
|
|
2531
2639
|
sx,
|
|
2532
|
-
endDecorator: /* @__PURE__ */
|
|
2640
|
+
endDecorator: /* @__PURE__ */ import_react20.default.createElement(
|
|
2533
2641
|
CalendarButton,
|
|
2534
2642
|
{
|
|
2535
2643
|
ref: buttonRef,
|
|
@@ -2541,13 +2649,13 @@ var DatePicker = (0, import_react19.forwardRef)((inProps, ref) => {
|
|
|
2541
2649
|
"aria-expanded": open,
|
|
2542
2650
|
disabled
|
|
2543
2651
|
},
|
|
2544
|
-
/* @__PURE__ */
|
|
2652
|
+
/* @__PURE__ */ import_react20.default.createElement(import_CalendarToday.default, null)
|
|
2545
2653
|
),
|
|
2546
2654
|
label,
|
|
2547
2655
|
helperText,
|
|
2548
2656
|
readOnly: readOnly || inputReadOnly
|
|
2549
2657
|
}
|
|
2550
|
-
), open && /* @__PURE__ */
|
|
2658
|
+
), open && /* @__PURE__ */ import_react20.default.createElement(import_base3.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react20.default.createElement(
|
|
2551
2659
|
StyledPopper,
|
|
2552
2660
|
{
|
|
2553
2661
|
id: "date-picker-popper",
|
|
@@ -2566,7 +2674,7 @@ var DatePicker = (0, import_react19.forwardRef)((inProps, ref) => {
|
|
|
2566
2674
|
"aria-label": "Calendar Tooltip",
|
|
2567
2675
|
"aria-expanded": open
|
|
2568
2676
|
},
|
|
2569
|
-
/* @__PURE__ */
|
|
2677
|
+
/* @__PURE__ */ import_react20.default.createElement(CalendarSheet, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react20.default.createElement(
|
|
2570
2678
|
Calendar_default,
|
|
2571
2679
|
{
|
|
2572
2680
|
value: value && !Number.isNaN(parseDate(value, format).getTime()) ? [parseDate(value, format), void 0] : void 0,
|
|
@@ -2585,14 +2693,14 @@ var DatePicker = (0, import_react19.forwardRef)((inProps, ref) => {
|
|
|
2585
2693
|
disablePast,
|
|
2586
2694
|
shouldDisableDate: shouldDisableDate ? (date) => shouldDisableDate(formatValueString(date, format)) : void 0
|
|
2587
2695
|
}
|
|
2588
|
-
), !hideClearButton && /* @__PURE__ */
|
|
2696
|
+
), !hideClearButton && /* @__PURE__ */ import_react20.default.createElement(
|
|
2589
2697
|
DialogActions_default,
|
|
2590
2698
|
{
|
|
2591
2699
|
sx: {
|
|
2592
2700
|
p: 1
|
|
2593
2701
|
}
|
|
2594
2702
|
},
|
|
2595
|
-
/* @__PURE__ */
|
|
2703
|
+
/* @__PURE__ */ import_react20.default.createElement(
|
|
2596
2704
|
Button_default,
|
|
2597
2705
|
{
|
|
2598
2706
|
size,
|
|
@@ -2618,10 +2726,10 @@ var DatePicker = (0, import_react19.forwardRef)((inProps, ref) => {
|
|
|
2618
2726
|
var DatePicker_default = DatePicker;
|
|
2619
2727
|
|
|
2620
2728
|
// src/components/Textarea/Textarea.tsx
|
|
2621
|
-
var
|
|
2622
|
-
var
|
|
2623
|
-
var
|
|
2624
|
-
var MotionTextarea = (0,
|
|
2729
|
+
var import_react21 = __toESM(require("react"));
|
|
2730
|
+
var import_joy29 = require("@mui/joy");
|
|
2731
|
+
var import_framer_motion19 = require("framer-motion");
|
|
2732
|
+
var MotionTextarea = (0, import_framer_motion19.motion)(import_joy29.Textarea);
|
|
2625
2733
|
var Textarea = (props) => {
|
|
2626
2734
|
const {
|
|
2627
2735
|
label,
|
|
@@ -2638,7 +2746,7 @@ var Textarea = (props) => {
|
|
|
2638
2746
|
className,
|
|
2639
2747
|
...innerProps
|
|
2640
2748
|
} = props;
|
|
2641
|
-
const textarea = /* @__PURE__ */
|
|
2749
|
+
const textarea = /* @__PURE__ */ import_react21.default.createElement(
|
|
2642
2750
|
MotionTextarea,
|
|
2643
2751
|
{
|
|
2644
2752
|
required,
|
|
@@ -2650,7 +2758,7 @@ var Textarea = (props) => {
|
|
|
2650
2758
|
...innerProps
|
|
2651
2759
|
}
|
|
2652
2760
|
);
|
|
2653
|
-
return /* @__PURE__ */
|
|
2761
|
+
return /* @__PURE__ */ import_react21.default.createElement(
|
|
2654
2762
|
FormControl_default,
|
|
2655
2763
|
{
|
|
2656
2764
|
required,
|
|
@@ -2661,9 +2769,9 @@ var Textarea = (props) => {
|
|
|
2661
2769
|
sx,
|
|
2662
2770
|
className
|
|
2663
2771
|
},
|
|
2664
|
-
label && /* @__PURE__ */
|
|
2772
|
+
label && /* @__PURE__ */ import_react21.default.createElement(FormLabel_default, null, label),
|
|
2665
2773
|
textarea,
|
|
2666
|
-
helperText && /* @__PURE__ */
|
|
2774
|
+
helperText && /* @__PURE__ */ import_react21.default.createElement(FormHelperText_default, null, helperText)
|
|
2667
2775
|
);
|
|
2668
2776
|
};
|
|
2669
2777
|
Textarea.displayName = "Textarea";
|
|
@@ -2672,10 +2780,10 @@ Textarea.displayName = "Textarea";
|
|
|
2672
2780
|
var Textarea_default = Textarea;
|
|
2673
2781
|
|
|
2674
2782
|
// src/components/Select/Select.tsx
|
|
2675
|
-
var
|
|
2676
|
-
var
|
|
2677
|
-
var
|
|
2678
|
-
var MotionOption = (0,
|
|
2783
|
+
var import_react22 = __toESM(require("react"));
|
|
2784
|
+
var import_joy30 = require("@mui/joy");
|
|
2785
|
+
var import_framer_motion20 = require("framer-motion");
|
|
2786
|
+
var MotionOption = (0, import_framer_motion20.motion)(import_joy30.Option);
|
|
2679
2787
|
var Option = MotionOption;
|
|
2680
2788
|
var secondaryTextLevelMap2 = {
|
|
2681
2789
|
sm: "body-xs",
|
|
@@ -2698,7 +2806,7 @@ function Select(props) {
|
|
|
2698
2806
|
className,
|
|
2699
2807
|
...innerProps
|
|
2700
2808
|
} = props;
|
|
2701
|
-
const options = (0,
|
|
2809
|
+
const options = (0, import_react22.useMemo)(
|
|
2702
2810
|
() => props.options.map((option) => {
|
|
2703
2811
|
if (option.hasOwnProperty("value") && option.hasOwnProperty("label")) {
|
|
2704
2812
|
return option;
|
|
@@ -2723,15 +2831,15 @@ function Select(props) {
|
|
|
2723
2831
|
};
|
|
2724
2832
|
onChange?.(newEvent, newValue);
|
|
2725
2833
|
};
|
|
2726
|
-
const optionMap = (0,
|
|
2834
|
+
const optionMap = (0, import_react22.useMemo)(() => {
|
|
2727
2835
|
const map = /* @__PURE__ */ new Map();
|
|
2728
2836
|
options.forEach((option) => {
|
|
2729
2837
|
map.set(option.value, option);
|
|
2730
2838
|
});
|
|
2731
2839
|
return map;
|
|
2732
2840
|
}, [options]);
|
|
2733
|
-
const select = /* @__PURE__ */
|
|
2734
|
-
|
|
2841
|
+
const select = /* @__PURE__ */ import_react22.default.createElement(
|
|
2842
|
+
import_joy30.Select,
|
|
2735
2843
|
{
|
|
2736
2844
|
...innerProps,
|
|
2737
2845
|
required,
|
|
@@ -2747,9 +2855,9 @@ function Select(props) {
|
|
|
2747
2855
|
return optionMap.get(selected.value)?.label;
|
|
2748
2856
|
}
|
|
2749
2857
|
},
|
|
2750
|
-
options.map((option) => /* @__PURE__ */
|
|
2858
|
+
options.map((option) => /* @__PURE__ */ import_react22.default.createElement(Option, { key: option.value, value: option.value, disabled: option.disabled }, option.secondaryText ? /* @__PURE__ */ import_react22.default.createElement(import_joy30.ListItemContent, { sx: { gap: 0.5 } }, /* @__PURE__ */ import_react22.default.createElement(import_joy30.Typography, { level: "inherit" }, option.label), /* @__PURE__ */ import_react22.default.createElement(import_joy30.Typography, { level: secondaryTextLevelMap2[size ?? "md"], textColor: "text.tertiary" }, option.secondaryText)) : option.label))
|
|
2751
2859
|
);
|
|
2752
|
-
return /* @__PURE__ */
|
|
2860
|
+
return /* @__PURE__ */ import_react22.default.createElement(
|
|
2753
2861
|
FormControl_default,
|
|
2754
2862
|
{
|
|
2755
2863
|
required,
|
|
@@ -2760,9 +2868,9 @@ function Select(props) {
|
|
|
2760
2868
|
sx,
|
|
2761
2869
|
className
|
|
2762
2870
|
},
|
|
2763
|
-
label && /* @__PURE__ */
|
|
2871
|
+
label && /* @__PURE__ */ import_react22.default.createElement(FormLabel_default, null, label),
|
|
2764
2872
|
select,
|
|
2765
|
-
helperText && /* @__PURE__ */
|
|
2873
|
+
helperText && /* @__PURE__ */ import_react22.default.createElement(FormHelperText_default, null, helperText)
|
|
2766
2874
|
);
|
|
2767
2875
|
}
|
|
2768
2876
|
Select.displayName = "Select";
|
|
@@ -2773,19 +2881,6 @@ var Select_default = Select;
|
|
|
2773
2881
|
// src/components/DataTable/components.tsx
|
|
2774
2882
|
var import_joy33 = require("@mui/joy");
|
|
2775
2883
|
|
|
2776
|
-
// src/components/Tooltip/Tooltip.tsx
|
|
2777
|
-
var import_react22 = __toESM(require("react"));
|
|
2778
|
-
var import_joy30 = require("@mui/joy");
|
|
2779
|
-
var import_framer_motion20 = require("framer-motion");
|
|
2780
|
-
var MotionTooltip = (0, import_framer_motion20.motion)(import_joy30.Tooltip);
|
|
2781
|
-
var Tooltip = (props) => {
|
|
2782
|
-
return /* @__PURE__ */ import_react22.default.createElement(MotionTooltip, { ...props });
|
|
2783
|
-
};
|
|
2784
|
-
Tooltip.displayName = "Tooltip";
|
|
2785
|
-
|
|
2786
|
-
// src/components/Tooltip/index.ts
|
|
2787
|
-
var Tooltip_default = Tooltip;
|
|
2788
|
-
|
|
2789
2884
|
// src/components/InfoSign/InfoSign.tsx
|
|
2790
2885
|
var import_react23 = __toESM(require("react"));
|
|
2791
2886
|
var import_joy31 = require("@mui/joy");
|
|
@@ -2820,21 +2915,22 @@ function InfoSign(props) {
|
|
|
2820
2915
|
var InfoSign_default = InfoSign;
|
|
2821
2916
|
|
|
2822
2917
|
// src/components/DataTable/components.tsx
|
|
2823
|
-
var TextEllipsis = ({ children }) => {
|
|
2918
|
+
var TextEllipsis = ({ children, lineClamp }) => {
|
|
2824
2919
|
const textRef = (0, import_react24.useRef)(null);
|
|
2825
2920
|
const [showTooltip, setShowTooltip] = (0, import_react24.useState)(false);
|
|
2826
2921
|
(0, import_react24.useLayoutEffect)(() => {
|
|
2827
2922
|
const element = textRef.current;
|
|
2828
|
-
if (element)
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2923
|
+
if (!element) return;
|
|
2924
|
+
const checkTruncation = () => {
|
|
2925
|
+
const isTruncated = lineClamp && lineClamp > 1 ? element.scrollHeight > element.clientHeight + 1 : element.scrollWidth > element.clientWidth;
|
|
2926
|
+
setShowTooltip(isTruncated);
|
|
2927
|
+
};
|
|
2928
|
+
checkTruncation();
|
|
2929
|
+
const ro = new ResizeObserver(checkTruncation);
|
|
2930
|
+
ro.observe(element);
|
|
2931
|
+
return () => ro.disconnect();
|
|
2932
|
+
}, [children, lineClamp]);
|
|
2933
|
+
return /* @__PURE__ */ import_react24.default.createElement(Tooltip_default, { title: showTooltip ? children : "", placement: "top", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ import_react24.default.createElement(EllipsisDiv, { ref: textRef, lineClamp }, children));
|
|
2838
2934
|
};
|
|
2839
2935
|
var CellTextEllipsis = ({ children }) => {
|
|
2840
2936
|
const textRef = (0, import_react24.useRef)(null);
|
|
@@ -2885,7 +2981,8 @@ var HeadCell = (props) => {
|
|
|
2885
2981
|
pinnedEndPosition,
|
|
2886
2982
|
headerRef,
|
|
2887
2983
|
tableColRef,
|
|
2888
|
-
headerClassName
|
|
2984
|
+
headerClassName,
|
|
2985
|
+
headerLineClamp
|
|
2889
2986
|
} = props;
|
|
2890
2987
|
const theme = (0, import_joy32.useTheme)();
|
|
2891
2988
|
const ref = headerRef;
|
|
@@ -2979,7 +3076,7 @@ var HeadCell = (props) => {
|
|
|
2979
3076
|
initial: "initial",
|
|
2980
3077
|
className: computedHeaderClassName
|
|
2981
3078
|
},
|
|
2982
|
-
/* @__PURE__ */ import_react24.default.createElement(Stack_default, { gap: 1, direction: "row", justifyContent: textAlign, alignItems: "center" }, textAlign === "end" && sortIcon, textAlign === "end" && infoSign, /* @__PURE__ */ import_react24.default.createElement(TextEllipsis,
|
|
3079
|
+
/* @__PURE__ */ import_react24.default.createElement(Stack_default, { gap: 1, direction: "row", justifyContent: textAlign, alignItems: "center", sx: { minWidth: 0 } }, textAlign === "end" && sortIcon, textAlign === "end" && infoSign, /* @__PURE__ */ import_react24.default.createElement(TextEllipsis, { lineClamp: headerLineClamp }, headerName ?? field, editMode && required && /* @__PURE__ */ import_react24.default.createElement(Asterisk, null, "*")), textAlign === "start" && infoSign, textAlign === "start" && sortIcon),
|
|
2983
3080
|
resizer
|
|
2984
3081
|
);
|
|
2985
3082
|
};
|
|
@@ -3271,7 +3368,9 @@ function useDataTableRenderer({
|
|
|
3271
3368
|
getId: _getId,
|
|
3272
3369
|
isTotalSelected: _isTotalSelected,
|
|
3273
3370
|
isRowSelectable,
|
|
3274
|
-
columnGroupingModel
|
|
3371
|
+
columnGroupingModel,
|
|
3372
|
+
columnVisibilityModel,
|
|
3373
|
+
onColumnVisibilityModelChange
|
|
3275
3374
|
}) {
|
|
3276
3375
|
if (pinnedColumns && columnGroupingModel) {
|
|
3277
3376
|
throw new Error(
|
|
@@ -3287,12 +3386,35 @@ function useDataTableRenderer({
|
|
|
3287
3386
|
initialState?.sorting?.sortModel ?? [],
|
|
3288
3387
|
(0, import_react25.useCallback)((sortModel2) => onSortModelChange?.(sortModel2), [onSortModelChange])
|
|
3289
3388
|
);
|
|
3389
|
+
const [visibilityModel] = useControlledState(
|
|
3390
|
+
columnVisibilityModel,
|
|
3391
|
+
initialState?.columns?.columnVisibilityModel ?? {},
|
|
3392
|
+
(0, import_react25.useCallback)(
|
|
3393
|
+
(model) => onColumnVisibilityModelChange?.(model),
|
|
3394
|
+
[onColumnVisibilityModelChange]
|
|
3395
|
+
)
|
|
3396
|
+
);
|
|
3290
3397
|
const reorderedColumns = (0, import_react25.useMemo)(() => {
|
|
3291
3398
|
if (!columnGroupingModel) return columnsProp;
|
|
3292
3399
|
return reorderColumnsByGroupingModel(columnsProp, columnGroupingModel);
|
|
3293
3400
|
}, [columnsProp, columnGroupingModel]);
|
|
3294
|
-
const
|
|
3401
|
+
const visibleColumns = (0, import_react25.useMemo)(
|
|
3402
|
+
() => reorderedColumns.filter((col) => visibilityModel[col.field] !== false),
|
|
3403
|
+
[reorderedColumns, visibilityModel]
|
|
3404
|
+
);
|
|
3405
|
+
const visibleFieldSet = (0, import_react25.useMemo)(() => new Set(visibleColumns.map((c) => c.field)), [visibleColumns]);
|
|
3406
|
+
const allColumnsByField = (0, import_react25.useMemo)(
|
|
3295
3407
|
() => reorderedColumns.reduce(
|
|
3408
|
+
(acc, curr) => ({
|
|
3409
|
+
...acc,
|
|
3410
|
+
[curr.field]: curr
|
|
3411
|
+
}),
|
|
3412
|
+
{}
|
|
3413
|
+
),
|
|
3414
|
+
[reorderedColumns]
|
|
3415
|
+
);
|
|
3416
|
+
const visibleColumnsByField = (0, import_react25.useMemo)(
|
|
3417
|
+
() => visibleColumns.reduce(
|
|
3296
3418
|
(acc, curr) => ({
|
|
3297
3419
|
...acc,
|
|
3298
3420
|
[curr.field]: {
|
|
@@ -3303,7 +3425,7 @@ function useDataTableRenderer({
|
|
|
3303
3425
|
}),
|
|
3304
3426
|
{}
|
|
3305
3427
|
),
|
|
3306
|
-
[
|
|
3428
|
+
[visibleColumns]
|
|
3307
3429
|
);
|
|
3308
3430
|
const sortComparator = (0, import_react25.useCallback)(
|
|
3309
3431
|
(rowA, rowB) => {
|
|
@@ -3311,7 +3433,8 @@ function useDataTableRenderer({
|
|
|
3311
3433
|
const { field, sort: direction } = sort;
|
|
3312
3434
|
const a = rowA[field];
|
|
3313
3435
|
const b = rowB[field];
|
|
3314
|
-
const column =
|
|
3436
|
+
const column = allColumnsByField[field];
|
|
3437
|
+
if (!column) continue;
|
|
3315
3438
|
let comparison = 0;
|
|
3316
3439
|
if (column.sortComparator) {
|
|
3317
3440
|
comparison = column.sortComparator({
|
|
@@ -3331,7 +3454,7 @@ function useDataTableRenderer({
|
|
|
3331
3454
|
}
|
|
3332
3455
|
return 0;
|
|
3333
3456
|
},
|
|
3334
|
-
[sortModel,
|
|
3457
|
+
[sortModel, allColumnsByField]
|
|
3335
3458
|
);
|
|
3336
3459
|
const rows = (0, import_react25.useMemo)(
|
|
3337
3460
|
() => sortModel.length ? [..._rows].sort(sortComparator) : _rows,
|
|
@@ -3395,44 +3518,54 @@ function useDataTableRenderer({
|
|
|
3395
3518
|
() => _isTotalSelected ?? (selectableRowCount > 0 && (selectionModel?.length || 0) === selectableRowCount),
|
|
3396
3519
|
[_isTotalSelected, selectionModel, selectableRowCount]
|
|
3397
3520
|
);
|
|
3398
|
-
const columnWidths = useColumnWidths(
|
|
3521
|
+
const columnWidths = useColumnWidths(visibleColumnsByField);
|
|
3399
3522
|
const getWidth = (0, import_react25.useCallback)(
|
|
3400
|
-
(f) => columnWidths[f] ??
|
|
3401
|
-
|
|
3402
|
-
[columnWidths,
|
|
3523
|
+
(f) => columnWidths[f] ?? allColumnsByField[f]?.width ?? // Column prop 으로 지정된 width
|
|
3524
|
+
allColumnsByField[f]?.minWidth ?? 0,
|
|
3525
|
+
[columnWidths, allColumnsByField]
|
|
3403
3526
|
);
|
|
3404
3527
|
const processedColumnGroups = (0, import_react25.useMemo)(() => {
|
|
3405
3528
|
if (!columnGroupingModel) return null;
|
|
3406
|
-
return calculateColumnGroups(columnGroupingModel,
|
|
3407
|
-
}, [columnGroupingModel,
|
|
3529
|
+
return calculateColumnGroups(columnGroupingModel, visibleColumns, visibleFieldSet);
|
|
3530
|
+
}, [columnGroupingModel, visibleColumns, visibleFieldSet]);
|
|
3531
|
+
const effectivePinnedLeft = (0, import_react25.useMemo)(
|
|
3532
|
+
() => pinnedColumns?.left?.filter((f) => visibleFieldSet.has(f)),
|
|
3533
|
+
[pinnedColumns?.left, visibleFieldSet]
|
|
3534
|
+
);
|
|
3535
|
+
const effectivePinnedRight = (0, import_react25.useMemo)(
|
|
3536
|
+
() => pinnedColumns?.right?.filter((f) => visibleFieldSet.has(f)),
|
|
3537
|
+
[pinnedColumns?.right, visibleFieldSet]
|
|
3538
|
+
);
|
|
3408
3539
|
const columns = (0, import_react25.useMemo)(() => {
|
|
3409
|
-
const baseColumns =
|
|
3540
|
+
const baseColumns = visibleColumns.length > 0 ? visibleColumns : reorderedColumns.length > 0 ? [] : Object.keys(rows[0] || {}).map((key) => ({
|
|
3410
3541
|
field: key
|
|
3411
3542
|
}));
|
|
3412
3543
|
return baseColumns.map((column) => {
|
|
3413
|
-
const isLeftPinned =
|
|
3414
|
-
const isRightPinned =
|
|
3544
|
+
const isLeftPinned = effectivePinnedLeft?.includes(column.field);
|
|
3545
|
+
const isRightPinned = effectivePinnedRight?.includes(column.field);
|
|
3415
3546
|
const isPinned = isLeftPinned || isRightPinned;
|
|
3416
3547
|
return {
|
|
3417
3548
|
...column,
|
|
3418
|
-
headerRef:
|
|
3419
|
-
tableColRef:
|
|
3549
|
+
headerRef: visibleColumnsByField[column.field]?.headerRef,
|
|
3550
|
+
tableColRef: visibleColumnsByField[column.field]?.tableColRef,
|
|
3420
3551
|
isCellEditable: editMode && (typeof column.isCellEditable === "function" ? column.isCellEditable : column.isCellEditable ?? true),
|
|
3421
3552
|
sort: sortModel.find((sort) => sort.field === column.field)?.sort,
|
|
3422
|
-
sortOrder:
|
|
3553
|
+
sortOrder: allColumnsByField[column.field]?.sortOrder || sortOrder,
|
|
3423
3554
|
isPinned,
|
|
3424
|
-
isLastStartPinnedColumn: isLeftPinned && [...
|
|
3425
|
-
isLastEndPinnedColumn: isRightPinned && (
|
|
3426
|
-
pinnedStartPosition:
|
|
3427
|
-
pinnedEndPosition:
|
|
3555
|
+
isLastStartPinnedColumn: isLeftPinned && [...effectivePinnedLeft || []].pop() === column.field,
|
|
3556
|
+
isLastEndPinnedColumn: isRightPinned && (effectivePinnedRight?.[0] ?? null) === column.field,
|
|
3557
|
+
pinnedStartPosition: effectivePinnedLeft?.slice(0, isLeftPinned ? effectivePinnedLeft.indexOf(column.field) : effectivePinnedLeft.length).reduce((acc, curr) => acc + getWidth(curr), 0),
|
|
3558
|
+
pinnedEndPosition: effectivePinnedRight?.slice(isRightPinned ? effectivePinnedRight.indexOf(column.field) + 1 : 0).reduce((acc, curr) => acc + getWidth(curr), 0)
|
|
3428
3559
|
};
|
|
3429
3560
|
});
|
|
3430
3561
|
}, [
|
|
3562
|
+
visibleColumns,
|
|
3431
3563
|
reorderedColumns,
|
|
3432
3564
|
rows,
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3565
|
+
effectivePinnedLeft,
|
|
3566
|
+
effectivePinnedRight,
|
|
3567
|
+
visibleColumnsByField,
|
|
3568
|
+
allColumnsByField,
|
|
3436
3569
|
editMode,
|
|
3437
3570
|
sortModel,
|
|
3438
3571
|
sortOrder,
|
|
@@ -3448,8 +3581,8 @@ function useDataTableRenderer({
|
|
|
3448
3581
|
const handleSortChange = (0, import_react25.useCallback)(
|
|
3449
3582
|
(props) => {
|
|
3450
3583
|
const { field, currentSort, multiple } = props;
|
|
3451
|
-
const column =
|
|
3452
|
-
const columnSortOrder = column
|
|
3584
|
+
const column = allColumnsByField[field];
|
|
3585
|
+
const columnSortOrder = column?.sortOrder || sortOrder;
|
|
3453
3586
|
if (currentSort !== void 0) {
|
|
3454
3587
|
const currentOrderIndex = columnSortOrder.indexOf(currentSort);
|
|
3455
3588
|
const nextSortOrderIndex = (currentOrderIndex + 1) % columnSortOrder.length;
|
|
@@ -3466,7 +3599,7 @@ function useDataTableRenderer({
|
|
|
3466
3599
|
setSortModel(newSortModel);
|
|
3467
3600
|
}
|
|
3468
3601
|
},
|
|
3469
|
-
[sortOrder,
|
|
3602
|
+
[sortOrder, allColumnsByField, sortModel, setSortModel]
|
|
3470
3603
|
);
|
|
3471
3604
|
(0, import_react25.useEffect)(() => {
|
|
3472
3605
|
if (!paginationModel) {
|
|
@@ -3892,6 +4025,10 @@ function Component(props, apiRef) {
|
|
|
3892
4025
|
loading,
|
|
3893
4026
|
columnGroupingModel: _________________,
|
|
3894
4027
|
// columnGroupingModel is used in useDataTableRenderer
|
|
4028
|
+
columnVisibilityModel: __________________,
|
|
4029
|
+
// columnVisibilityModel is used in useDataTableRenderer
|
|
4030
|
+
onColumnVisibilityModelChange: ___________________,
|
|
4031
|
+
// onColumnVisibilityModelChange is used in useDataTableRenderer
|
|
3895
4032
|
slots: {
|
|
3896
4033
|
checkbox: RenderCheckbox = Checkbox_default,
|
|
3897
4034
|
toolbar: Toolbar,
|
|
@@ -4131,7 +4268,7 @@ function Component(props, apiRef) {
|
|
|
4131
4268
|
width: c.width
|
|
4132
4269
|
}
|
|
4133
4270
|
}
|
|
4134
|
-
))), /* @__PURE__ */ import_react28.default.createElement("thead", null, processedColumnGroups && processedColumnGroups.groups.map((levelGroups, level) => /* @__PURE__ */ import_react28.default.createElement("tr", { key: `group-level-${level}` }, checkboxSelection && level === 0 && /* @__PURE__ */ import_react28.default.createElement(
|
|
4271
|
+
))), /* @__PURE__ */ import_react28.default.createElement("thead", null, processedColumnGroups && processedColumnGroups.groups.length > 0 && processedColumnGroups.groups.map((levelGroups, level) => /* @__PURE__ */ import_react28.default.createElement("tr", { key: `group-level-${level}` }, checkboxSelection && level === 0 && /* @__PURE__ */ import_react28.default.createElement(
|
|
4135
4272
|
"th",
|
|
4136
4273
|
{
|
|
4137
4274
|
rowSpan: processedColumnGroups.maxLevel + 2,
|
|
@@ -4151,7 +4288,7 @@ function Component(props, apiRef) {
|
|
|
4151
4288
|
...checkboxProps
|
|
4152
4289
|
}
|
|
4153
4290
|
)
|
|
4154
|
-
), level > 0 && Array.from({ length: levelGroups[0]?.startIndex || 0 }).map((_2, i) => /* @__PURE__ */ import_react28.default.createElement("th", { key: `empty-${level}-${i}` })), levelGroups.map((group, groupIndex) => {
|
|
4291
|
+
), level > 0 && Array.from({ length: levelGroups[0]?.startIndex || 0 }).map((_2, i) => /* @__PURE__ */ import_react28.default.createElement("th", { key: `empty-${level}-${i}` })), levelGroups.filter((g) => g.colspan > 0).map((group, groupIndex) => {
|
|
4155
4292
|
const nextGroup = levelGroups[groupIndex + 1];
|
|
4156
4293
|
const emptyCells = nextGroup ? nextGroup.startIndex - (group.startIndex + group.colspan) : columns.length - (group.startIndex + group.colspan);
|
|
4157
4294
|
const params = { groupId: group.groupId };
|
|
@@ -4169,7 +4306,7 @@ function Component(props, apiRef) {
|
|
|
4169
4306
|
},
|
|
4170
4307
|
group.headerName ?? group.groupId
|
|
4171
4308
|
), emptyCells > 0 && Array.from({ length: emptyCells }).map((_2, i) => /* @__PURE__ */ import_react28.default.createElement("th", { key: `empty-between-${level}-${groupIndex}-${i}`, colSpan: 1 })));
|
|
4172
|
-
}))), /* @__PURE__ */ import_react28.default.createElement("tr", null, !processedColumnGroups && checkboxSelection && /* @__PURE__ */ import_react28.default.createElement(
|
|
4309
|
+
}))), /* @__PURE__ */ import_react28.default.createElement("tr", null, (!processedColumnGroups || processedColumnGroups.groups.length === 0) && checkboxSelection && /* @__PURE__ */ import_react28.default.createElement(
|
|
4173
4310
|
"th",
|
|
4174
4311
|
{
|
|
4175
4312
|
style: {
|