nntc-ui 0.0.87 → 0.0.89
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/{chunk-AV32MYLN.js → chunk-OJNXOQUW.js} +1 -3
- package/icons/index.js +1 -1
- package/index.js +69 -58
- package/package.json +1 -1
|
@@ -142,9 +142,7 @@ import { jsx as jsx23 } from "react/jsx-runtime";
|
|
|
142
142
|
var AlertIcon = (props) => /* @__PURE__ */ jsx23(Icon, { ...props, children: /* @__PURE__ */ jsx23(
|
|
143
143
|
"path",
|
|
144
144
|
{
|
|
145
|
-
|
|
146
|
-
clipRule: "evenodd",
|
|
147
|
-
d: "M23 21.5L12 2.5L1 21.5H23ZM11 18.5V16.5H13V18.5H11ZM11 14.5H13V10.5H11V14.5Z"
|
|
145
|
+
d: "M23 21.5H1L12 2.5L23 21.5ZM4.47005 19.5H19.53L12 6.48959L4.47005 19.5ZM13 18.5H11V16.5H13V18.5ZM13 10.5V14.5H11V10.5H13Z"
|
|
148
146
|
}
|
|
149
147
|
) });
|
|
150
148
|
|
package/icons/index.js
CHANGED
package/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
SortDownIcon,
|
|
20
20
|
SortUpIcon,
|
|
21
21
|
__export
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-OJNXOQUW.js";
|
|
23
23
|
|
|
24
24
|
// src/components/common/Button/Button.tsx
|
|
25
25
|
import classnames from "classnames";
|
|
@@ -106,7 +106,7 @@ var Button = forwardRef(function Button2({ variant = "filled", size = "medium",
|
|
|
106
106
|
|
|
107
107
|
// src/components/common/Checkbox/Checkbox.tsx
|
|
108
108
|
import classnames3 from "classnames";
|
|
109
|
-
import { useEffect,
|
|
109
|
+
import { useEffect, useRef } from "react";
|
|
110
110
|
import { mergeRefs } from "react-merge-refs";
|
|
111
111
|
|
|
112
112
|
// src/components/view/Typography/Typography.tsx
|
|
@@ -178,6 +178,17 @@ var Typography = forwardRef2(function Typography2({ variant = "body2", component
|
|
|
178
178
|
);
|
|
179
179
|
});
|
|
180
180
|
|
|
181
|
+
// src/hooks/useCompatId.ts
|
|
182
|
+
import * as React from "react";
|
|
183
|
+
import { useMemo } from "react";
|
|
184
|
+
function useCompatId() {
|
|
185
|
+
const react = React;
|
|
186
|
+
if (typeof react.useId === "function") {
|
|
187
|
+
return react.useId();
|
|
188
|
+
}
|
|
189
|
+
return useMemo(() => `nntc-ui-${Math.random().toString(36).slice(2, 11)}`, []);
|
|
190
|
+
}
|
|
191
|
+
|
|
181
192
|
// src/components/common/Checkbox/checkbox.module.css
|
|
182
193
|
var root2 = "checkbox_root";
|
|
183
194
|
var input = "checkbox_input";
|
|
@@ -194,7 +205,7 @@ import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
|
194
205
|
function Checkbox(props) {
|
|
195
206
|
const { label: label10, several: several2, componentSize = "medium", classes, id, ref, ...inputProps } = props;
|
|
196
207
|
const inputRef = useRef(null);
|
|
197
|
-
const generatedId =
|
|
208
|
+
const generatedId = useCompatId();
|
|
198
209
|
const inputId = id ?? generatedId;
|
|
199
210
|
useEffect(() => {
|
|
200
211
|
const el = inputRef.current;
|
|
@@ -262,7 +273,7 @@ var popover_default = {
|
|
|
262
273
|
};
|
|
263
274
|
|
|
264
275
|
// src/components/view/Popover/ui/PopoverContent/PopoverContent.tsx
|
|
265
|
-
import { FloatingFocusManager, FloatingPortal, useId
|
|
276
|
+
import { FloatingFocusManager, FloatingPortal, useId, useMergeRefs } from "@floating-ui/react";
|
|
266
277
|
import { forwardRef as forwardRef3, useContext, useLayoutEffect } from "react";
|
|
267
278
|
|
|
268
279
|
// src/components/view/Popover/ui/PopoverProvider/constants/PopoverContext.ts
|
|
@@ -278,7 +289,7 @@ var PopoverContent = forwardRef3(function PopoverContent2({ styles, style, child
|
|
|
278
289
|
}
|
|
279
290
|
const { context: floatingContext, ...otherContext } = context;
|
|
280
291
|
const ref = useMergeRefs([otherContext.refs.setFloating, propRef]);
|
|
281
|
-
const id =
|
|
292
|
+
const id = useId();
|
|
282
293
|
useLayoutEffect(() => {
|
|
283
294
|
context.setDescriptionId(id);
|
|
284
295
|
return () => context.setDescriptionId(void 0);
|
|
@@ -310,7 +321,7 @@ import {
|
|
|
310
321
|
useInteractions,
|
|
311
322
|
useRole
|
|
312
323
|
} from "@floating-ui/react";
|
|
313
|
-
import { useMemo, useState } from "react";
|
|
324
|
+
import { useMemo as useMemo2, useState } from "react";
|
|
314
325
|
function usePopover(props = {}) {
|
|
315
326
|
const {
|
|
316
327
|
initialOpen = false,
|
|
@@ -347,7 +358,7 @@ function usePopover(props = {}) {
|
|
|
347
358
|
const dismiss = useDismiss(context);
|
|
348
359
|
const role = useRole(context);
|
|
349
360
|
const interactions = useInteractions([click, dismiss, role]);
|
|
350
|
-
return
|
|
361
|
+
return useMemo2(
|
|
351
362
|
() => ({
|
|
352
363
|
open,
|
|
353
364
|
setOpen,
|
|
@@ -825,7 +836,7 @@ function Select(props) {
|
|
|
825
836
|
// src/components/common/DateTime/DateTime.tsx
|
|
826
837
|
import classnames7 from "classnames";
|
|
827
838
|
import defaultDayjs2 from "dayjs";
|
|
828
|
-
import { forwardRef as forwardRef5, useCallback as useCallback5, useEffect as useEffect5,
|
|
839
|
+
import { forwardRef as forwardRef5, useCallback as useCallback5, useEffect as useEffect5, useRef as useRef4, useState as useState5 } from "react";
|
|
829
840
|
import { mergeRefs as mergeRefs3 } from "react-merge-refs";
|
|
830
841
|
|
|
831
842
|
// src/components/common/DateTime/dateTime.module.css
|
|
@@ -875,7 +886,7 @@ var dateTime_default = {
|
|
|
875
886
|
// src/components/common/DateTime/ui/CalendarPopover/CalendarPopover.tsx
|
|
876
887
|
import classNames3 from "classnames";
|
|
877
888
|
import defaultDayjs from "dayjs";
|
|
878
|
-
import { useCallback as useCallback4, useEffect as useEffect4, useMemo as
|
|
889
|
+
import { useCallback as useCallback4, useEffect as useEffect4, useMemo as useMemo4, useState as useState4 } from "react";
|
|
879
890
|
|
|
880
891
|
// src/components/common/DateTime/ui/CalendarPopover/calendarPopover.module.css
|
|
881
892
|
var calendarPopover_exports = {};
|
|
@@ -968,7 +979,7 @@ var calendarPopover_default = {
|
|
|
968
979
|
|
|
969
980
|
// src/components/common/DateTime/ui/TimeWheelColumn/TimeWheelColumn.tsx
|
|
970
981
|
import classNames2 from "classnames";
|
|
971
|
-
import { useCallback as useCallback3, useEffect as useEffect3, useMemo as
|
|
982
|
+
import { useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo3, useRef as useRef3 } from "react";
|
|
972
983
|
|
|
973
984
|
// src/components/common/DateTime/ui/TimeWheelColumn/timeWheelColumn.module.css
|
|
974
985
|
var timeWheel = "timeWheelColumn_timeWheel";
|
|
@@ -985,7 +996,7 @@ function TimeWheelColumn(props) {
|
|
|
985
996
|
const valuesLength = values.length;
|
|
986
997
|
const centerPosition = (valuesLength + selectedValue) * TIME_ITEM_HEIGHT;
|
|
987
998
|
const containerRef = useRef3(null);
|
|
988
|
-
const cycledValues =
|
|
999
|
+
const cycledValues = useMemo3(() => {
|
|
989
1000
|
const repeatedValues = [];
|
|
990
1001
|
for (let i = 0; i < TIME_CYCLE_REPEAT; i += 1) {
|
|
991
1002
|
repeatedValues.push(...values);
|
|
@@ -1083,24 +1094,24 @@ function CalendarPopover(props) {
|
|
|
1083
1094
|
const [selectedMinute, setSelectedMinute] = useState4(
|
|
1084
1095
|
isDateTimeSingle && initStartDate ? dayjs3(initStartDate).minute() : 0
|
|
1085
1096
|
);
|
|
1086
|
-
const hours =
|
|
1087
|
-
const minutes =
|
|
1088
|
-
const startDateDay =
|
|
1097
|
+
const hours = useMemo4(() => [...Array(24)].map((__, index) => index), []);
|
|
1098
|
+
const minutes = useMemo4(() => [...Array(60)].map((__, index) => index), []);
|
|
1099
|
+
const startDateDay = useMemo4(
|
|
1089
1100
|
() => startDate ? dayjs3(startDate).startOf("D").valueOf() : void 0,
|
|
1090
1101
|
[startDate, dayjs3]
|
|
1091
1102
|
);
|
|
1092
|
-
const endDateDay =
|
|
1093
|
-
const startDateMonth =
|
|
1103
|
+
const endDateDay = useMemo4(() => endDate ? dayjs3(endDate).startOf("D").valueOf() : void 0, [endDate, dayjs3]);
|
|
1104
|
+
const startDateMonth = useMemo4(
|
|
1094
1105
|
() => startDateDay ? dayjs3(startDateDay).startOf("M").valueOf() : void 0,
|
|
1095
1106
|
[startDateDay, dayjs3]
|
|
1096
1107
|
);
|
|
1097
|
-
const endDateMonth =
|
|
1108
|
+
const endDateMonth = useMemo4(
|
|
1098
1109
|
() => endDateDay ? dayjs3(endDateDay).startOf("M").valueOf() : void 0,
|
|
1099
1110
|
[endDateDay, dayjs3]
|
|
1100
1111
|
);
|
|
1101
|
-
const startYear =
|
|
1102
|
-
const endYear =
|
|
1103
|
-
const currentDate =
|
|
1112
|
+
const startYear = useMemo4(() => startDateDay ? dayjs3(startDateDay).year() : void 0, [startDateDay, dayjs3]);
|
|
1113
|
+
const endYear = useMemo4(() => endDateDay ? dayjs3(endDateDay).year() : void 0, [endDateDay, dayjs3]);
|
|
1114
|
+
const currentDate = useMemo4(
|
|
1104
1115
|
() => dayjs3(new Date(currentItem.year, currentItem.month, 1)).startOf(viewType === "month" ? "M" : "y"),
|
|
1105
1116
|
[currentItem, viewType, dayjs3]
|
|
1106
1117
|
);
|
|
@@ -1231,7 +1242,7 @@ function CalendarPopover(props) {
|
|
|
1231
1242
|
},
|
|
1232
1243
|
[applyTimeToDate, endDate, isDateTimeSingle, isPeriod, selectedHour, selectedMinute, startDate, startDateDay]
|
|
1233
1244
|
);
|
|
1234
|
-
const yearsRangeStart =
|
|
1245
|
+
const yearsRangeStart = useMemo4(() => {
|
|
1235
1246
|
const year2 = currentDate.year();
|
|
1236
1247
|
return Math.floor(year2 / 20) * 20;
|
|
1237
1248
|
}, [currentDate]);
|
|
@@ -1559,7 +1570,7 @@ var DateTime = forwardRef5(
|
|
|
1559
1570
|
}, [stateValues]);
|
|
1560
1571
|
const effectiveValueType = isPeriod && valueType === "dateTime" ? "date" : valueType;
|
|
1561
1572
|
const inputRef = useRef4(null);
|
|
1562
|
-
const reactId =
|
|
1573
|
+
const reactId = useCompatId();
|
|
1563
1574
|
const inputId = id ?? reactId;
|
|
1564
1575
|
const inputFocusHandler = useCallback5(
|
|
1565
1576
|
(event) => {
|
|
@@ -1834,7 +1845,7 @@ var ColorPicker = (props) => {
|
|
|
1834
1845
|
|
|
1835
1846
|
// src/components/common/Input/Input.tsx
|
|
1836
1847
|
import classnames8 from "classnames";
|
|
1837
|
-
import { forwardRef as forwardRef6,
|
|
1848
|
+
import { forwardRef as forwardRef6, useRef as useRef6, useState as useState7 } from "react";
|
|
1838
1849
|
import { mergeRefs as mergeRefs5 } from "react-merge-refs";
|
|
1839
1850
|
|
|
1840
1851
|
// src/components/common/Input/input.module.css
|
|
@@ -1904,7 +1915,7 @@ var Input = forwardRef6(
|
|
|
1904
1915
|
}, ref) => {
|
|
1905
1916
|
const inputRef = useRef6(null);
|
|
1906
1917
|
const [fileName2, setFileName] = useState7("");
|
|
1907
|
-
const reactId =
|
|
1918
|
+
const reactId = useCompatId();
|
|
1908
1919
|
const inputId = id ?? reactId;
|
|
1909
1920
|
const isFile = type === "file";
|
|
1910
1921
|
const handleFileChange = (e) => {
|
|
@@ -2119,7 +2130,7 @@ import classnames12 from "classnames";
|
|
|
2119
2130
|
import {
|
|
2120
2131
|
useCallback as useCallback9,
|
|
2121
2132
|
useLayoutEffect as useLayoutEffect2,
|
|
2122
|
-
useMemo as
|
|
2133
|
+
useMemo as useMemo7,
|
|
2123
2134
|
useRef as useRef8,
|
|
2124
2135
|
useState as useState9
|
|
2125
2136
|
} from "react";
|
|
@@ -2200,11 +2211,11 @@ var multiSelect_default = {
|
|
|
2200
2211
|
|
|
2201
2212
|
// src/components/common/MultiSelect/ui/SelectPopover/SelectPopover.tsx
|
|
2202
2213
|
import classNames5 from "classnames";
|
|
2203
|
-
import { useCallback as useCallback8, useMemo as
|
|
2214
|
+
import { useCallback as useCallback8, useMemo as useMemo6 } from "react";
|
|
2204
2215
|
|
|
2205
2216
|
// src/components/common/Checklist/Checklist.tsx
|
|
2206
2217
|
import classnames11 from "classnames";
|
|
2207
|
-
import { useCallback as useCallback7, useMemo as
|
|
2218
|
+
import { useCallback as useCallback7, useMemo as useMemo5, useState as useState8 } from "react";
|
|
2208
2219
|
|
|
2209
2220
|
// src/components/common/Checklist/checklist.module.css
|
|
2210
2221
|
var root13 = "checklist_root";
|
|
@@ -2231,10 +2242,10 @@ function Checklist(props) {
|
|
|
2231
2242
|
const { items: items2, selected: selected6, disableSearch, isDisabled, actionWithSelected, onChangeItem, classes } = props;
|
|
2232
2243
|
const { t } = useTranslation();
|
|
2233
2244
|
const [filterSubstring, setFilterSubstring] = useState8("");
|
|
2234
|
-
const filteredItems =
|
|
2245
|
+
const filteredItems = useMemo5(() => {
|
|
2235
2246
|
return filterItems(items2, filterSubstring, selected6);
|
|
2236
2247
|
}, [items2, filterSubstring, selected6]);
|
|
2237
|
-
const selectedItemsList =
|
|
2248
|
+
const selectedItemsList = useMemo5(() => {
|
|
2238
2249
|
return items2.filter((item3) => !!selected6[item3.value]);
|
|
2239
2250
|
}, [items2, selected6]);
|
|
2240
2251
|
const handleClick = useCallback7(
|
|
@@ -2342,14 +2353,14 @@ function Checklist(props) {
|
|
|
2342
2353
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2343
2354
|
function SelectPopover2(props) {
|
|
2344
2355
|
const { items: items2, selected: selected6, onSelectedChange, classes, enableSearch = false, disabled: disabled2 } = props;
|
|
2345
|
-
const checklistItems =
|
|
2356
|
+
const checklistItems = useMemo6(
|
|
2346
2357
|
() => items2.map((item3) => ({
|
|
2347
2358
|
name: item3.name,
|
|
2348
2359
|
value: item3.value
|
|
2349
2360
|
})),
|
|
2350
2361
|
[items2]
|
|
2351
2362
|
);
|
|
2352
|
-
const selectedItems =
|
|
2363
|
+
const selectedItems = useMemo6(() => {
|
|
2353
2364
|
const result = {};
|
|
2354
2365
|
selected6?.forEach((value) => {
|
|
2355
2366
|
result[value] = true;
|
|
@@ -2446,7 +2457,7 @@ function MultiSelect(props) {
|
|
|
2446
2457
|
resizeObserver.disconnect();
|
|
2447
2458
|
};
|
|
2448
2459
|
}, []);
|
|
2449
|
-
const activeItems =
|
|
2460
|
+
const activeItems = useMemo7(() => items2.filter((i) => selected6?.includes(i.value)), [selected6, items2]);
|
|
2450
2461
|
const inputClickHandler = useCallback9(
|
|
2451
2462
|
(e) => {
|
|
2452
2463
|
e.preventDefault();
|
|
@@ -2462,7 +2473,7 @@ function MultiSelect(props) {
|
|
|
2462
2473
|
},
|
|
2463
2474
|
[onValueChange]
|
|
2464
2475
|
);
|
|
2465
|
-
const title2 =
|
|
2476
|
+
const title2 = useMemo7(() => {
|
|
2466
2477
|
if (!activeItems.length)
|
|
2467
2478
|
return "";
|
|
2468
2479
|
return getTitle(titleType, activeItems, t);
|
|
@@ -2569,7 +2580,7 @@ function MultiSelect(props) {
|
|
|
2569
2580
|
|
|
2570
2581
|
// src/components/common/RadioButton/RadioButton.tsx
|
|
2571
2582
|
import classnames13 from "classnames";
|
|
2572
|
-
import { useCallback as useCallback10, useEffect as useEffect6,
|
|
2583
|
+
import { useCallback as useCallback10, useEffect as useEffect6, useRef as useRef9 } from "react";
|
|
2573
2584
|
import { mergeRefs as mergeRefs8 } from "react-merge-refs";
|
|
2574
2585
|
|
|
2575
2586
|
// src/components/common/RadioButton/radioButton.module.css
|
|
@@ -2588,7 +2599,7 @@ function RadioButton(props) {
|
|
|
2588
2599
|
const { label: label10, componentSize = "medium", canUncheck, onUncheck, classes, id, ref, onClick, ...inputProps } = props;
|
|
2589
2600
|
const inputRef = useRef9(null);
|
|
2590
2601
|
const wasCheckedRef = useRef9(false);
|
|
2591
|
-
const generatedId =
|
|
2602
|
+
const generatedId = useCompatId();
|
|
2592
2603
|
const inputId = id ?? generatedId;
|
|
2593
2604
|
useEffect6(() => {
|
|
2594
2605
|
const el = inputRef.current;
|
|
@@ -2826,7 +2837,7 @@ import {
|
|
|
2826
2837
|
useInteractions as useInteractions2,
|
|
2827
2838
|
useRole as useRole2
|
|
2828
2839
|
} from "@floating-ui/react";
|
|
2829
|
-
import { useMemo as
|
|
2840
|
+
import { useMemo as useMemo8, useState as useState10 } from "react";
|
|
2830
2841
|
function useTooltip(props = {}) {
|
|
2831
2842
|
const {
|
|
2832
2843
|
initialOpen = false,
|
|
@@ -2867,7 +2878,7 @@ function useTooltip(props = {}) {
|
|
|
2867
2878
|
const dismiss = useDismiss2(context);
|
|
2868
2879
|
const role = useRole2(context, { role: "tooltip" });
|
|
2869
2880
|
const interactions = useInteractions2([hover, focus, dismiss, role]);
|
|
2870
|
-
return
|
|
2881
|
+
return useMemo8(
|
|
2871
2882
|
() => ({
|
|
2872
2883
|
open,
|
|
2873
2884
|
setOpen,
|
|
@@ -3163,7 +3174,7 @@ import {
|
|
|
3163
3174
|
useCallback as useCallback13,
|
|
3164
3175
|
useEffect as useEffect10,
|
|
3165
3176
|
useImperativeHandle,
|
|
3166
|
-
useMemo as
|
|
3177
|
+
useMemo as useMemo10,
|
|
3167
3178
|
useRef as useRef13,
|
|
3168
3179
|
useState as useState16
|
|
3169
3180
|
} from "react";
|
|
@@ -3450,7 +3461,7 @@ var DefaultColumn = {
|
|
|
3450
3461
|
|
|
3451
3462
|
// src/components/view/VirtualTable/ui/HeaderDropdown/HeaderDropdown.tsx
|
|
3452
3463
|
import classnames22 from "classnames";
|
|
3453
|
-
import { useMemo as
|
|
3464
|
+
import { useMemo as useMemo9 } from "react";
|
|
3454
3465
|
|
|
3455
3466
|
// src/components/view/VirtualTable/ui/HeaderDropdown/headerDropdown.module.css
|
|
3456
3467
|
var root19 = "headerDropdown_root";
|
|
@@ -3701,7 +3712,7 @@ function HeaderDropdown(props) {
|
|
|
3701
3712
|
rows
|
|
3702
3713
|
} = props;
|
|
3703
3714
|
const headerResultName = sortAnotherName ?? headerName;
|
|
3704
|
-
const filterItems2 =
|
|
3715
|
+
const filterItems2 = useMemo9(() => {
|
|
3705
3716
|
const checklistItems = rows.map(
|
|
3706
3717
|
(i) => ({
|
|
3707
3718
|
name: i[headerResultName] ? valueFormat ? valueFormat(i[headerResultName].value) : toFixed !== void 0 && !Number.isNaN(parseFloat(i[headerResultName].value)) ? parseFloat(Number(i[headerResultName].value).toFixed(toFixed)).toString() : i[headerResultName].value?.toString() || "< \u043D\u0435\u0442 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F >" : "< \u043D\u0435\u0442 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F >",
|
|
@@ -3725,7 +3736,7 @@ function HeaderDropdown(props) {
|
|
|
3725
3736
|
];
|
|
3726
3737
|
return uniqueChecklistItems;
|
|
3727
3738
|
}, [rows, headerResultName, valueFormat, toFixed]);
|
|
3728
|
-
const uniqueRows =
|
|
3739
|
+
const uniqueRows = useMemo9(
|
|
3729
3740
|
() => Array.from(
|
|
3730
3741
|
new Set(
|
|
3731
3742
|
rows.filter((row) => !!row?.[headerResultName]).map((row) => row[headerResultName].payload?.id ?? row[headerResultName].value)
|
|
@@ -3733,17 +3744,17 @@ function HeaderDropdown(props) {
|
|
|
3733
3744
|
),
|
|
3734
3745
|
[rows, headerResultName]
|
|
3735
3746
|
);
|
|
3736
|
-
const filterSelectedItems =
|
|
3747
|
+
const filterSelectedItems = useMemo9(() => {
|
|
3737
3748
|
const result = {};
|
|
3738
3749
|
filterBy.find((fb) => fb.columnName === headerResultName)?.values.forEach((v) => {
|
|
3739
3750
|
result[v] = true;
|
|
3740
3751
|
});
|
|
3741
3752
|
return result;
|
|
3742
3753
|
}, [filterBy, headerResultName]);
|
|
3743
|
-
const filterNumbers =
|
|
3754
|
+
const filterNumbers = useMemo9(() => {
|
|
3744
3755
|
return filterBy.find((fb) => fb.columnName === headerResultName && fb.type === "numberRange")?.values;
|
|
3745
3756
|
}, [filterBy, headerResultName]);
|
|
3746
|
-
const filterDates =
|
|
3757
|
+
const filterDates = useMemo9(() => {
|
|
3747
3758
|
return filterBy.find((fb) => fb.columnName === headerResultName && fb.type === "dateRange")?.values;
|
|
3748
3759
|
}, [filterBy, headerResultName]);
|
|
3749
3760
|
const handleSortClick = (direction) => () => {
|
|
@@ -4023,8 +4034,8 @@ var VirtualTable = forwardRef10((props, ref) => {
|
|
|
4023
4034
|
const [filterBy, setFilterBy] = useState16(globalFilters ?? []);
|
|
4024
4035
|
const [sortBy, setSortBy] = useState16([...globalSorts ?? [], { columnName: "isNew", direction: "desc" }]);
|
|
4025
4036
|
const tableContainerRef = useRef13(null);
|
|
4026
|
-
const rowNumberColumnId =
|
|
4027
|
-
const memoizedColumns =
|
|
4037
|
+
const rowNumberColumnId = useMemo10(() => showRowsNumbers ? `rowNumber_${uuidv44()}` : null, [showRowsNumbers]);
|
|
4038
|
+
const memoizedColumns = useMemo10(() => {
|
|
4028
4039
|
if (!rowNumberColumnId) {
|
|
4029
4040
|
return getColumns(columns);
|
|
4030
4041
|
}
|
|
@@ -4038,7 +4049,7 @@ var VirtualTable = forwardRef10((props, ref) => {
|
|
|
4038
4049
|
const result = getColumns(nextColumns);
|
|
4039
4050
|
return result;
|
|
4040
4051
|
}, [columns, rowNumberColumnId]);
|
|
4041
|
-
const memoizedData =
|
|
4052
|
+
const memoizedData = useMemo10(() => {
|
|
4042
4053
|
const newRows = [...rows];
|
|
4043
4054
|
const nextFilterBy = filterBy.filter((filterByItem) => {
|
|
4044
4055
|
const startDate = filterByItem.type === "dateRange" ? dayjs2(filterByItem.values[0]) : null;
|
|
@@ -4065,11 +4076,11 @@ var VirtualTable = forwardRef10((props, ref) => {
|
|
|
4065
4076
|
);
|
|
4066
4077
|
return result;
|
|
4067
4078
|
}, [rows, sortBy, filterBy, rowNumberColumnId]);
|
|
4068
|
-
const partialFiltered =
|
|
4079
|
+
const partialFiltered = useMemo10(() => {
|
|
4069
4080
|
const newRows = [...rows];
|
|
4070
4081
|
return Array.from({ length: filterBy.length + 1 }, (_, i) => recursiveFilter(newRows, filterBy.slice(0, i)));
|
|
4071
4082
|
}, [rows, filterBy]);
|
|
4072
|
-
const columnsEstimateSize =
|
|
4083
|
+
const columnsEstimateSize = useMemo10(
|
|
4073
4084
|
() => cellWidth ?? ((index) => rowNumberColumnId && index === 0 ? memoizedData.length.toString().length * 8 + 24 : memoizedColumns[index]?.meta?.width ?? 200),
|
|
4074
4085
|
[cellWidth, memoizedColumns, memoizedData, rowNumberColumnId]
|
|
4075
4086
|
);
|
|
@@ -4113,11 +4124,11 @@ var VirtualTable = forwardRef10((props, ref) => {
|
|
|
4113
4124
|
estimateSize: columnsEstimateSize,
|
|
4114
4125
|
overscan: 5
|
|
4115
4126
|
});
|
|
4116
|
-
const fixedColumnsWidth =
|
|
4127
|
+
const fixedColumnsWidth = useMemo10(
|
|
4117
4128
|
() => [...Array(fixedWithNumbersCount)].reduce((sum, _, index) => sum + columnsEstimateSize(index), 0),
|
|
4118
4129
|
[fixedWithNumbersCount, columnsEstimateSize]
|
|
4119
4130
|
);
|
|
4120
|
-
const headerGroupHeight =
|
|
4131
|
+
const headerGroupHeight = useMemo10(() => {
|
|
4121
4132
|
const delta = headerGroups.length - headerRowHeight.length;
|
|
4122
4133
|
const result = [...headerRowHeight];
|
|
4123
4134
|
if (delta > 0) {
|
|
@@ -4127,7 +4138,7 @@ var VirtualTable = forwardRef10((props, ref) => {
|
|
|
4127
4138
|
}
|
|
4128
4139
|
return result;
|
|
4129
4140
|
}, [headerRowHeight, headerGroups]);
|
|
4130
|
-
const summaryHeaderHeight =
|
|
4141
|
+
const summaryHeaderHeight = useMemo10(
|
|
4131
4142
|
() => headerGroupHeight.reduce(
|
|
4132
4143
|
(sum, current, currentIndex) => currentIndex < headerGroups.length ? sum + current : sum,
|
|
4133
4144
|
0
|
|
@@ -4194,7 +4205,7 @@ var VirtualTable = forwardRef10((props, ref) => {
|
|
|
4194
4205
|
const virtualRows = rowVirtualizer.getVirtualItems();
|
|
4195
4206
|
const virtualColumns = columnVirtualizer.getVirtualItems();
|
|
4196
4207
|
const lastVirtualColumnIndex = virtualColumns[virtualColumns.length - 1]?.index;
|
|
4197
|
-
const virtualRowsSizeByIndex =
|
|
4208
|
+
const virtualRowsSizeByIndex = useMemo10(
|
|
4198
4209
|
() => new Map(virtualRows.map((item3) => [item3.index, item3.size])),
|
|
4199
4210
|
[virtualRows]
|
|
4200
4211
|
);
|
|
@@ -4235,7 +4246,7 @@ var VirtualTable = forwardRef10((props, ref) => {
|
|
|
4235
4246
|
}
|
|
4236
4247
|
return rowIndex % 2 !== 0 ? "var(--theme-table-even-row)" : "var(--theme-table-background)";
|
|
4237
4248
|
}, []);
|
|
4238
|
-
const rowZIndexByIndex =
|
|
4249
|
+
const rowZIndexByIndex = useMemo10(() => {
|
|
4239
4250
|
const rowsCount = rowsFromTable.length;
|
|
4240
4251
|
const result = /* @__PURE__ */ new Map();
|
|
4241
4252
|
rowsFromTable.forEach((row, rowIndex) => {
|
|
@@ -4249,7 +4260,7 @@ var VirtualTable = forwardRef10((props, ref) => {
|
|
|
4249
4260
|
});
|
|
4250
4261
|
return result;
|
|
4251
4262
|
}, [rowsFromTable]);
|
|
4252
|
-
const headerBaseZIndex =
|
|
4263
|
+
const headerBaseZIndex = useMemo10(
|
|
4253
4264
|
() => rowsFromTable.length * rowsFromTable.length + rowsFromTable.length + 10,
|
|
4254
4265
|
[rowsFromTable.length]
|
|
4255
4266
|
);
|
|
@@ -4555,7 +4566,7 @@ var VirtualTable = forwardRef10((props, ref) => {
|
|
|
4555
4566
|
});
|
|
4556
4567
|
|
|
4557
4568
|
// src/components/view/TreeView/TreeView.tsx
|
|
4558
|
-
import { memo as memo2, useCallback as useCallback14, useMemo as
|
|
4569
|
+
import { memo as memo2, useCallback as useCallback14, useMemo as useMemo11, useState as useState18 } from "react";
|
|
4559
4570
|
|
|
4560
4571
|
// src/components/view/TreeView/treeView.module.css
|
|
4561
4572
|
var search = "treeView_search";
|
|
@@ -4649,7 +4660,7 @@ import { Fragment as Fragment11, jsx as jsx38, jsxs as jsxs23 } from "react/jsx-
|
|
|
4649
4660
|
var TreeView_default = memo2(function TreeView({ data, selected: selected6, startIcons, onSelect, withSearch = false }) {
|
|
4650
4661
|
const [searchValue, setSearchValue] = useState18("");
|
|
4651
4662
|
const onChangeSearchValue = useCallback14((e) => setSearchValue(e.target.value), []);
|
|
4652
|
-
const selectedValues =
|
|
4663
|
+
const selectedValues = useMemo11(
|
|
4653
4664
|
() => selected6.reduce(
|
|
4654
4665
|
(acc, cur) => {
|
|
4655
4666
|
acc[cur] = true;
|
|
@@ -4659,7 +4670,7 @@ var TreeView_default = memo2(function TreeView({ data, selected: selected6, star
|
|
|
4659
4670
|
),
|
|
4660
4671
|
[selected6]
|
|
4661
4672
|
);
|
|
4662
|
-
const filteredData =
|
|
4673
|
+
const filteredData = useMemo11(() => {
|
|
4663
4674
|
return getFilteredTree(data, searchValue);
|
|
4664
4675
|
}, [data, searchValue]);
|
|
4665
4676
|
return /* @__PURE__ */ jsxs23(Fragment11, { children: [
|