nntc-ui 0.0.95 → 0.0.96
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/index.js +24 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -3725,7 +3725,8 @@ function HeaderDropdown(props) {
|
|
|
3725
3725
|
leftAdditionalContent,
|
|
3726
3726
|
rightAdditionalContent,
|
|
3727
3727
|
children: children2,
|
|
3728
|
-
rows
|
|
3728
|
+
rows,
|
|
3729
|
+
rowsForUniqueCount
|
|
3729
3730
|
} = props;
|
|
3730
3731
|
const headerResultName = sortAnotherName ?? headerName;
|
|
3731
3732
|
const filterItems2 = useMemo9(() => {
|
|
@@ -3752,14 +3753,26 @@ function HeaderDropdown(props) {
|
|
|
3752
3753
|
];
|
|
3753
3754
|
return uniqueChecklistItems;
|
|
3754
3755
|
}, [rows, headerResultName, valueFormat, toFixed]);
|
|
3755
|
-
const
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3756
|
+
const uniqueValuesCount = useMemo9(() => {
|
|
3757
|
+
const sourceRows = rowsForUniqueCount ?? rows;
|
|
3758
|
+
const unique = /* @__PURE__ */ new Set();
|
|
3759
|
+
sourceRows.forEach((sr) => {
|
|
3760
|
+
const cell2 = sr?.[headerResultName];
|
|
3761
|
+
unique.add(cell2 ? (cell2.value ?? "")?.toString() : "");
|
|
3762
|
+
});
|
|
3763
|
+
const valueFilter = filterBy.find((fb) => fb.columnName === headerResultName && fb.type === "value");
|
|
3764
|
+
const selected6 = (valueFilter?.values ?? []).map((v) => (v ?? "")?.toString());
|
|
3765
|
+
if (selected6.length > 0) {
|
|
3766
|
+
const selectedSet = new Set(selected6);
|
|
3767
|
+
let count = 0;
|
|
3768
|
+
unique.forEach((u) => {
|
|
3769
|
+
if (selectedSet.has(u))
|
|
3770
|
+
count += 1;
|
|
3771
|
+
});
|
|
3772
|
+
return count;
|
|
3773
|
+
}
|
|
3774
|
+
return unique.size;
|
|
3775
|
+
}, [rowsForUniqueCount, rows, headerResultName, filterBy]);
|
|
3763
3776
|
const filterSelectedItems = useMemo9(() => {
|
|
3764
3777
|
const result = {};
|
|
3765
3778
|
filterBy.find((fb) => fb.columnName === headerResultName)?.values.forEach((v) => {
|
|
@@ -3911,7 +3924,7 @@ function HeaderDropdown(props) {
|
|
|
3911
3924
|
}
|
|
3912
3925
|
return /* @__PURE__ */ jsxs20("div", { className: classnames22(root19), children: [
|
|
3913
3926
|
leftAdditionalContent?.(headerResultName),
|
|
3914
|
-
children2?.(showUniqueValuesCount && /* @__PURE__ */ jsx35("div", { children: `(${
|
|
3927
|
+
children2?.(showUniqueValuesCount && /* @__PURE__ */ jsx35("div", { children: `(${uniqueValuesCount})` })),
|
|
3915
3928
|
rightAdditionalContent?.(headerResultName),
|
|
3916
3929
|
(sortable || selectUnique || filtrationByValue || filtrationByDate || filtrationByNumber) && /* @__PURE__ */ jsx35(
|
|
3917
3930
|
Popover,
|
|
@@ -4405,6 +4418,7 @@ var VirtualTable = forwardRef10((props, ref) => {
|
|
|
4405
4418
|
filterBy,
|
|
4406
4419
|
setFilterBy,
|
|
4407
4420
|
rows: rowsForChecklist,
|
|
4421
|
+
rowsForUniqueCount: memoizedData,
|
|
4408
4422
|
headerName: header2.column.columnDef.id ?? header2.id,
|
|
4409
4423
|
containerRef: useTableContainerAsRootForPopup ? tableContainerRef : void 0,
|
|
4410
4424
|
showUniqueValuesCount,
|