@ceed/ads 1.41.3-next.5 → 1.41.3-next.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DataTable/components.d.ts +4 -4
- package/dist/components/DataTable/hooks.d.ts +4 -4
- package/dist/components/DataTable/types.d.ts +9 -7
- package/dist/components/DataTable/utils.d.ts +6 -0
- package/dist/components/IconMenuButton/IconMenuButton.type-test.d.ts +5 -0
- package/dist/components/Select/Select.d.ts +4 -0
- package/dist/components/Select/index.d.ts +2 -1
- package/dist/components/data-display/DataTable.md +1 -1
- package/dist/components/inputs/Calendar.md +17 -17
- package/dist/components/navigation/IconMenuButton.md +5 -0
- package/dist/index.browser.js +6 -6
- package/dist/index.browser.js.map +3 -3
- package/dist/index.cjs +31 -18
- package/dist/index.js +188 -175
- package/dist/libs/slot-props.d.ts +2 -2
- package/framer/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -182,7 +182,7 @@ function Alert(inProps) {
|
|
|
182
182
|
Alert.displayName = "Alert";
|
|
183
183
|
|
|
184
184
|
// src/components/Autocomplete/Autocomplete.tsx
|
|
185
|
-
import React5, { useCallback as
|
|
185
|
+
import React5, { useCallback as useCallback3, useEffect as useEffect2, useMemo as useMemo2, useRef as useRef3 } from "react";
|
|
186
186
|
import {
|
|
187
187
|
Autocomplete as JoyAutocomplete,
|
|
188
188
|
AutocompleteOption as JoyAutocompleteOption,
|
|
@@ -285,7 +285,7 @@ function useControlledState(controlledValue, defaultValue, onChange) {
|
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
// src/libs/slot-props.ts
|
|
288
|
-
import { useMemo } from "react";
|
|
288
|
+
import { useCallback as useCallback2, useMemo, useRef as useRef2 } from "react";
|
|
289
289
|
function assignRef(ref, value) {
|
|
290
290
|
if (typeof ref === "function") ref(value);
|
|
291
291
|
else if (ref) ref.current = value;
|
|
@@ -303,16 +303,25 @@ function useSlotRef(slotProp, ref) {
|
|
|
303
303
|
const isFunctionForm = typeof slotProp === "function";
|
|
304
304
|
const slotRef = isFunctionForm ? void 0 : slotProp?.ref;
|
|
305
305
|
const mergedRef = useMergedRef(slotRef, ref);
|
|
306
|
+
const latestSlotRef = useRef2(null);
|
|
307
|
+
const stableMergedRef = useCallback2(
|
|
308
|
+
(value) => {
|
|
309
|
+
assignRef(latestSlotRef.current, value);
|
|
310
|
+
assignRef(ref, value);
|
|
311
|
+
},
|
|
312
|
+
[ref]
|
|
313
|
+
);
|
|
306
314
|
return useMemo(() => {
|
|
307
315
|
if (isFunctionForm) {
|
|
308
316
|
return ((ownerState) => {
|
|
309
317
|
const resolved = slotProp(ownerState) ?? {};
|
|
310
|
-
const
|
|
311
|
-
|
|
318
|
+
const resolvedRef = resolved.ref;
|
|
319
|
+
latestSlotRef.current = resolvedRef ?? null;
|
|
320
|
+
return resolvedRef || ref ? { ...resolved, ref: stableMergedRef } : { ...resolved };
|
|
312
321
|
});
|
|
313
322
|
}
|
|
314
323
|
return mergedRef ? { ...slotProp, ref: mergedRef } : { ...slotProp };
|
|
315
|
-
}, [isFunctionForm, slotProp, mergedRef, ref]);
|
|
324
|
+
}, [isFunctionForm, slotProp, mergedRef, ref, stableMergedRef]);
|
|
316
325
|
}
|
|
317
326
|
|
|
318
327
|
// src/components/Autocomplete/Autocomplete.tsx
|
|
@@ -337,7 +346,7 @@ var AutocompleteListBox = React5.forwardRef((props, ref) => {
|
|
|
337
346
|
ownerState: { loading, size: fontSize },
|
|
338
347
|
...innerProps
|
|
339
348
|
} = props;
|
|
340
|
-
const parentRef =
|
|
349
|
+
const parentRef = useRef3(null);
|
|
341
350
|
const isGrouped = children[0].every((child) => child.hasOwnProperty("group"));
|
|
342
351
|
const itemHeight = useMemo2(() => {
|
|
343
352
|
const heights = itemHeightMap[fontSize ?? "md"];
|
|
@@ -454,7 +463,7 @@ function AutocompleteInner(props, ref) {
|
|
|
454
463
|
const [rawValue, setValue] = useControlledState(
|
|
455
464
|
props.value,
|
|
456
465
|
props.defaultValue ?? null,
|
|
457
|
-
|
|
466
|
+
useCallback3(
|
|
458
467
|
(value2) => onChange?.({
|
|
459
468
|
target: {
|
|
460
469
|
value: value2,
|
|
@@ -497,7 +506,7 @@ function AutocompleteInner(props, ref) {
|
|
|
497
506
|
}
|
|
498
507
|
return optionMap.get(_value);
|
|
499
508
|
}, [_value, optionMap, props.loading]);
|
|
500
|
-
const applySize =
|
|
509
|
+
const applySize = useCallback3(
|
|
501
510
|
(node) => {
|
|
502
511
|
return React5.isValidElement(node) && !props.loading ? React5.cloneElement(node, { ...{ size } }) : node;
|
|
503
512
|
},
|
|
@@ -523,7 +532,7 @@ function AutocompleteInner(props, ref) {
|
|
|
523
532
|
}),
|
|
524
533
|
[options, props.slotProps, inputSlotProps]
|
|
525
534
|
);
|
|
526
|
-
const handleChange =
|
|
535
|
+
const handleChange = useCallback3(
|
|
527
536
|
(event, value2) => {
|
|
528
537
|
const newValue = value2;
|
|
529
538
|
const _value2 = Array.isArray(newValue) ? newValue.map((value3) => value3.value) : newValue?.value;
|
|
@@ -686,7 +695,7 @@ var MenuItem = JoyMenuItem;
|
|
|
686
695
|
var Menu_default = Menu;
|
|
687
696
|
|
|
688
697
|
// src/components/Dropdown/Dropdown.tsx
|
|
689
|
-
import React8, { createContext, useCallback as
|
|
698
|
+
import React8, { createContext, useCallback as useCallback4, useMemo as useMemo4, useState as useState2 } from "react";
|
|
690
699
|
import { Dropdown as JoyDropdown } from "@mui/joy";
|
|
691
700
|
import { MenuButton } from "@mui/joy";
|
|
692
701
|
import { useMenuButton } from "@mui/base/useMenuButton";
|
|
@@ -701,7 +710,7 @@ function Dropdown({ open: openProp, defaultOpen = false, onOpenChange, ...rest }
|
|
|
701
710
|
}),
|
|
702
711
|
[]
|
|
703
712
|
);
|
|
704
|
-
const handleOpenChange =
|
|
713
|
+
const handleOpenChange = useCallback4(
|
|
705
714
|
(event, isOpen) => {
|
|
706
715
|
if (nestedCount > 0 && !isOpen && event?.type === "blur") {
|
|
707
716
|
return;
|
|
@@ -764,7 +773,7 @@ Button.displayName = "Button";
|
|
|
764
773
|
var Button_default = Button;
|
|
765
774
|
|
|
766
775
|
// src/components/Calendar/Calendar.tsx
|
|
767
|
-
import React13, { Fragment, forwardRef as forwardRef4, useCallback as
|
|
776
|
+
import React13, { Fragment, forwardRef as forwardRef4, useCallback as useCallback7, useEffect as useEffect3, useMemo as useMemo6, useRef as useRef4, useState as useState5 } from "react";
|
|
768
777
|
import { styled as styled5 } from "@mui/joy";
|
|
769
778
|
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
|
|
770
779
|
import ChevronRightIcon from "@mui/icons-material/ChevronRight";
|
|
@@ -858,7 +867,7 @@ var isSameMonth = (date1, date2) => {
|
|
|
858
867
|
};
|
|
859
868
|
|
|
860
869
|
// src/components/Calendar/hooks/use-calendar-props.ts
|
|
861
|
-
import { useCallback as
|
|
870
|
+
import { useCallback as useCallback5, useMemo as useMemo5, useState as useState3 } from "react";
|
|
862
871
|
import { useThemeProps as useThemeProps3 } from "@mui/joy";
|
|
863
872
|
var resolveView = (view, views) => {
|
|
864
873
|
return views.includes(view) ? view : views[0];
|
|
@@ -888,13 +897,13 @@ var useCalendarProps = (inProps) => {
|
|
|
888
897
|
maxDate.setHours(0, 0, 0, 0);
|
|
889
898
|
return maxDate;
|
|
890
899
|
}, [inProps.maxDate]);
|
|
891
|
-
const paginate =
|
|
900
|
+
const paginate = useCallback5(
|
|
892
901
|
(newDirection) => {
|
|
893
902
|
setPage([page + newDirection, newDirection]);
|
|
894
903
|
},
|
|
895
904
|
[page]
|
|
896
905
|
);
|
|
897
|
-
const handleViewMonthChange =
|
|
906
|
+
const handleViewMonthChange = useCallback5(
|
|
898
907
|
(newMonth) => {
|
|
899
908
|
setViewMonth(newMonth);
|
|
900
909
|
if (resolvedView === "month") {
|
|
@@ -947,7 +956,7 @@ var useCalendarProps = (inProps) => {
|
|
|
947
956
|
};
|
|
948
957
|
|
|
949
958
|
// src/components/Calendar/hooks/use-calendar.ts
|
|
950
|
-
import { useCallback as
|
|
959
|
+
import { useCallback as useCallback6, useState as useState4 } from "react";
|
|
951
960
|
var useCalendar = (ownerState) => {
|
|
952
961
|
const [localHoverDay, setLocalHoverDay] = useState4(null);
|
|
953
962
|
const [localHoverMonth, setLocalHoverMonth] = useState4(null);
|
|
@@ -957,7 +966,7 @@ var useCalendar = (ownerState) => {
|
|
|
957
966
|
const setHoverMonth = ownerState.onHoverMonthChange ?? setLocalHoverMonth;
|
|
958
967
|
return {
|
|
959
968
|
calendarTitle: ownerState.view === "month" ? getYearName(ownerState.viewMonth, ownerState.locale || "default") : getMonthName(ownerState.viewMonth, ownerState.locale || "default"),
|
|
960
|
-
onPrev:
|
|
969
|
+
onPrev: useCallback6(() => {
|
|
961
970
|
if (ownerState.view === "day") {
|
|
962
971
|
const currentDate = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
963
972
|
const currentYear = currentDate.getFullYear();
|
|
@@ -974,7 +983,7 @@ var useCalendar = (ownerState) => {
|
|
|
974
983
|
ownerState.onMonthChange?.(prevYear);
|
|
975
984
|
}
|
|
976
985
|
}, [ownerState.onMonthChange, ownerState.viewMonth, ownerState.view]),
|
|
977
|
-
onNext:
|
|
986
|
+
onNext: useCallback6(() => {
|
|
978
987
|
if (ownerState.view === "day") {
|
|
979
988
|
const currentDate = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
980
989
|
const currentYear = currentDate.getFullYear();
|
|
@@ -991,7 +1000,7 @@ var useCalendar = (ownerState) => {
|
|
|
991
1000
|
ownerState.onMonthChange?.(nextYear);
|
|
992
1001
|
}
|
|
993
1002
|
}, [ownerState.onMonthChange, ownerState.viewMonth, ownerState.view]),
|
|
994
|
-
getDayCellProps:
|
|
1003
|
+
getDayCellProps: useCallback6(
|
|
995
1004
|
(day) => {
|
|
996
1005
|
const thisDay = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
997
1006
|
thisDay.setHours(0, 0, 0, 0);
|
|
@@ -1006,7 +1015,7 @@ var useCalendar = (ownerState) => {
|
|
|
1006
1015
|
},
|
|
1007
1016
|
[ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverDay]
|
|
1008
1017
|
),
|
|
1009
|
-
getMonthCellProps:
|
|
1018
|
+
getMonthCellProps: useCallback6(
|
|
1010
1019
|
(monthIndex) => {
|
|
1011
1020
|
const thisMonth = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1012
1021
|
thisMonth.setDate(1);
|
|
@@ -1023,7 +1032,7 @@ var useCalendar = (ownerState) => {
|
|
|
1023
1032
|
},
|
|
1024
1033
|
[ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverMonth]
|
|
1025
1034
|
),
|
|
1026
|
-
getPickerDayProps:
|
|
1035
|
+
getPickerDayProps: useCallback6(
|
|
1027
1036
|
(day) => {
|
|
1028
1037
|
const thisDay = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1029
1038
|
thisDay.setHours(0, 0, 0, 0);
|
|
@@ -1077,7 +1086,7 @@ var useCalendar = (ownerState) => {
|
|
|
1077
1086
|
hoverDay
|
|
1078
1087
|
]
|
|
1079
1088
|
),
|
|
1080
|
-
getPickerMonthProps:
|
|
1089
|
+
getPickerMonthProps: useCallback6(
|
|
1081
1090
|
(monthIndex) => {
|
|
1082
1091
|
const thisMonth = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1083
1092
|
thisMonth.setDate(1);
|
|
@@ -1607,9 +1616,9 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1607
1616
|
} = props;
|
|
1608
1617
|
const { calendarTitle, onPrev, onNext } = useCalendar(ownerState);
|
|
1609
1618
|
const [isMonthViewAssistHintOpen, setIsMonthViewAssistHintOpen] = useState5(false);
|
|
1610
|
-
const monthNavClickTimestampsRef =
|
|
1611
|
-
const monthViewAssistHintShownInSessionRef =
|
|
1612
|
-
const monthViewAssistHintTimeoutRef =
|
|
1619
|
+
const monthNavClickTimestampsRef = useRef4([]);
|
|
1620
|
+
const monthViewAssistHintShownInSessionRef = useRef4(false);
|
|
1621
|
+
const monthViewAssistHintTimeoutRef = useRef4(null);
|
|
1613
1622
|
const [hoverDay, setHoverDay] = useState5(null);
|
|
1614
1623
|
const [hoverMonth, setHoverMonth] = useState5(null);
|
|
1615
1624
|
const resolvedNumberOfMonths = numberOfMonths ?? 1;
|
|
@@ -1630,14 +1639,14 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1630
1639
|
}
|
|
1631
1640
|
};
|
|
1632
1641
|
}, []);
|
|
1633
|
-
const closeMonthViewAssistHint =
|
|
1642
|
+
const closeMonthViewAssistHint = useCallback7(() => {
|
|
1634
1643
|
if (monthViewAssistHintTimeoutRef.current) {
|
|
1635
1644
|
clearTimeout(monthViewAssistHintTimeoutRef.current);
|
|
1636
1645
|
monthViewAssistHintTimeoutRef.current = null;
|
|
1637
1646
|
}
|
|
1638
1647
|
setIsMonthViewAssistHintOpen(false);
|
|
1639
1648
|
}, []);
|
|
1640
|
-
const showMonthViewAssistHint =
|
|
1649
|
+
const showMonthViewAssistHint = useCallback7(() => {
|
|
1641
1650
|
const now = Date.now();
|
|
1642
1651
|
if (monthViewAssistHintShownInSessionRef.current) return;
|
|
1643
1652
|
if (now - lastMonthViewAssistHintShownAt < MONTH_VIEW_HINT_COOLDOWN_MS) return;
|
|
@@ -1652,7 +1661,7 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1652
1661
|
monthViewAssistHintTimeoutRef.current = null;
|
|
1653
1662
|
}, MONTH_VIEW_HINT_DURATION_MS);
|
|
1654
1663
|
}, []);
|
|
1655
|
-
const trackFastMonthNavigation =
|
|
1664
|
+
const trackFastMonthNavigation = useCallback7(() => {
|
|
1656
1665
|
if (!isHintEligible) return;
|
|
1657
1666
|
const now = Date.now();
|
|
1658
1667
|
monthNavClickTimestampsRef.current = [
|
|
@@ -1663,15 +1672,15 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1663
1672
|
showMonthViewAssistHint();
|
|
1664
1673
|
}
|
|
1665
1674
|
}, [isHintEligible, showMonthViewAssistHint]);
|
|
1666
|
-
const handlePrevClick =
|
|
1675
|
+
const handlePrevClick = useCallback7(() => {
|
|
1667
1676
|
onPrev();
|
|
1668
1677
|
trackFastMonthNavigation();
|
|
1669
1678
|
}, [onPrev, trackFastMonthNavigation]);
|
|
1670
|
-
const handleNextClick =
|
|
1679
|
+
const handleNextClick = useCallback7(() => {
|
|
1671
1680
|
onNext();
|
|
1672
1681
|
trackFastMonthNavigation();
|
|
1673
1682
|
}, [onNext, trackFastMonthNavigation]);
|
|
1674
|
-
const handleSwitchViewClick =
|
|
1683
|
+
const handleSwitchViewClick = useCallback7(() => {
|
|
1675
1684
|
closeMonthViewAssistHint();
|
|
1676
1685
|
onViewChange?.();
|
|
1677
1686
|
}, [closeMonthViewAssistHint, onViewChange]);
|
|
@@ -1841,11 +1850,11 @@ var Container = forwardRef5(function Container2(props, ref) {
|
|
|
1841
1850
|
Container.displayName = "Container";
|
|
1842
1851
|
|
|
1843
1852
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
1844
|
-
import React17, { useCallback as
|
|
1853
|
+
import React17, { useCallback as useCallback9, useMemo as useMemo7 } from "react";
|
|
1845
1854
|
import { NumericFormat } from "react-number-format";
|
|
1846
1855
|
|
|
1847
1856
|
// src/components/Input/Input.tsx
|
|
1848
|
-
import React16, { useCallback as
|
|
1857
|
+
import React16, { useCallback as useCallback8, useState as useState6 } from "react";
|
|
1849
1858
|
import { Input as JoyInput } from "@mui/joy";
|
|
1850
1859
|
import { motion as motion16 } from "framer-motion";
|
|
1851
1860
|
import ClearIcon from "@mui/icons-material/Close";
|
|
@@ -1883,7 +1892,7 @@ var Input = React16.forwardRef((props, ref) => {
|
|
|
1883
1892
|
const [value, setValue] = useControlledState(
|
|
1884
1893
|
valueProp,
|
|
1885
1894
|
defaultValueProp ?? null,
|
|
1886
|
-
|
|
1895
|
+
useCallback8(
|
|
1887
1896
|
(value2) => {
|
|
1888
1897
|
onChange?.({
|
|
1889
1898
|
/**
|
|
@@ -2173,7 +2182,7 @@ var CurrencyInput = React17.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
2173
2182
|
const [_value, setValue] = useControlledState(
|
|
2174
2183
|
props.value,
|
|
2175
2184
|
props.defaultValue ?? null,
|
|
2176
|
-
|
|
2185
|
+
useCallback9((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
2177
2186
|
);
|
|
2178
2187
|
const value = useMemo7(() => {
|
|
2179
2188
|
if (_value && useMinorUnit) {
|
|
@@ -2188,7 +2197,7 @@ var CurrencyInput = React17.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
2188
2197
|
return props.max;
|
|
2189
2198
|
}, [props.max, useMinorUnit, decimalScale]);
|
|
2190
2199
|
const isOverLimit = useMemo7(() => max != null && value != null && value > max, [max, value]);
|
|
2191
|
-
const handleChange =
|
|
2200
|
+
const handleChange = useCallback9(
|
|
2192
2201
|
(event) => {
|
|
2193
2202
|
if (event.target.value === "") {
|
|
2194
2203
|
setValue(null);
|
|
@@ -2237,9 +2246,9 @@ var CurrencyInput_default = CurrencyInput;
|
|
|
2237
2246
|
|
|
2238
2247
|
// src/components/DataTable/DataTable.tsx
|
|
2239
2248
|
import React26, {
|
|
2240
|
-
useCallback as
|
|
2249
|
+
useCallback as useCallback14,
|
|
2241
2250
|
useMemo as useMemo12,
|
|
2242
|
-
useRef as
|
|
2251
|
+
useRef as useRef8,
|
|
2243
2252
|
useId,
|
|
2244
2253
|
forwardRef as forwardRef7,
|
|
2245
2254
|
useImperativeHandle as useImperativeHandle2,
|
|
@@ -2473,7 +2482,10 @@ function computeAutoFitWidth(params) {
|
|
|
2473
2482
|
return finalWidth;
|
|
2474
2483
|
}
|
|
2475
2484
|
function getHeaderCellId(tableId, columnId) {
|
|
2476
|
-
return `${tableId}_header_${columnId}
|
|
2485
|
+
return `${tableId}_header_${columnId}`;
|
|
2486
|
+
}
|
|
2487
|
+
function sanitizeColumnId(field) {
|
|
2488
|
+
return String(field).trim().replace(/\s+/g, "_");
|
|
2477
2489
|
}
|
|
2478
2490
|
|
|
2479
2491
|
// src/components/DataTable/styled.tsx
|
|
@@ -2663,11 +2675,11 @@ var Resizer = (ref, targetRef = ref, onResizeStateChange, onAutoFit) => /* @__PU
|
|
|
2663
2675
|
|
|
2664
2676
|
// src/components/DataTable/components.tsx
|
|
2665
2677
|
import React23, {
|
|
2666
|
-
useRef as
|
|
2678
|
+
useRef as useRef6,
|
|
2667
2679
|
useState as useState8,
|
|
2668
2680
|
useLayoutEffect,
|
|
2669
2681
|
useMemo as useMemo10,
|
|
2670
|
-
useCallback as
|
|
2682
|
+
useCallback as useCallback11,
|
|
2671
2683
|
useEffect as useEffect5,
|
|
2672
2684
|
memo,
|
|
2673
2685
|
createElement
|
|
@@ -2676,7 +2688,7 @@ import { styled as styled12, useTheme } from "@mui/joy";
|
|
|
2676
2688
|
import { AnimatePresence as AnimatePresence2 } from "framer-motion";
|
|
2677
2689
|
|
|
2678
2690
|
// src/components/DatePicker/DatePicker.tsx
|
|
2679
|
-
import React19, { forwardRef as forwardRef6, useCallback as
|
|
2691
|
+
import React19, { forwardRef as forwardRef6, useCallback as useCallback10, useEffect as useEffect4, useImperativeHandle, useRef as useRef5, useState as useState7 } from "react";
|
|
2680
2692
|
import { IMaskInput, IMask } from "react-imask";
|
|
2681
2693
|
import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
|
|
2682
2694
|
import { styled as styled10, useThemeProps as useThemeProps5 } from "@mui/joy";
|
|
@@ -2893,12 +2905,12 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2893
2905
|
presets,
|
|
2894
2906
|
...innerProps
|
|
2895
2907
|
} = props;
|
|
2896
|
-
const innerRef =
|
|
2897
|
-
const buttonRef =
|
|
2908
|
+
const innerRef = useRef5(null);
|
|
2909
|
+
const buttonRef = useRef5(null);
|
|
2898
2910
|
const [rawValue, setValue] = useControlledState(
|
|
2899
2911
|
props.value,
|
|
2900
2912
|
props.defaultValue ?? null,
|
|
2901
|
-
|
|
2913
|
+
useCallback10(
|
|
2902
2914
|
(value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
|
|
2903
2915
|
[props.name, onChange]
|
|
2904
2916
|
)
|
|
@@ -2926,7 +2938,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2926
2938
|
}
|
|
2927
2939
|
}, [displayFormat, displayValue, format, locale, value]);
|
|
2928
2940
|
useImperativeHandle(ref, () => innerRef.current, [innerRef]);
|
|
2929
|
-
const handleChange =
|
|
2941
|
+
const handleChange = useCallback10(
|
|
2930
2942
|
(event) => {
|
|
2931
2943
|
const value2 = event.target.value;
|
|
2932
2944
|
setDisplayValue(value2 ? formatValueString(parseDate(value2, format), displayFormat, locale) : value2);
|
|
@@ -2934,7 +2946,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2934
2946
|
},
|
|
2935
2947
|
[displayFormat, format, locale, setValue]
|
|
2936
2948
|
);
|
|
2937
|
-
const handleDisplayInputChange =
|
|
2949
|
+
const handleDisplayInputChange = useCallback10(
|
|
2938
2950
|
(event) => {
|
|
2939
2951
|
if (event.target.value === "") {
|
|
2940
2952
|
handleChange({
|
|
@@ -2959,7 +2971,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2959
2971
|
},
|
|
2960
2972
|
[displayFormat, format, handleChange, props.name]
|
|
2961
2973
|
);
|
|
2962
|
-
const handleCalendarToggle =
|
|
2974
|
+
const handleCalendarToggle = useCallback10(
|
|
2963
2975
|
(event) => {
|
|
2964
2976
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
2965
2977
|
setTimeout(() => {
|
|
@@ -2968,7 +2980,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2968
2980
|
},
|
|
2969
2981
|
[anchorEl, setAnchorEl, innerRef]
|
|
2970
2982
|
);
|
|
2971
|
-
const handleInputMouseDown =
|
|
2983
|
+
const handleInputMouseDown = useCallback10(
|
|
2972
2984
|
(event) => {
|
|
2973
2985
|
if (inputReadOnly || isAlphabeticDisplay) {
|
|
2974
2986
|
event.preventDefault();
|
|
@@ -2977,7 +2989,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2977
2989
|
},
|
|
2978
2990
|
[inputReadOnly, isAlphabeticDisplay, buttonRef]
|
|
2979
2991
|
);
|
|
2980
|
-
const handleInputClick =
|
|
2992
|
+
const handleInputClick = useCallback10(
|
|
2981
2993
|
(event) => {
|
|
2982
2994
|
if (inputReadOnly && !readOnly) {
|
|
2983
2995
|
handleCalendarToggle(event);
|
|
@@ -2985,7 +2997,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2985
2997
|
},
|
|
2986
2998
|
[inputReadOnly, readOnly, handleCalendarToggle]
|
|
2987
2999
|
);
|
|
2988
|
-
const handlePresetClick =
|
|
3000
|
+
const handlePresetClick = useCallback10(
|
|
2989
3001
|
(presetValue) => {
|
|
2990
3002
|
handleChange({
|
|
2991
3003
|
target: {
|
|
@@ -2997,7 +3009,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2997
3009
|
},
|
|
2998
3010
|
[handleChange, props.name]
|
|
2999
3011
|
);
|
|
3000
|
-
const isPresetDisabled =
|
|
3012
|
+
const isPresetDisabled = useCallback10(
|
|
3001
3013
|
(presetValue) => {
|
|
3002
3014
|
try {
|
|
3003
3015
|
const date = parseDate(presetValue, format);
|
|
@@ -3365,7 +3377,7 @@ var TextEllipsis = ({
|
|
|
3365
3377
|
lineClamp,
|
|
3366
3378
|
...rest
|
|
3367
3379
|
}) => {
|
|
3368
|
-
const textRef =
|
|
3380
|
+
const textRef = useRef6(null);
|
|
3369
3381
|
const [showTooltip, setShowTooltip] = useState8(false);
|
|
3370
3382
|
useLayoutEffect(() => {
|
|
3371
3383
|
const element = textRef.current;
|
|
@@ -3382,7 +3394,7 @@ var TextEllipsis = ({
|
|
|
3382
3394
|
return /* @__PURE__ */ React23.createElement(Tooltip_default, { title: showTooltip ? children : "", placement: "top" }, /* @__PURE__ */ React23.createElement(EllipsisDiv, { ref: textRef, lineClamp, ...rest }, children));
|
|
3383
3395
|
};
|
|
3384
3396
|
var CellTextEllipsis = ({ children }) => {
|
|
3385
|
-
const textRef =
|
|
3397
|
+
const textRef = useRef6(null);
|
|
3386
3398
|
const [showTooltip, setShowTooltip] = useState8(false);
|
|
3387
3399
|
useLayoutEffect(() => {
|
|
3388
3400
|
const element = textRef.current;
|
|
@@ -3438,14 +3450,14 @@ var HeadCell = (props) => {
|
|
|
3438
3450
|
const theme = useTheme();
|
|
3439
3451
|
const ref = headerRef;
|
|
3440
3452
|
const colRef = tableColRef;
|
|
3441
|
-
const localRef =
|
|
3453
|
+
const localRef = useRef6(null);
|
|
3442
3454
|
useLayoutEffect(() => {
|
|
3443
3455
|
ref.current = localRef.current;
|
|
3444
3456
|
}, [ref]);
|
|
3445
3457
|
const [isHovered, setIsHovered] = useState8(false);
|
|
3446
3458
|
const sortable = type === "actions" ? false : _sortable;
|
|
3447
|
-
const headId = useMemo10(() => getHeaderCellId(tableId, columnId
|
|
3448
|
-
const isResizingRef =
|
|
3459
|
+
const headId = useMemo10(() => getHeaderCellId(tableId, columnId), [tableId, columnId]);
|
|
3460
|
+
const isResizingRef = useRef6(false);
|
|
3449
3461
|
const resizer = useMemo10(
|
|
3450
3462
|
() => resizable ?? true ? Resizer(
|
|
3451
3463
|
ref,
|
|
@@ -3453,9 +3465,9 @@ var HeadCell = (props) => {
|
|
|
3453
3465
|
(isResizing) => {
|
|
3454
3466
|
isResizingRef.current = isResizing;
|
|
3455
3467
|
},
|
|
3456
|
-
onAutoFit ? () => onAutoFit(columnId
|
|
3468
|
+
onAutoFit ? () => onAutoFit(columnId) : void 0
|
|
3457
3469
|
) : null,
|
|
3458
|
-
[resizable, ref, colRef, onAutoFit, columnId
|
|
3470
|
+
[resizable, ref, colRef, onAutoFit, columnId]
|
|
3459
3471
|
);
|
|
3460
3472
|
const style = useMemo10(
|
|
3461
3473
|
() => ({
|
|
@@ -3529,7 +3541,7 @@ var HeadCell = (props) => {
|
|
|
3529
3541
|
ref: localRef,
|
|
3530
3542
|
key: field,
|
|
3531
3543
|
style,
|
|
3532
|
-
onClick:
|
|
3544
|
+
onClick: useCallback11(
|
|
3533
3545
|
(e) => {
|
|
3534
3546
|
if (isResizingRef.current) return;
|
|
3535
3547
|
if (!(e.target instanceof Element) || !e.currentTarget.contains(e.target)) return;
|
|
@@ -3569,7 +3581,7 @@ var BodyCell = (props) => {
|
|
|
3569
3581
|
} = props;
|
|
3570
3582
|
const theme = useTheme();
|
|
3571
3583
|
const [value, setValue] = useState8(row[field]);
|
|
3572
|
-
const cellRef =
|
|
3584
|
+
const cellRef = useRef6(null);
|
|
3573
3585
|
const params = useMemo10(
|
|
3574
3586
|
() => ({
|
|
3575
3587
|
row,
|
|
@@ -3725,7 +3737,7 @@ var BodyCell = (props) => {
|
|
|
3725
3737
|
{
|
|
3726
3738
|
ref: cellRef,
|
|
3727
3739
|
key: field,
|
|
3728
|
-
headers: getHeaderCellId(tableId, props.columnId
|
|
3740
|
+
headers: getHeaderCellId(tableId, props.columnId),
|
|
3729
3741
|
sx: {
|
|
3730
3742
|
textAlign: getTextAlign({ type }),
|
|
3731
3743
|
verticalAlign: editMode ? "top" : "middle",
|
|
@@ -3790,10 +3802,10 @@ var VirtualizedTableRow = memo(StyledTableRow2, (prevProps, nextProps) => {
|
|
|
3790
3802
|
});
|
|
3791
3803
|
|
|
3792
3804
|
// src/components/DataTable/hooks.ts
|
|
3793
|
-
import { useState as useState9, useLayoutEffect as useLayoutEffect2, useRef as
|
|
3805
|
+
import { useState as useState9, useLayoutEffect as useLayoutEffect2, useRef as useRef7, useMemo as useMemo11, useCallback as useCallback12, useEffect as useEffect6, createRef } from "react";
|
|
3794
3806
|
function useColumnWidths(columnsById) {
|
|
3795
3807
|
const [widths, setWidths] = useState9({});
|
|
3796
|
-
const roRef =
|
|
3808
|
+
const roRef = useRef7();
|
|
3797
3809
|
useLayoutEffect2(() => {
|
|
3798
3810
|
if (roRef.current) roRef.current.disconnect();
|
|
3799
3811
|
roRef.current = new ResizeObserver((entries) => {
|
|
@@ -3825,8 +3837,8 @@ function useColumnWidths(columnsById) {
|
|
|
3825
3837
|
});
|
|
3826
3838
|
setWidths((prev) => {
|
|
3827
3839
|
const keys = Object.keys(measured);
|
|
3828
|
-
const same = keys.
|
|
3829
|
-
return same ? prev : measured;
|
|
3840
|
+
const same = keys.every((key) => prev[key] === measured[key]);
|
|
3841
|
+
return same ? prev : { ...prev, ...measured };
|
|
3830
3842
|
});
|
|
3831
3843
|
return () => roRef.current?.disconnect();
|
|
3832
3844
|
}, [columnsById]);
|
|
@@ -3861,19 +3873,19 @@ function useDataTableRenderer({
|
|
|
3861
3873
|
"You cannot use both `pinnedColumns` and `columnGroupingModel` at the same time. Please choose one of them."
|
|
3862
3874
|
);
|
|
3863
3875
|
}
|
|
3864
|
-
const onSelectionModelChangeRef =
|
|
3876
|
+
const onSelectionModelChangeRef = useRef7(onSelectionModelChange);
|
|
3865
3877
|
onSelectionModelChangeRef.current = onSelectionModelChange;
|
|
3866
3878
|
const [focusedRowId, setFocusedRowId] = useState9(null);
|
|
3867
3879
|
const [selectionAnchor, setSelectionAnchor] = useState9(null);
|
|
3868
3880
|
const [sortModel, setSortModel] = useControlledState(
|
|
3869
3881
|
controlledSortModel,
|
|
3870
3882
|
initialState?.sorting?.sortModel ?? [],
|
|
3871
|
-
|
|
3883
|
+
useCallback12((sortModel2) => onSortModelChange?.(sortModel2), [onSortModelChange])
|
|
3872
3884
|
);
|
|
3873
3885
|
const [visibilityModel] = useControlledState(
|
|
3874
3886
|
columnVisibilityModel,
|
|
3875
3887
|
initialState?.columns?.columnVisibilityModel ?? {},
|
|
3876
|
-
|
|
3888
|
+
useCallback12(
|
|
3877
3889
|
(model) => onColumnVisibilityModelChange?.(model),
|
|
3878
3890
|
[onColumnVisibilityModelChange]
|
|
3879
3891
|
)
|
|
@@ -3913,10 +3925,10 @@ function useDataTableRenderer({
|
|
|
3913
3925
|
[reorderedColumns]
|
|
3914
3926
|
);
|
|
3915
3927
|
const allColumnIds = useMemo11(() => {
|
|
3916
|
-
const taken = new Set(reorderedColumns.map((column) =>
|
|
3928
|
+
const taken = new Set(reorderedColumns.map((column) => sanitizeColumnId(column.field)));
|
|
3917
3929
|
const assigned = /* @__PURE__ */ new Set();
|
|
3918
3930
|
return reorderedColumns.map((column) => {
|
|
3919
|
-
const field =
|
|
3931
|
+
const field = sanitizeColumnId(column.field);
|
|
3920
3932
|
if (!assigned.has(field)) {
|
|
3921
3933
|
assigned.add(field);
|
|
3922
3934
|
return field;
|
|
@@ -3944,7 +3956,7 @@ function useDataTableRenderer({
|
|
|
3944
3956
|
),
|
|
3945
3957
|
[visibleColumns, columnIds]
|
|
3946
3958
|
);
|
|
3947
|
-
const sortComparator =
|
|
3959
|
+
const sortComparator = useCallback12(
|
|
3948
3960
|
(rowA, rowB) => {
|
|
3949
3961
|
for (const sort of sortModel) {
|
|
3950
3962
|
const { field, sort: direction } = sort;
|
|
@@ -3983,7 +3995,7 @@ function useDataTableRenderer({
|
|
|
3983
3995
|
);
|
|
3984
3996
|
const [page, setPage] = useState9(paginationModel?.page || 1);
|
|
3985
3997
|
const pageSize = paginationModel?.pageSize || 20;
|
|
3986
|
-
const getId =
|
|
3998
|
+
const getId = useCallback12(
|
|
3987
3999
|
(row, index) => _getId?.(row) ?? row.id ?? `${(index || 0) + (page - 1) * pageSize}`,
|
|
3988
4000
|
[_getId, page, pageSize]
|
|
3989
4001
|
);
|
|
@@ -3999,7 +4011,7 @@ function useDataTableRenderer({
|
|
|
3999
4011
|
}),
|
|
4000
4012
|
[dataInPage, isRowSelectable, getId]
|
|
4001
4013
|
);
|
|
4002
|
-
const handleRangeSelection =
|
|
4014
|
+
const handleRangeSelection = useCallback12(
|
|
4003
4015
|
(anchor, targetIndex) => {
|
|
4004
4016
|
const startIndex = Math.min(anchor.rowIndex, targetIndex);
|
|
4005
4017
|
const endIndex = Math.max(anchor.rowIndex, targetIndex);
|
|
@@ -4042,7 +4054,7 @@ function useDataTableRenderer({
|
|
|
4042
4054
|
),
|
|
4043
4055
|
[visibleColumnsById, columnWidths]
|
|
4044
4056
|
);
|
|
4045
|
-
const getWidth =
|
|
4057
|
+
const getWidth = useCallback12(
|
|
4046
4058
|
// 반환값은 pinned offset으로 더해지므로 반드시 숫자여야 한다. width/minWidth는 '500px' 같은 문자열.
|
|
4047
4059
|
(f) => measuredWidthByField[f] ?? parsePxValue(allColumnsByField[f]?.width) ?? // Column prop 으로 지정된 width
|
|
4048
4060
|
parsePxValue(allColumnsByField[f]?.minWidth) ?? 0,
|
|
@@ -4067,7 +4079,7 @@ function useDataTableRenderer({
|
|
|
4067
4079
|
field: key
|
|
4068
4080
|
}));
|
|
4069
4081
|
return baseColumns.map((column, index) => {
|
|
4070
|
-
const columnId = columnIds[index] ??
|
|
4082
|
+
const columnId = columnIds[index] ?? sanitizeColumnId(column.field);
|
|
4071
4083
|
const isLeftPinned = effectivePinnedLeft?.includes(column.field);
|
|
4072
4084
|
const isRightPinned = effectivePinnedRight?.includes(column.field);
|
|
4073
4085
|
const isPinned = isLeftPinned || isRightPinned;
|
|
@@ -4100,14 +4112,14 @@ function useDataTableRenderer({
|
|
|
4100
4112
|
sortOrder,
|
|
4101
4113
|
getWidth
|
|
4102
4114
|
]);
|
|
4103
|
-
const handlePageChange =
|
|
4115
|
+
const handlePageChange = useCallback12(
|
|
4104
4116
|
(newPage) => {
|
|
4105
4117
|
setPage(newPage);
|
|
4106
4118
|
onPaginationModelChange?.({ page: newPage, pageSize });
|
|
4107
4119
|
},
|
|
4108
4120
|
[onPaginationModelChange, pageSize]
|
|
4109
4121
|
);
|
|
4110
|
-
const handleSortChange =
|
|
4122
|
+
const handleSortChange = useCallback12(
|
|
4111
4123
|
(props) => {
|
|
4112
4124
|
const { field, currentSort, multiple } = props;
|
|
4113
4125
|
const column = allColumnsByField[field];
|
|
@@ -4145,14 +4157,14 @@ function useDataTableRenderer({
|
|
|
4145
4157
|
onSelectionModelChangeRef.current?.([]);
|
|
4146
4158
|
setSelectionAnchor(null);
|
|
4147
4159
|
}, [page]);
|
|
4148
|
-
const prevRowsRef =
|
|
4160
|
+
const prevRowsRef = useRef7(_rows);
|
|
4149
4161
|
useEffect6(() => {
|
|
4150
4162
|
if (prevRowsRef.current !== _rows) {
|
|
4151
4163
|
setSelectionAnchor(null);
|
|
4152
4164
|
prevRowsRef.current = _rows;
|
|
4153
4165
|
}
|
|
4154
4166
|
}, [_rows]);
|
|
4155
|
-
const handleAutoFit =
|
|
4167
|
+
const handleAutoFit = useCallback12(
|
|
4156
4168
|
(columnId) => {
|
|
4157
4169
|
const colDef = visibleColumnsById[columnId];
|
|
4158
4170
|
if (!colDef?.headerRef.current) return;
|
|
@@ -4184,8 +4196,8 @@ function useDataTableRenderer({
|
|
|
4184
4196
|
handleAutoFit,
|
|
4185
4197
|
isAllSelected,
|
|
4186
4198
|
isTotalSelected,
|
|
4187
|
-
isSelectedRow:
|
|
4188
|
-
isRowSelectable:
|
|
4199
|
+
isSelectedRow: useCallback12((model) => selectedModelSet.has(model), [selectedModelSet]),
|
|
4200
|
+
isRowSelectable: useCallback12(
|
|
4189
4201
|
(rowId, row) => {
|
|
4190
4202
|
if (!isRowSelectable) return true;
|
|
4191
4203
|
return isRowSelectable({ row, id: rowId });
|
|
@@ -4193,13 +4205,13 @@ function useDataTableRenderer({
|
|
|
4193
4205
|
[isRowSelectable]
|
|
4194
4206
|
),
|
|
4195
4207
|
focusedRowId,
|
|
4196
|
-
onRowFocus:
|
|
4208
|
+
onRowFocus: useCallback12((rowId) => {
|
|
4197
4209
|
setFocusedRowId(rowId);
|
|
4198
4210
|
}, []),
|
|
4199
|
-
onAllCheckboxChange:
|
|
4211
|
+
onAllCheckboxChange: useCallback12(() => {
|
|
4200
4212
|
onSelectionModelChange?.(isAllSelected ? [] : selectableDataInPage.map(getId));
|
|
4201
4213
|
}, [isAllSelected, selectableDataInPage, onSelectionModelChange, getId]),
|
|
4202
|
-
onCheckboxChange:
|
|
4214
|
+
onCheckboxChange: useCallback12(
|
|
4203
4215
|
(event, selectedModel) => {
|
|
4204
4216
|
const isShiftClick = "shiftKey" in event && event.shiftKey;
|
|
4205
4217
|
const rowIndex = dataInPage.findIndex((row, i) => getId(row, i) === selectedModel);
|
|
@@ -4233,7 +4245,7 @@ function useDataTableRenderer({
|
|
|
4233
4245
|
columns,
|
|
4234
4246
|
tableMinWidth,
|
|
4235
4247
|
processedColumnGroups,
|
|
4236
|
-
onTotalSelect:
|
|
4248
|
+
onTotalSelect: useCallback12(() => {
|
|
4237
4249
|
const selectableRows = rows.filter((row, i) => {
|
|
4238
4250
|
if (!isRowSelectable) return true;
|
|
4239
4251
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
@@ -4318,7 +4330,7 @@ function TableBody(props) {
|
|
|
4318
4330
|
TableBody.displayName = "TableBody";
|
|
4319
4331
|
|
|
4320
4332
|
// src/components/Pagination/Pagination.tsx
|
|
4321
|
-
import React25, { useCallback as
|
|
4333
|
+
import React25, { useCallback as useCallback13, useEffect as useEffect7 } from "react";
|
|
4322
4334
|
import PreviousIcon from "@mui/icons-material/ChevronLeftRounded";
|
|
4323
4335
|
import NextIcon from "@mui/icons-material/ChevronRightRounded";
|
|
4324
4336
|
import FirstPageIcon from "@mui/icons-material/FirstPageRounded";
|
|
@@ -4388,7 +4400,7 @@ function Pagination(inProps) {
|
|
|
4388
4400
|
const [paginationModel, setPaginationModel] = useControlledState(
|
|
4389
4401
|
_paginationModel,
|
|
4390
4402
|
defaultPaginationModel,
|
|
4391
|
-
|
|
4403
|
+
useCallback13(
|
|
4392
4404
|
(newPage) => {
|
|
4393
4405
|
onPageChange(newPage.page);
|
|
4394
4406
|
},
|
|
@@ -4606,8 +4618,8 @@ function Component(props, apiRef) {
|
|
|
4606
4618
|
...innerProps
|
|
4607
4619
|
} = props;
|
|
4608
4620
|
const tableId = useId();
|
|
4609
|
-
const parentRef =
|
|
4610
|
-
const tableBodyRef =
|
|
4621
|
+
const parentRef = useRef8(null);
|
|
4622
|
+
const tableBodyRef = useRef8(null);
|
|
4611
4623
|
const {
|
|
4612
4624
|
columns,
|
|
4613
4625
|
processedColumnGroups,
|
|
@@ -4671,20 +4683,20 @@ function Component(props, apiRef) {
|
|
|
4671
4683
|
const showNoRowsOverlay = !loading && rowCount === 0;
|
|
4672
4684
|
const showFillerColumn = columns.length > 0 && columns.every((c) => !!c.width);
|
|
4673
4685
|
const totalColCount = Math.max(1, columns.length + (checkboxSelection ? 1 : 0) + (showFillerColumn ? 1 : 0));
|
|
4674
|
-
const getRowClickHandler =
|
|
4686
|
+
const getRowClickHandler = useCallback14(
|
|
4675
4687
|
(row, rowId) => (e) => {
|
|
4676
4688
|
onRowClick?.({ row, rowId }, e);
|
|
4677
4689
|
checkboxSelection && !disableSelectionOnClick && isRowSelectableCheck(rowId, row) && onCheckboxChange(e, rowId);
|
|
4678
4690
|
},
|
|
4679
4691
|
[onRowClick, checkboxSelection, disableSelectionOnClick, onCheckboxChange, isRowSelectableCheck]
|
|
4680
4692
|
);
|
|
4681
|
-
const getRowFocusHandler =
|
|
4693
|
+
const getRowFocusHandler = useCallback14(
|
|
4682
4694
|
(rowId) => () => {
|
|
4683
4695
|
onRowFocus(rowId);
|
|
4684
4696
|
},
|
|
4685
4697
|
[onRowFocus]
|
|
4686
4698
|
);
|
|
4687
|
-
const getCheckboxClickHandler =
|
|
4699
|
+
const getCheckboxClickHandler = useCallback14(
|
|
4688
4700
|
(rowId, row) => (e) => {
|
|
4689
4701
|
e.stopPropagation();
|
|
4690
4702
|
if (isRowSelectableCheck(rowId, row)) {
|
|
@@ -4694,7 +4706,7 @@ function Component(props, apiRef) {
|
|
|
4694
4706
|
},
|
|
4695
4707
|
[onCheckboxChange, isRowSelectableCheck, onRowFocus]
|
|
4696
4708
|
);
|
|
4697
|
-
const handleTableKeyDown =
|
|
4709
|
+
const handleTableKeyDown = useCallback14(
|
|
4698
4710
|
(e) => {
|
|
4699
4711
|
const supportedKeys = ["ArrowUp", "ArrowDown", " ", "Home", "End", "PageUp", "PageDown"];
|
|
4700
4712
|
if (!supportedKeys.includes(e.key)) return;
|
|
@@ -4905,13 +4917,13 @@ function Component(props, apiRef) {
|
|
|
4905
4917
|
}
|
|
4906
4918
|
},
|
|
4907
4919
|
headerCheckboxElement
|
|
4908
|
-
), columns.map((c
|
|
4920
|
+
), columns.map((c) => (
|
|
4909
4921
|
// @ts-ignore
|
|
4910
4922
|
/* @__PURE__ */ React26.createElement(
|
|
4911
4923
|
HeadCell2,
|
|
4912
4924
|
{
|
|
4913
4925
|
tableId,
|
|
4914
|
-
key:
|
|
4926
|
+
key: c.columnId,
|
|
4915
4927
|
stickyHeader: props.stickyHeader,
|
|
4916
4928
|
editMode: !!c.isCellEditable,
|
|
4917
4929
|
onSortChange: handleSortChange,
|
|
@@ -5041,7 +5053,7 @@ var DataTable = forwardRef7(Component);
|
|
|
5041
5053
|
DataTable.displayName = "DataTable";
|
|
5042
5054
|
|
|
5043
5055
|
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
5044
|
-
import React27, { forwardRef as forwardRef8, useCallback as
|
|
5056
|
+
import React27, { forwardRef as forwardRef8, useCallback as useCallback15, useEffect as useEffect8, useImperativeHandle as useImperativeHandle3, useMemo as useMemo13, useRef as useRef9, useState as useState10 } from "react";
|
|
5045
5057
|
import { IMaskInput as IMaskInput2, IMask as IMask2 } from "react-imask";
|
|
5046
5058
|
import CalendarTodayIcon2 from "@mui/icons-material/CalendarToday";
|
|
5047
5059
|
import { styled as styled14, useThemeProps as useThemeProps7 } from "@mui/joy";
|
|
@@ -5246,12 +5258,12 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5246
5258
|
numberOfMonths,
|
|
5247
5259
|
...innerProps
|
|
5248
5260
|
} = props;
|
|
5249
|
-
const innerRef =
|
|
5250
|
-
const buttonRef =
|
|
5261
|
+
const innerRef = useRef9(null);
|
|
5262
|
+
const buttonRef = useRef9(null);
|
|
5251
5263
|
const [rawValue, setValue] = useControlledState(
|
|
5252
5264
|
props.value,
|
|
5253
5265
|
props.defaultValue ?? null,
|
|
5254
|
-
|
|
5266
|
+
useCallback15(
|
|
5255
5267
|
(value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
|
|
5256
5268
|
[props.name, onChange]
|
|
5257
5269
|
)
|
|
@@ -5285,7 +5297,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5285
5297
|
}
|
|
5286
5298
|
}, [anchorEl, innerRef]);
|
|
5287
5299
|
useImperativeHandle3(ref, () => innerRef.current, [innerRef]);
|
|
5288
|
-
const handleChange =
|
|
5300
|
+
const handleChange = useCallback15(
|
|
5289
5301
|
(event) => {
|
|
5290
5302
|
const value2 = event.target.value;
|
|
5291
5303
|
setDisplayValue(value2 ? formatValueString2(parseDates(value2, format), displayFormat, locale) : value2);
|
|
@@ -5293,7 +5305,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5293
5305
|
},
|
|
5294
5306
|
[displayFormat, format, locale, setValue]
|
|
5295
5307
|
);
|
|
5296
|
-
const handleDisplayInputChange =
|
|
5308
|
+
const handleDisplayInputChange = useCallback15(
|
|
5297
5309
|
(event) => {
|
|
5298
5310
|
if (event.target.value === "") {
|
|
5299
5311
|
handleChange({
|
|
@@ -5318,14 +5330,14 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5318
5330
|
},
|
|
5319
5331
|
[displayFormat, format, handleChange, props.name]
|
|
5320
5332
|
);
|
|
5321
|
-
const handleCalendarToggle =
|
|
5333
|
+
const handleCalendarToggle = useCallback15(
|
|
5322
5334
|
(event) => {
|
|
5323
5335
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
5324
5336
|
innerRef.current?.focus();
|
|
5325
5337
|
},
|
|
5326
5338
|
[anchorEl, setAnchorEl, innerRef]
|
|
5327
5339
|
);
|
|
5328
|
-
const handleCalendarChange =
|
|
5340
|
+
const handleCalendarChange = useCallback15(
|
|
5329
5341
|
([date1, date2]) => {
|
|
5330
5342
|
if (!date1 || !date2) return;
|
|
5331
5343
|
const formattedValue = formatValueString2([date1, date2], format);
|
|
@@ -5339,7 +5351,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5339
5351
|
},
|
|
5340
5352
|
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat, locale]
|
|
5341
5353
|
);
|
|
5342
|
-
const handleInputMouseDown =
|
|
5354
|
+
const handleInputMouseDown = useCallback15(
|
|
5343
5355
|
(event) => {
|
|
5344
5356
|
if (inputReadOnly || isAlphabeticDisplay) {
|
|
5345
5357
|
event.preventDefault();
|
|
@@ -5348,7 +5360,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5348
5360
|
},
|
|
5349
5361
|
[inputReadOnly, isAlphabeticDisplay, buttonRef]
|
|
5350
5362
|
);
|
|
5351
|
-
const handleInputClick =
|
|
5363
|
+
const handleInputClick = useCallback15(
|
|
5352
5364
|
(event) => {
|
|
5353
5365
|
if (inputReadOnly && !readOnly) {
|
|
5354
5366
|
handleCalendarToggle(event);
|
|
@@ -5356,7 +5368,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5356
5368
|
},
|
|
5357
5369
|
[inputReadOnly, readOnly, handleCalendarToggle]
|
|
5358
5370
|
);
|
|
5359
|
-
const handlePresetClick =
|
|
5371
|
+
const handlePresetClick = useCallback15(
|
|
5360
5372
|
(presetValue) => {
|
|
5361
5373
|
if (props.value !== void 0) {
|
|
5362
5374
|
onChange?.({ target: { name: props.name, value: presetValue } });
|
|
@@ -5369,7 +5381,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5369
5381
|
},
|
|
5370
5382
|
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat, locale]
|
|
5371
5383
|
);
|
|
5372
|
-
const isPresetDisabled =
|
|
5384
|
+
const isPresetDisabled = useCallback15(
|
|
5373
5385
|
(presetValue) => {
|
|
5374
5386
|
try {
|
|
5375
5387
|
const dates = parseDates(presetValue, format);
|
|
@@ -5559,7 +5571,7 @@ var ModalOverflow = MotionModalOverflow;
|
|
|
5559
5571
|
ModalOverflow.displayName = "ModalOverflow";
|
|
5560
5572
|
var ModalFrame = React28.forwardRef((props, ref) => {
|
|
5561
5573
|
const { title, children, titleStartDecorator, onClose, ...innerProps } = props;
|
|
5562
|
-
return /* @__PURE__ */ React28.createElement(StyledModalDialog, {
|
|
5574
|
+
return /* @__PURE__ */ React28.createElement(StyledModalDialog, { ...innerProps, ref }, /* @__PURE__ */ React28.createElement(ModalClose, { onClick: onClose }), /* @__PURE__ */ React28.createElement(DialogTitle_default, null, titleStartDecorator, title), /* @__PURE__ */ React28.createElement(DialogContent_default, null, children));
|
|
5563
5575
|
});
|
|
5564
5576
|
ModalFrame.displayName = "ModalFrame";
|
|
5565
5577
|
|
|
@@ -5605,14 +5617,14 @@ var InsetDrawer = styled19(JoyDrawer)(({ theme }) => ({
|
|
|
5605
5617
|
}));
|
|
5606
5618
|
|
|
5607
5619
|
// src/components/FilterableCheckboxGroup/FilterableCheckboxGroup.tsx
|
|
5608
|
-
import React31, { useCallback as
|
|
5620
|
+
import React31, { useCallback as useCallback16, useEffect as useEffect9, useMemo as useMemo14, useRef as useRef10, useState as useState11 } from "react";
|
|
5609
5621
|
import SearchIcon from "@mui/icons-material/Search";
|
|
5610
5622
|
import { useThemeProps as useThemeProps8 } from "@mui/joy";
|
|
5611
5623
|
import { useVirtualizer as useVirtualizer3 } from "@tanstack/react-virtual";
|
|
5612
5624
|
var EMPTY_VALUE = [];
|
|
5613
5625
|
function LabelWithTooltip(props) {
|
|
5614
5626
|
const { label, size } = props;
|
|
5615
|
-
const labelContentRef =
|
|
5627
|
+
const labelContentRef = useRef10(null);
|
|
5616
5628
|
const [isOverflowing, setIsOverflowing] = useState11(false);
|
|
5617
5629
|
const labelContent = /* @__PURE__ */ React31.createElement(
|
|
5618
5630
|
"span",
|
|
@@ -5660,12 +5672,12 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5660
5672
|
const [rawValue, setInternalValue] = useControlledState(
|
|
5661
5673
|
value,
|
|
5662
5674
|
value ?? EMPTY_VALUE,
|
|
5663
|
-
|
|
5675
|
+
useCallback16((newValue) => onChange?.(newValue ?? []), [onChange])
|
|
5664
5676
|
);
|
|
5665
5677
|
const internalValue = rawValue ?? EMPTY_VALUE;
|
|
5666
|
-
const parentRef =
|
|
5667
|
-
const isInitialSortRef =
|
|
5668
|
-
const prevOptionsRef =
|
|
5678
|
+
const parentRef = useRef10(null);
|
|
5679
|
+
const isInitialSortRef = useRef10(false);
|
|
5680
|
+
const prevOptionsRef = useRef10([...options]);
|
|
5669
5681
|
const filteredOptions = useMemo14(() => {
|
|
5670
5682
|
if (!searchTerm) return sortedOptions;
|
|
5671
5683
|
return sortedOptions.filter((option) => option.label.toLowerCase().includes(searchTerm.toLowerCase()));
|
|
@@ -5717,10 +5729,10 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5717
5729
|
useEffect9(() => {
|
|
5718
5730
|
virtualizer.measure();
|
|
5719
5731
|
}, [virtualizer, filteredOptions, size]);
|
|
5720
|
-
const handleSearchChange =
|
|
5732
|
+
const handleSearchChange = useCallback16((event) => {
|
|
5721
5733
|
setSearchTerm(event.target.value);
|
|
5722
5734
|
}, []);
|
|
5723
|
-
const handleCheckboxChange =
|
|
5735
|
+
const handleCheckboxChange = useCallback16(
|
|
5724
5736
|
(optionValue) => (event) => {
|
|
5725
5737
|
const checked = event.target.checked;
|
|
5726
5738
|
const newValue = checked ? [...internalValue, optionValue] : internalValue.filter((v) => v !== optionValue);
|
|
@@ -5728,7 +5740,7 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5728
5740
|
},
|
|
5729
5741
|
[internalValue, setInternalValue]
|
|
5730
5742
|
);
|
|
5731
|
-
const handleSelectAll =
|
|
5743
|
+
const handleSelectAll = useCallback16(
|
|
5732
5744
|
(event) => {
|
|
5733
5745
|
const checked = event.target.checked;
|
|
5734
5746
|
const enabledOptions = filteredOptions.filter((option) => !option.disabled);
|
|
@@ -5832,16 +5844,16 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5832
5844
|
FilterableCheckboxGroup.displayName = "FilterableCheckboxGroup";
|
|
5833
5845
|
|
|
5834
5846
|
// src/components/FilterMenu/FilterMenu.tsx
|
|
5835
|
-
import React44, { useCallback as
|
|
5847
|
+
import React44, { useCallback as useCallback28, useContext, useEffect as useEffect12 } from "react";
|
|
5836
5848
|
import { Button as Button2, Stack as Stack12 } from "@mui/joy";
|
|
5837
5849
|
|
|
5838
5850
|
// src/components/FilterMenu/components/CheckboxGroup.tsx
|
|
5839
|
-
import React32, { useCallback as
|
|
5851
|
+
import React32, { useCallback as useCallback17 } from "react";
|
|
5840
5852
|
import { Stack as Stack2 } from "@mui/joy";
|
|
5841
5853
|
function CheckboxGroup(props) {
|
|
5842
5854
|
const { id, label, options, value, onChange, hidden } = props;
|
|
5843
5855
|
const [internalValue, setInternalValue] = useControlledState(value, [], onChange);
|
|
5844
|
-
const handleCheckboxChange =
|
|
5856
|
+
const handleCheckboxChange = useCallback17(
|
|
5845
5857
|
(optionValue) => (event) => {
|
|
5846
5858
|
const checked = event.target.checked;
|
|
5847
5859
|
let newValue;
|
|
@@ -5870,12 +5882,12 @@ function CheckboxGroup(props) {
|
|
|
5870
5882
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
5871
5883
|
|
|
5872
5884
|
// src/components/FilterMenu/components/FilterableCheckboxGroup.tsx
|
|
5873
|
-
import React33, { useCallback as
|
|
5885
|
+
import React33, { useCallback as useCallback18 } from "react";
|
|
5874
5886
|
import { Stack as Stack3 } from "@mui/joy";
|
|
5875
5887
|
function FilterableCheckboxGroup2(props) {
|
|
5876
5888
|
const { id, label, options, value, onChange, hidden, placeholder, maxHeight } = props;
|
|
5877
5889
|
const [internalValue, setInternalValue] = useControlledState(value, [], onChange);
|
|
5878
|
-
const handleChange =
|
|
5890
|
+
const handleChange = useCallback18(
|
|
5879
5891
|
(newValue) => {
|
|
5880
5892
|
setInternalValue(newValue);
|
|
5881
5893
|
},
|
|
@@ -5899,7 +5911,7 @@ function FilterableCheckboxGroup2(props) {
|
|
|
5899
5911
|
FilterableCheckboxGroup2.displayName = "FilterableCheckboxGroup";
|
|
5900
5912
|
|
|
5901
5913
|
// src/components/FilterMenu/components/RadioGroup.tsx
|
|
5902
|
-
import React34, { useCallback as
|
|
5914
|
+
import React34, { useCallback as useCallback19 } from "react";
|
|
5903
5915
|
|
|
5904
5916
|
// src/components/Radio/Radio.tsx
|
|
5905
5917
|
import { Radio as JoyRadio, RadioGroup as JoyRadioGroup } from "@mui/joy";
|
|
@@ -5916,7 +5928,7 @@ import { Stack as Stack4 } from "@mui/joy";
|
|
|
5916
5928
|
function RadioGroup2(props) {
|
|
5917
5929
|
const { id, label, options, value, onChange, hidden } = props;
|
|
5918
5930
|
const [internalValue, setInternalValue] = useControlledState(value, value ?? "", onChange);
|
|
5919
|
-
const handleRadioChange =
|
|
5931
|
+
const handleRadioChange = useCallback19(
|
|
5920
5932
|
(event) => {
|
|
5921
5933
|
const newValue = event.target.value;
|
|
5922
5934
|
const option = options.find((opt) => opt.value.toString() === newValue);
|
|
@@ -5933,7 +5945,7 @@ function RadioGroup2(props) {
|
|
|
5933
5945
|
RadioGroup2.displayName = "RadioGroup";
|
|
5934
5946
|
|
|
5935
5947
|
// src/components/FilterMenu/components/DateRange.tsx
|
|
5936
|
-
import React35, { useCallback as
|
|
5948
|
+
import React35, { useCallback as useCallback20, useMemo as useMemo15, useState as useState12, useEffect as useEffect10 } from "react";
|
|
5937
5949
|
import { Stack as Stack5 } from "@mui/joy";
|
|
5938
5950
|
function DateRange(props) {
|
|
5939
5951
|
const {
|
|
@@ -5962,7 +5974,7 @@ function DateRange(props) {
|
|
|
5962
5974
|
],
|
|
5963
5975
|
[]
|
|
5964
5976
|
);
|
|
5965
|
-
const getDateRangeForOption =
|
|
5977
|
+
const getDateRangeForOption = useCallback20(
|
|
5966
5978
|
(option) => {
|
|
5967
5979
|
const now = /* @__PURE__ */ new Date();
|
|
5968
5980
|
const currentYear = now.getFullYear();
|
|
@@ -6001,7 +6013,7 @@ function DateRange(props) {
|
|
|
6001
6013
|
},
|
|
6002
6014
|
[internalValue]
|
|
6003
6015
|
);
|
|
6004
|
-
const determineOptionFromValue =
|
|
6016
|
+
const determineOptionFromValue = useCallback20(
|
|
6005
6017
|
(value2) => {
|
|
6006
6018
|
if (!value2) {
|
|
6007
6019
|
return "all-time";
|
|
@@ -6027,7 +6039,7 @@ function DateRange(props) {
|
|
|
6027
6039
|
const newOption = determineOptionFromValue(internalValue);
|
|
6028
6040
|
setSelectedOption(newOption);
|
|
6029
6041
|
}, [internalValue, determineOptionFromValue]);
|
|
6030
|
-
const handleOptionChange =
|
|
6042
|
+
const handleOptionChange = useCallback20(
|
|
6031
6043
|
(event) => {
|
|
6032
6044
|
const newOption = event.target.value;
|
|
6033
6045
|
setSelectedOption(newOption);
|
|
@@ -6036,7 +6048,7 @@ function DateRange(props) {
|
|
|
6036
6048
|
},
|
|
6037
6049
|
[getDateRangeForOption, setInternalValue]
|
|
6038
6050
|
);
|
|
6039
|
-
const handleCustomDateChange =
|
|
6051
|
+
const handleCustomDateChange = useCallback20(
|
|
6040
6052
|
(event) => {
|
|
6041
6053
|
const dateRangeString = event.target.value;
|
|
6042
6054
|
if (dateRangeString && dateRangeString.includes(" - ")) {
|
|
@@ -6076,11 +6088,11 @@ function DateRange(props) {
|
|
|
6076
6088
|
DateRange.displayName = "DateRange";
|
|
6077
6089
|
|
|
6078
6090
|
// src/components/FilterMenu/components/MonthRange.tsx
|
|
6079
|
-
import React37, { useCallback as
|
|
6091
|
+
import React37, { useCallback as useCallback22, useMemo as useMemo17 } from "react";
|
|
6080
6092
|
import { Stack as Stack6 } from "@mui/joy";
|
|
6081
6093
|
|
|
6082
6094
|
// src/components/MonthRangePicker/MonthRangePicker.tsx
|
|
6083
|
-
import React36, { forwardRef as forwardRef9, useCallback as
|
|
6095
|
+
import React36, { forwardRef as forwardRef9, useCallback as useCallback21, useEffect as useEffect11, useImperativeHandle as useImperativeHandle4, useMemo as useMemo16, useRef as useRef11, useState as useState13 } from "react";
|
|
6084
6096
|
import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
|
|
6085
6097
|
import CalendarTodayIcon3 from "@mui/icons-material/CalendarToday";
|
|
6086
6098
|
import { styled as styled20, useThemeProps as useThemeProps9 } from "@mui/joy";
|
|
@@ -6195,12 +6207,12 @@ var MonthRangePicker = forwardRef9((inProps, ref) => {
|
|
|
6195
6207
|
} = props;
|
|
6196
6208
|
const displayFormat = displayFormatProp ?? format;
|
|
6197
6209
|
const isAlphabeticDisplay = hasAlphabeticMonth3(displayFormat);
|
|
6198
|
-
const innerRef =
|
|
6199
|
-
const buttonRef =
|
|
6210
|
+
const innerRef = useRef11(null);
|
|
6211
|
+
const buttonRef = useRef11(null);
|
|
6200
6212
|
const [rawValue, setValue] = useControlledState(
|
|
6201
6213
|
props.value,
|
|
6202
6214
|
props.defaultValue ?? null,
|
|
6203
|
-
|
|
6215
|
+
useCallback21(
|
|
6204
6216
|
(value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
|
|
6205
6217
|
[props.name, onChange]
|
|
6206
6218
|
)
|
|
@@ -6230,7 +6242,7 @@ var MonthRangePicker = forwardRef9((inProps, ref) => {
|
|
|
6230
6242
|
}
|
|
6231
6243
|
}, [anchorEl, innerRef]);
|
|
6232
6244
|
useImperativeHandle4(ref, () => innerRef.current, [innerRef]);
|
|
6233
|
-
const handleChange =
|
|
6245
|
+
const handleChange = useCallback21(
|
|
6234
6246
|
(event) => {
|
|
6235
6247
|
setDisplayValue(
|
|
6236
6248
|
event.target.value ? formatValueString3(parseDates2(event.target.value), displayFormat, locale) : ""
|
|
@@ -6239,7 +6251,7 @@ var MonthRangePicker = forwardRef9((inProps, ref) => {
|
|
|
6239
6251
|
},
|
|
6240
6252
|
[displayFormat, locale, setValue]
|
|
6241
6253
|
);
|
|
6242
|
-
const handleInputMouseDown =
|
|
6254
|
+
const handleInputMouseDown = useCallback21(
|
|
6243
6255
|
(event) => {
|
|
6244
6256
|
if (isAlphabeticDisplay) {
|
|
6245
6257
|
event.preventDefault();
|
|
@@ -6248,14 +6260,14 @@ var MonthRangePicker = forwardRef9((inProps, ref) => {
|
|
|
6248
6260
|
},
|
|
6249
6261
|
[isAlphabeticDisplay, buttonRef]
|
|
6250
6262
|
);
|
|
6251
|
-
const handleCalendarToggle =
|
|
6263
|
+
const handleCalendarToggle = useCallback21(
|
|
6252
6264
|
(event) => {
|
|
6253
6265
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
6254
6266
|
innerRef.current?.focus();
|
|
6255
6267
|
},
|
|
6256
6268
|
[anchorEl, setAnchorEl, innerRef]
|
|
6257
6269
|
);
|
|
6258
|
-
const handleCalendarChange =
|
|
6270
|
+
const handleCalendarChange = useCallback21(
|
|
6259
6271
|
([date1, date2]) => {
|
|
6260
6272
|
if (!date1 || !date2) return;
|
|
6261
6273
|
const formattedValue = formatValueString3([date1, date2], format);
|
|
@@ -6390,7 +6402,7 @@ function MonthRange(props) {
|
|
|
6390
6402
|
() => internalValue ? `${internalValue[0]} - ${internalValue[1]}` : "",
|
|
6391
6403
|
[internalValue]
|
|
6392
6404
|
);
|
|
6393
|
-
const handleChange =
|
|
6405
|
+
const handleChange = useCallback22(
|
|
6394
6406
|
(event) => {
|
|
6395
6407
|
const rangeString = event.target.value;
|
|
6396
6408
|
if (rangeString && rangeString.includes(" - ")) {
|
|
@@ -6425,12 +6437,12 @@ function MonthRange(props) {
|
|
|
6425
6437
|
MonthRange.displayName = "MonthRange";
|
|
6426
6438
|
|
|
6427
6439
|
// src/components/FilterMenu/components/CurrencyInput.tsx
|
|
6428
|
-
import React38, { useCallback as
|
|
6440
|
+
import React38, { useCallback as useCallback23 } from "react";
|
|
6429
6441
|
import { Stack as Stack7 } from "@mui/joy";
|
|
6430
6442
|
function CurrencyInput3(props) {
|
|
6431
6443
|
const { id, label, value, onChange, hidden, max, placeholder, useMinorUnit, currency = "USD" } = props;
|
|
6432
6444
|
const [internalValue, setInternalValue] = useControlledState(value, value, onChange);
|
|
6433
|
-
const handleCurrencyChange =
|
|
6445
|
+
const handleCurrencyChange = useCallback23(
|
|
6434
6446
|
(event) => {
|
|
6435
6447
|
const newValue = event.target.value ?? void 0;
|
|
6436
6448
|
setInternalValue(newValue);
|
|
@@ -6456,14 +6468,14 @@ function CurrencyInput3(props) {
|
|
|
6456
6468
|
CurrencyInput3.displayName = "CurrencyInput";
|
|
6457
6469
|
|
|
6458
6470
|
// src/components/FilterMenu/components/CurrencyRange.tsx
|
|
6459
|
-
import React39, { useCallback as
|
|
6471
|
+
import React39, { useCallback as useCallback24 } from "react";
|
|
6460
6472
|
import { Stack as Stack8 } from "@mui/joy";
|
|
6461
6473
|
function CurrencyRange(props) {
|
|
6462
6474
|
const { id, label, value, onChange, hidden, max, placeholder, useMinorUnit, currency = "USD" } = props;
|
|
6463
6475
|
const [internalValue, setInternalValue] = useControlledState(value, null, onChange);
|
|
6464
6476
|
const minValue = internalValue?.[0];
|
|
6465
6477
|
const maxValue = internalValue?.[1];
|
|
6466
|
-
const handleMinChange =
|
|
6478
|
+
const handleMinChange = useCallback24(
|
|
6467
6479
|
(event) => {
|
|
6468
6480
|
const newMinValue = event.target.value ?? void 0;
|
|
6469
6481
|
const currentMaxValue = maxValue;
|
|
@@ -6477,7 +6489,7 @@ function CurrencyRange(props) {
|
|
|
6477
6489
|
},
|
|
6478
6490
|
[maxValue, setInternalValue]
|
|
6479
6491
|
);
|
|
6480
|
-
const handleMaxChange =
|
|
6492
|
+
const handleMaxChange = useCallback24(
|
|
6481
6493
|
(event) => {
|
|
6482
6494
|
const newMaxValue = event.target.value ?? void 0;
|
|
6483
6495
|
const currentMinValue = minValue;
|
|
@@ -6529,7 +6541,7 @@ import React41 from "react";
|
|
|
6529
6541
|
import { Stack as Stack9, Typography as Typography5 } from "@mui/joy";
|
|
6530
6542
|
|
|
6531
6543
|
// src/components/PercentageInput/PercentageInput.tsx
|
|
6532
|
-
import React40, { useCallback as
|
|
6544
|
+
import React40, { useCallback as useCallback25, useMemo as useMemo18 } from "react";
|
|
6533
6545
|
import { NumericFormat as NumericFormat2 } from "react-number-format";
|
|
6534
6546
|
import { styled as styled21, useThemeProps as useThemeProps10 } from "@mui/joy";
|
|
6535
6547
|
var padDecimal = (value, decimalScale) => {
|
|
@@ -6586,7 +6598,7 @@ var PercentageInput = React40.forwardRef(
|
|
|
6586
6598
|
const [_value, setValue] = useControlledState(
|
|
6587
6599
|
props.value,
|
|
6588
6600
|
props.defaultValue ?? null,
|
|
6589
|
-
|
|
6601
|
+
useCallback25((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
6590
6602
|
);
|
|
6591
6603
|
const value = useMemo18(() => {
|
|
6592
6604
|
if (_value && useMinorUnit) {
|
|
@@ -6598,7 +6610,7 @@ var PercentageInput = React40.forwardRef(
|
|
|
6598
6610
|
() => value != null && (max != null && value > max || min != null && value < min),
|
|
6599
6611
|
[max, min, value]
|
|
6600
6612
|
);
|
|
6601
|
-
const handleChange =
|
|
6613
|
+
const handleChange = useCallback25(
|
|
6602
6614
|
(event) => {
|
|
6603
6615
|
if (event.target.value === "") {
|
|
6604
6616
|
setValue(null);
|
|
@@ -6672,7 +6684,7 @@ var PercentageInput3 = ({
|
|
|
6672
6684
|
};
|
|
6673
6685
|
|
|
6674
6686
|
// src/components/FilterMenu/components/PercentageRange.tsx
|
|
6675
|
-
import React42, { useCallback as
|
|
6687
|
+
import React42, { useCallback as useCallback26 } from "react";
|
|
6676
6688
|
import { Stack as Stack10 } from "@mui/joy";
|
|
6677
6689
|
function PercentageRange(props) {
|
|
6678
6690
|
const { id, label, value, onChange, hidden, useMinorUnit, maxDecimalScale, min, max } = props;
|
|
@@ -6683,7 +6695,7 @@ function PercentageRange(props) {
|
|
|
6683
6695
|
);
|
|
6684
6696
|
const minValue = internalValue?.[0];
|
|
6685
6697
|
const maxValue = internalValue?.[1];
|
|
6686
|
-
const handleMinChange =
|
|
6698
|
+
const handleMinChange = useCallback26(
|
|
6687
6699
|
(event) => {
|
|
6688
6700
|
const newMinValue = event.target.value ?? void 0;
|
|
6689
6701
|
const currentMaxValue = maxValue;
|
|
@@ -6695,7 +6707,7 @@ function PercentageRange(props) {
|
|
|
6695
6707
|
},
|
|
6696
6708
|
[maxValue, setInternalValue]
|
|
6697
6709
|
);
|
|
6698
|
-
const handleMaxChange =
|
|
6710
|
+
const handleMaxChange = useCallback26(
|
|
6699
6711
|
(event) => {
|
|
6700
6712
|
const newMaxValue = event.target.value ?? void 0;
|
|
6701
6713
|
const currentMinValue = minValue;
|
|
@@ -6743,13 +6755,13 @@ function PercentageRange(props) {
|
|
|
6743
6755
|
PercentageRange.displayName = "PercentageRange";
|
|
6744
6756
|
|
|
6745
6757
|
// src/components/FilterMenu/components/Autocomplete.tsx
|
|
6746
|
-
import React43, { useCallback as
|
|
6758
|
+
import React43, { useCallback as useCallback27 } from "react";
|
|
6747
6759
|
import { Stack as Stack11 } from "@mui/joy";
|
|
6748
6760
|
function Autocomplete2(props) {
|
|
6749
6761
|
const { id, label, value, onChange, options, multiple, hidden, placeholder } = props;
|
|
6750
6762
|
const [internalValue, setInternalValue] = useControlledState(value, void 0, onChange);
|
|
6751
6763
|
const autocompleteValue = typeof internalValue === "string" || typeof internalValue === "number" ? String(internalValue) : void 0;
|
|
6752
|
-
const handleChange =
|
|
6764
|
+
const handleChange = useCallback27(
|
|
6753
6765
|
(event) => {
|
|
6754
6766
|
const val = event.target.value ?? void 0;
|
|
6755
6767
|
if (val) {
|
|
@@ -6805,7 +6817,7 @@ function FilterMenu(props) {
|
|
|
6805
6817
|
dropdownRegistry.register();
|
|
6806
6818
|
return () => dropdownRegistry.unregister();
|
|
6807
6819
|
}, [dropdownRegistry]);
|
|
6808
|
-
const handleFilterChange =
|
|
6820
|
+
const handleFilterChange = useCallback28(
|
|
6809
6821
|
(filterId, value) => {
|
|
6810
6822
|
setInternalValues((prev) => ({
|
|
6811
6823
|
...prev,
|
|
@@ -6814,11 +6826,11 @@ function FilterMenu(props) {
|
|
|
6814
6826
|
},
|
|
6815
6827
|
[setInternalValues]
|
|
6816
6828
|
);
|
|
6817
|
-
const handleApply =
|
|
6829
|
+
const handleApply = useCallback28(() => {
|
|
6818
6830
|
onChange?.(internalValues);
|
|
6819
6831
|
onClose?.();
|
|
6820
6832
|
}, [onChange, onClose, internalValues]);
|
|
6821
|
-
const handleClear =
|
|
6833
|
+
const handleClear = useCallback28(() => {
|
|
6822
6834
|
const clearedValues = resetValues || {};
|
|
6823
6835
|
setInternalValues(clearedValues);
|
|
6824
6836
|
onChange?.(clearedValues);
|
|
@@ -6854,7 +6866,7 @@ function FilterMenu(props) {
|
|
|
6854
6866
|
FilterMenu.displayName = "FilterMenu";
|
|
6855
6867
|
|
|
6856
6868
|
// src/components/Uploader/Uploader.tsx
|
|
6857
|
-
import React45, { useCallback as
|
|
6869
|
+
import React45, { useCallback as useCallback29, useEffect as useEffect13, useMemo as useMemo19, useRef as useRef12, useState as useState14 } from "react";
|
|
6858
6870
|
import { styled as styled22, Input as Input2 } from "@mui/joy";
|
|
6859
6871
|
import MuiFileUploadIcon from "@mui/icons-material/CloudUploadRounded";
|
|
6860
6872
|
import MuiUploadFileIcon from "@mui/icons-material/UploadFileRounded";
|
|
@@ -6988,8 +7000,8 @@ var Uploader = React45.memo((props) => {
|
|
|
6988
7000
|
error: errorProp,
|
|
6989
7001
|
helperText: helperTextProp
|
|
6990
7002
|
} = props;
|
|
6991
|
-
const dropZoneRef =
|
|
6992
|
-
const inputRef =
|
|
7003
|
+
const dropZoneRef = useRef12(null);
|
|
7004
|
+
const inputRef = useRef12(null);
|
|
6993
7005
|
const [errorText, setErrorText] = useState14();
|
|
6994
7006
|
const [files, setFiles] = useState14([]);
|
|
6995
7007
|
const [uploaded, setUploaded] = useState14(props.uploaded || []);
|
|
@@ -7039,7 +7051,7 @@ var Uploader = React45.memo((props) => {
|
|
|
7039
7051
|
() => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
|
|
7040
7052
|
[files, maxCount, uploaded]
|
|
7041
7053
|
);
|
|
7042
|
-
const addFiles =
|
|
7054
|
+
const addFiles = useCallback29(
|
|
7043
7055
|
(uploads) => {
|
|
7044
7056
|
try {
|
|
7045
7057
|
const types = parsedAccepts.map((type) => type.replace(".", "")) || [];
|
|
@@ -7121,14 +7133,14 @@ var Uploader = React45.memo((props) => {
|
|
|
7121
7133
|
}
|
|
7122
7134
|
}
|
|
7123
7135
|
}, [inputRef, files, minCount]);
|
|
7124
|
-
const handleFileChanged =
|
|
7136
|
+
const handleFileChanged = useCallback29(
|
|
7125
7137
|
(event) => {
|
|
7126
7138
|
const files2 = Array.from(event.target.files || []);
|
|
7127
7139
|
addFiles(files2);
|
|
7128
7140
|
},
|
|
7129
7141
|
[addFiles]
|
|
7130
7142
|
);
|
|
7131
|
-
const handleDeleteFile =
|
|
7143
|
+
const handleDeleteFile = useCallback29(
|
|
7132
7144
|
(deletedFile) => {
|
|
7133
7145
|
if (deletedFile instanceof File) {
|
|
7134
7146
|
setFiles((current) => {
|
|
@@ -7148,7 +7160,7 @@ var Uploader = React45.memo((props) => {
|
|
|
7148
7160
|
},
|
|
7149
7161
|
[name, onChange, onDelete]
|
|
7150
7162
|
);
|
|
7151
|
-
const handleUploaderButtonClick =
|
|
7163
|
+
const handleUploaderButtonClick = useCallback29(() => {
|
|
7152
7164
|
inputRef.current?.click();
|
|
7153
7165
|
}, []);
|
|
7154
7166
|
const uploader = /* @__PURE__ */ React45.createElement(
|
|
@@ -7197,7 +7209,7 @@ import {
|
|
|
7197
7209
|
MenuButton as JoyMenuButton2,
|
|
7198
7210
|
IconButton as JoyIconButton2
|
|
7199
7211
|
} from "@mui/joy";
|
|
7200
|
-
var MenuButtonRootSlot = React46.forwardRef(function MenuButtonRootSlot2({ as, ...rest }, ref) {
|
|
7212
|
+
var MenuButtonRootSlot = React46.forwardRef(function MenuButtonRootSlot2({ as, ownerState: _ownerState, ...rest }, ref) {
|
|
7201
7213
|
return /* @__PURE__ */ React46.createElement(JoyIconButton2, { ...rest, component: as ?? "button", ref });
|
|
7202
7214
|
});
|
|
7203
7215
|
function IconMenuButtonInner(props, ref) {
|
|
@@ -7235,7 +7247,8 @@ function IconMenuButtonInner(props, ref) {
|
|
|
7235
7247
|
slots: { root: MenuButtonRootSlot },
|
|
7236
7248
|
slotProps: {
|
|
7237
7249
|
root: {
|
|
7238
|
-
|
|
7250
|
+
// 기본값 'button'은 MenuButtonRootSlot 한 곳에만 둔다.
|
|
7251
|
+
component: props.buttonComponent,
|
|
7239
7252
|
size,
|
|
7240
7253
|
variant,
|
|
7241
7254
|
color,
|
|
@@ -7442,7 +7455,7 @@ function MenuButton2(props) {
|
|
|
7442
7455
|
MenuButton2.displayName = "MenuButton";
|
|
7443
7456
|
|
|
7444
7457
|
// src/components/MonthPicker/MonthPicker.tsx
|
|
7445
|
-
import React49, { forwardRef as forwardRef10, useCallback as
|
|
7458
|
+
import React49, { forwardRef as forwardRef10, useCallback as useCallback30, useEffect as useEffect15, useImperativeHandle as useImperativeHandle5, useRef as useRef13, useState as useState16 } from "react";
|
|
7446
7459
|
import CalendarTodayIcon4 from "@mui/icons-material/CalendarToday";
|
|
7447
7460
|
import { styled as styled23, useThemeProps as useThemeProps11 } from "@mui/joy";
|
|
7448
7461
|
import { FocusTrap as FocusTrap4, ClickAwayListener as ClickAwayListener4, Popper as Popper5 } from "@mui/base";
|
|
@@ -7525,18 +7538,18 @@ var MonthPicker = forwardRef10((inProps, ref) => {
|
|
|
7525
7538
|
locale,
|
|
7526
7539
|
...innerProps
|
|
7527
7540
|
} = props;
|
|
7528
|
-
const innerRef =
|
|
7529
|
-
const buttonRef =
|
|
7541
|
+
const innerRef = useRef13(null);
|
|
7542
|
+
const buttonRef = useRef13(null);
|
|
7530
7543
|
const [rawValue, setValue, isControlled] = useControlledState(
|
|
7531
7544
|
props.value,
|
|
7532
7545
|
props.defaultValue ?? null,
|
|
7533
|
-
|
|
7546
|
+
useCallback30(
|
|
7534
7547
|
(value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
|
|
7535
7548
|
[props.name, onChange]
|
|
7536
7549
|
)
|
|
7537
7550
|
);
|
|
7538
7551
|
const value = rawValue ?? "";
|
|
7539
|
-
const getFormattedDisplayValue =
|
|
7552
|
+
const getFormattedDisplayValue = useCallback30(
|
|
7540
7553
|
(inputValue) => {
|
|
7541
7554
|
if (!inputValue) return "";
|
|
7542
7555
|
try {
|
|
@@ -7559,7 +7572,7 @@ var MonthPicker = forwardRef10((inProps, ref) => {
|
|
|
7559
7572
|
useEffect15(() => {
|
|
7560
7573
|
setDisplayValue(getFormattedDisplayValue(value));
|
|
7561
7574
|
}, [value, getFormattedDisplayValue]);
|
|
7562
|
-
const handleChange =
|
|
7575
|
+
const handleChange = useCallback30(
|
|
7563
7576
|
(event) => {
|
|
7564
7577
|
const newValue = event.target.value;
|
|
7565
7578
|
setValue(newValue);
|
|
@@ -7569,14 +7582,14 @@ var MonthPicker = forwardRef10((inProps, ref) => {
|
|
|
7569
7582
|
},
|
|
7570
7583
|
[setValue, getFormattedDisplayValue, isControlled]
|
|
7571
7584
|
);
|
|
7572
|
-
const handleCalendarToggle =
|
|
7585
|
+
const handleCalendarToggle = useCallback30(
|
|
7573
7586
|
(event) => {
|
|
7574
7587
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
7575
7588
|
innerRef.current?.focus();
|
|
7576
7589
|
},
|
|
7577
7590
|
[anchorEl, setAnchorEl, innerRef]
|
|
7578
7591
|
);
|
|
7579
|
-
const handleInputMouseDown =
|
|
7592
|
+
const handleInputMouseDown = useCallback30(
|
|
7580
7593
|
(event) => {
|
|
7581
7594
|
event.preventDefault();
|
|
7582
7595
|
buttonRef.current?.focus();
|
|
@@ -7824,7 +7837,7 @@ function Navigator(props) {
|
|
|
7824
7837
|
Navigator.displayName = "Navigator";
|
|
7825
7838
|
|
|
7826
7839
|
// src/components/ProfileMenu/ProfileMenu.tsx
|
|
7827
|
-
import React53, { useCallback as
|
|
7840
|
+
import React53, { useCallback as useCallback31, useMemo as useMemo20 } from "react";
|
|
7828
7841
|
import { Dropdown as Dropdown2, ListDivider, menuItemClasses, styled as styled26, MenuButton as MenuButton3, useThemeProps as useThemeProps12 } from "@mui/joy";
|
|
7829
7842
|
import { ClickAwayListener as ClickAwayListener5 } from "@mui/base";
|
|
7830
7843
|
import DropdownIcon from "@mui/icons-material/ArrowDropDown";
|
|
@@ -7877,7 +7890,7 @@ function ProfileMenu(inProps) {
|
|
|
7877
7890
|
const [open, setOpen] = useControlledState(
|
|
7878
7891
|
_open,
|
|
7879
7892
|
defaultOpen ?? false,
|
|
7880
|
-
|
|
7893
|
+
useCallback31((value) => onOpenChange?.(value), [onOpenChange])
|
|
7881
7894
|
);
|
|
7882
7895
|
return /* @__PURE__ */ React53.createElement(ClickAwayListener5, { onClickAway: () => setOpen(false) }, /* @__PURE__ */ React53.createElement("div", null, /* @__PURE__ */ React53.createElement(Dropdown2, { open }, /* @__PURE__ */ React53.createElement(
|
|
7883
7896
|
ProfileMenuButton,
|