nntc-ui 0.0.42 → 0.0.44
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-EOYCTU5A.js → chunk-CVFNR56A.js} +18 -1
- package/icons/index.d.ts +3 -1
- package/icons/index.js +3 -1
- package/index.d.ts +1 -0
- package/index.js +19 -4
- package/package.json +2 -2
|
@@ -204,6 +204,22 @@ var ExportTableIcon = (props) => /* @__PURE__ */ jsx36(Icon, { ...props, childre
|
|
|
204
204
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
205
205
|
var DownloadIcon = (props) => /* @__PURE__ */ jsx37(Icon, { ...props, children: /* @__PURE__ */ jsx37("path", { d: "M19 9h-4V3H9v6H5l7 7 7-7zm-8 2V5h2v6h1.17L12 13.17 9.83 11H11zm-6 7h14v2H5z" }) });
|
|
206
206
|
|
|
207
|
+
// src/icons/VisibilityIcon.tsx
|
|
208
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
209
|
+
var VisibilityIcon = (props) => /* @__PURE__ */ jsx38(Icon, { ...props, children: /* @__PURE__ */ jsx38(
|
|
210
|
+
"path",
|
|
211
|
+
{
|
|
212
|
+
d: `M12 6.375C15.75 6.375 18.9525 8.7075 20.25 12C18.9525 15.2925 15.75 17.625 12 17.625C8.25
|
|
213
|
+
17.625 5.0475 15.2925 3.75 12C5.0475 8.7075 8.25 6.375 12 6.375ZM12 7.875C9.15755 7.87505
|
|
214
|
+
6.62225 9.47254 5.38477 12C6.62225 14.52746 9.15755 16.12495 12 16.125C14.8425
|
|
215
|
+
16.125 17.3777 14.5275 18.6152 12C17.3777 9.4725 14.8425 7.875 12 7.875ZM12
|
|
216
|
+
8.625C13.86 8.625 15.375 10.14 15.375 12C15.375 13.86 13.86 15.375 12 15.375C10.14 15.375
|
|
217
|
+
8.625 13.86 8.625 12C8.625 10.14 10.14 8.625 12 8.625ZM12 10.125C10.965 10.125 10.125 10.965
|
|
218
|
+
10.125 12C10.125 13.035 10.965 13.875 12 13.875C13.035 13.875 13.875 13.035
|
|
219
|
+
13.875 12C13.875 10.965 13.035 10.125 12 10.125Z`
|
|
220
|
+
}
|
|
221
|
+
) });
|
|
222
|
+
|
|
207
223
|
export {
|
|
208
224
|
__export,
|
|
209
225
|
CheckboxDeselectedIcon,
|
|
@@ -241,5 +257,6 @@ export {
|
|
|
241
257
|
BookmarkIcon,
|
|
242
258
|
BookmarkAddIcon,
|
|
243
259
|
ExportTableIcon,
|
|
244
|
-
DownloadIcon
|
|
260
|
+
DownloadIcon,
|
|
261
|
+
VisibilityIcon
|
|
245
262
|
};
|
package/icons/index.d.ts
CHANGED
|
@@ -78,4 +78,6 @@ declare const ExportTableIcon: React__default.FC<IconProps>;
|
|
|
78
78
|
|
|
79
79
|
declare const DownloadIcon: React__default.FC<IconProps>;
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
declare const VisibilityIcon: React__default.FC<IconProps>;
|
|
82
|
+
|
|
83
|
+
export { AddIcon, ArrowDropDownIcon, ArrowDropUpIcon, AttachIcon, BarChartIcon, BookmarkAddIcon, BookmarkIcon, CheckboxDeselectedIcon, CheckboxIcon, CheckboxSeveralIcon, ChevronLeftIcon, ChevronRightIcon, CircleFilledIcon, CloseIcon, DateRangeIcon, DeleteIcon, DoneIcon, DownloadIcon, EditIcon, ExportTableIcon, FileUploadIcon, FilterClearIcon, FilterIcon, FullScreenOffIcon, FullScreenOnIcon, InfoIcon, KeyboardArrowDownIcon, ListIcon, MoreVerticalIcon, SearchIcon, SettingsIcon, SortDownIcon, SortUpIcon, TableChartIcon, UploadIcon, VisibilityIcon, WellIcon };
|
package/icons/index.js
CHANGED
|
@@ -34,8 +34,9 @@ import {
|
|
|
34
34
|
SortUpIcon,
|
|
35
35
|
TableChartIcon,
|
|
36
36
|
UploadIcon,
|
|
37
|
+
VisibilityIcon,
|
|
37
38
|
WellIcon
|
|
38
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-CVFNR56A.js";
|
|
39
40
|
export {
|
|
40
41
|
AddIcon,
|
|
41
42
|
ArrowDropDownIcon,
|
|
@@ -72,5 +73,6 @@ export {
|
|
|
72
73
|
SortUpIcon,
|
|
73
74
|
TableChartIcon,
|
|
74
75
|
UploadIcon,
|
|
76
|
+
VisibilityIcon,
|
|
75
77
|
WellIcon
|
|
76
78
|
};
|
package/index.d.ts
CHANGED
|
@@ -327,6 +327,7 @@ interface Props$7 {
|
|
|
327
327
|
globalSorts?: SortBy[];
|
|
328
328
|
onFiltersChange?: (filters: FilterBy[]) => void;
|
|
329
329
|
onSortsChange?: (sorts: SortBy[]) => void;
|
|
330
|
+
additionalHeaderContent?: (headerName: string) => ReactNode;
|
|
330
331
|
}
|
|
331
332
|
declare function VirtualTable(props: UiProps<Props$7>): react_jsx_runtime.JSX.Element;
|
|
332
333
|
|
package/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
SortDownIcon,
|
|
17
17
|
SortUpIcon,
|
|
18
18
|
__export
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-CVFNR56A.js";
|
|
20
20
|
|
|
21
21
|
// src/components/common/Button/Button.tsx
|
|
22
22
|
import classnames from "classnames";
|
|
@@ -2917,7 +2917,9 @@ function HeaderDropdown(props) {
|
|
|
2917
2917
|
items: items2,
|
|
2918
2918
|
containerRef,
|
|
2919
2919
|
showUniqueValuesCount,
|
|
2920
|
-
|
|
2920
|
+
additionalContent,
|
|
2921
|
+
children: children2,
|
|
2922
|
+
rows
|
|
2921
2923
|
} = props;
|
|
2922
2924
|
const headerResultName = sortAnotherName ?? headerName;
|
|
2923
2925
|
const filterItems3 = useMemo5(() => {
|
|
@@ -2935,6 +2937,10 @@ function HeaderDropdown(props) {
|
|
|
2935
2937
|
];
|
|
2936
2938
|
return uniqueChecklistItems;
|
|
2937
2939
|
}, [items2, headerResultName]);
|
|
2940
|
+
const uniqueRows = useMemo5(
|
|
2941
|
+
() => Array.from(new Set(rows.map((i) => i?.[headerResultName].payload?.id ?? i?.[headerResultName].value))),
|
|
2942
|
+
[rows, headerResultName]
|
|
2943
|
+
);
|
|
2938
2944
|
const filterSelectedItems = useMemo5(() => {
|
|
2939
2945
|
const result = {};
|
|
2940
2946
|
filterBy.find((fb) => fb.columnName === headerResultName)?.values.forEach((v) => {
|
|
@@ -3021,7 +3027,8 @@ function HeaderDropdown(props) {
|
|
|
3021
3027
|
const hasAnyFilter = Object.keys(filterSelectedItems).length || sortBy.some((sb) => sb.columnName === headerResultName);
|
|
3022
3028
|
const { t } = useTranslation();
|
|
3023
3029
|
return /* @__PURE__ */ jsxs19("div", { className: classnames21(root18), children: [
|
|
3024
|
-
|
|
3030
|
+
additionalContent?.(headerResultName),
|
|
3031
|
+
children2?.(showUniqueValuesCount && /* @__PURE__ */ jsx33("div", { children: `(${uniqueRows.length})` })),
|
|
3025
3032
|
(sortable || filtrationByValue || filtrationByDate || filtrationByNumber) && /* @__PURE__ */ jsx33(
|
|
3026
3033
|
Popover,
|
|
3027
3034
|
{
|
|
@@ -3235,7 +3242,8 @@ function VirtualTable(props) {
|
|
|
3235
3242
|
globalFilters,
|
|
3236
3243
|
globalSorts,
|
|
3237
3244
|
onFiltersChange,
|
|
3238
|
-
onSortsChange
|
|
3245
|
+
onSortsChange,
|
|
3246
|
+
additionalHeaderContent
|
|
3239
3247
|
} = props;
|
|
3240
3248
|
const [filterBy, setFilterBy] = useState16(globalFilters ?? []);
|
|
3241
3249
|
const [sortBy, setSortBy] = useState16([...globalSorts ?? [], { columnName: "isNew", direction: "desc" }]);
|
|
@@ -3255,6 +3263,11 @@ function VirtualTable(props) {
|
|
|
3255
3263
|
(fb) => fb.type === "numberRange" && fb.values.some((v) => v !== Infinity && v !== -Infinity) || fb.type === "dateRange" && fb.values.some((v) => !dayjs4(v).isSame(dayjs4(0)) && !dayjs4(v).isSame(dayjs4(Number.MAX_SAFE_INTEGER)))
|
|
3256
3264
|
) ? [] : newRows;
|
|
3257
3265
|
const sorted = sortBy.length ? recursiveSort(filtered, sortBy) : filtered;
|
|
3266
|
+
window.dispatchEvent(
|
|
3267
|
+
new CustomEvent("filteringRows", {
|
|
3268
|
+
detail: sorted
|
|
3269
|
+
})
|
|
3270
|
+
);
|
|
3258
3271
|
return sorted;
|
|
3259
3272
|
}, [rows, sortBy, filterBy]);
|
|
3260
3273
|
const columnsEstimateSize = useMemo6(
|
|
@@ -3421,9 +3434,11 @@ function VirtualTable(props) {
|
|
|
3421
3434
|
filterBy,
|
|
3422
3435
|
setFilterBy,
|
|
3423
3436
|
items: rows,
|
|
3437
|
+
rows: memoizedData,
|
|
3424
3438
|
headerName: header2.column.columnDef.id ?? header2.id,
|
|
3425
3439
|
containerRef: useTableContainerAsRootForPopup ? tableContainerRef : void 0,
|
|
3426
3440
|
showUniqueValuesCount,
|
|
3441
|
+
additionalContent: additionalHeaderContent,
|
|
3427
3442
|
children: (afterNode) => /* @__PURE__ */ jsxs20(
|
|
3428
3443
|
"div",
|
|
3429
3444
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nntc-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.44",
|
|
4
4
|
"author": "NNTC",
|
|
5
5
|
"description": "React UI-kit for NNTC",
|
|
6
6
|
"type": "module",
|
|
@@ -117,4 +117,4 @@
|
|
|
117
117
|
"vite-plugin-svgr": "^4.5.0",
|
|
118
118
|
"vite-tsconfig-paths": "^5.1.4"
|
|
119
119
|
}
|
|
120
|
-
}
|
|
120
|
+
}
|