nntc-ui 0.0.80 → 0.0.82
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.css +64 -6
- package/index.d.ts +4 -3
- package/index.js +193 -107
- package/package.json +2 -2
- package/styles/themes/dark.css +4 -2
- package/styles/themes/light.css +6 -4
package/index.css
CHANGED
|
@@ -1009,6 +1009,36 @@
|
|
|
1009
1009
|
.input_outlined > .input_input:focus {
|
|
1010
1010
|
outline-color: var(--theme-focus);
|
|
1011
1011
|
}
|
|
1012
|
+
.input_fileInput {
|
|
1013
|
+
position: absolute;
|
|
1014
|
+
width: 0;
|
|
1015
|
+
height: 0;
|
|
1016
|
+
pointer-events: none;
|
|
1017
|
+
opacity: 0;
|
|
1018
|
+
}
|
|
1019
|
+
.input_fileDisplay {
|
|
1020
|
+
box-sizing: border-box;
|
|
1021
|
+
display: flex;
|
|
1022
|
+
align-items: center;
|
|
1023
|
+
cursor: pointer;
|
|
1024
|
+
-webkit-user-select: none;
|
|
1025
|
+
user-select: none;
|
|
1026
|
+
}
|
|
1027
|
+
.input_fileName {
|
|
1028
|
+
flex: 1;
|
|
1029
|
+
overflow: hidden;
|
|
1030
|
+
color: var(--theme-text-primary);
|
|
1031
|
+
text-overflow: ellipsis;
|
|
1032
|
+
white-space: nowrap;
|
|
1033
|
+
}
|
|
1034
|
+
.input_fileName.input_placeholder {
|
|
1035
|
+
color: var(--theme-text-inactive);
|
|
1036
|
+
}
|
|
1037
|
+
.input_fileDisplay > .input_attachIcon {
|
|
1038
|
+
flex-shrink: 0;
|
|
1039
|
+
margin-left: 8px;
|
|
1040
|
+
color: var(--theme-text-secondary);
|
|
1041
|
+
}
|
|
1012
1042
|
|
|
1013
1043
|
/* src/components/common/SearchInput/searchInput.module.css */
|
|
1014
1044
|
.searchInput_root {
|
|
@@ -1638,12 +1668,6 @@
|
|
|
1638
1668
|
.virtualTable_tableContainer {
|
|
1639
1669
|
height: calc(100% + 16px);
|
|
1640
1670
|
}
|
|
1641
|
-
.virtualTable_root.virtualTable_small .virtualTable_table {
|
|
1642
|
-
font-size: var(--text-body2-size);
|
|
1643
|
-
}
|
|
1644
|
-
.virtualTable_root.virtualTable_medium .virtualTable_table {
|
|
1645
|
-
font-size: var(--text-body1-size);
|
|
1646
|
-
}
|
|
1647
1671
|
.virtualTable_table {
|
|
1648
1672
|
position: relative;
|
|
1649
1673
|
color: var(--theme-text-primary);
|
|
@@ -1752,6 +1776,18 @@
|
|
|
1752
1776
|
.virtualTable_marginLeftChanging {
|
|
1753
1777
|
background-color: var(--theme-table-header);
|
|
1754
1778
|
}
|
|
1779
|
+
.virtualTable_sticky::before,
|
|
1780
|
+
.virtualTable_marginLeftChanging::before {
|
|
1781
|
+
position: absolute;
|
|
1782
|
+
top: 0;
|
|
1783
|
+
left: 0;
|
|
1784
|
+
z-index: -1;
|
|
1785
|
+
display: block;
|
|
1786
|
+
width: 100%;
|
|
1787
|
+
height: 100%;
|
|
1788
|
+
content: "";
|
|
1789
|
+
background-color: var(--theme-overlay-4);
|
|
1790
|
+
}
|
|
1755
1791
|
.virtualTable_rightBorder {
|
|
1756
1792
|
position: absolute;
|
|
1757
1793
|
top: 0;
|
|
@@ -1792,8 +1828,18 @@
|
|
|
1792
1828
|
justify-content: center;
|
|
1793
1829
|
text-align: center;
|
|
1794
1830
|
}
|
|
1831
|
+
.virtualTable_viewCell.virtualTable_success {
|
|
1832
|
+
color: var(--theme-success);
|
|
1833
|
+
background-color: var(--theme-table-success);
|
|
1834
|
+
}
|
|
1795
1835
|
.virtualTable_viewCell.virtualTable_error {
|
|
1836
|
+
color: var(--theme-error);
|
|
1796
1837
|
background-color: var(--theme-table-error);
|
|
1838
|
+
}
|
|
1839
|
+
.virtualTable_viewCell.virtualTable_editable.virtualTable_success {
|
|
1840
|
+
border-color: var(--theme-success);
|
|
1841
|
+
}
|
|
1842
|
+
.virtualTable_viewCell.virtualTable_editable.virtualTable_error {
|
|
1797
1843
|
border-color: var(--theme-error);
|
|
1798
1844
|
}
|
|
1799
1845
|
.virtualTable_viewSpan {
|
|
@@ -1847,6 +1893,18 @@
|
|
|
1847
1893
|
.virtualTable_rowButtonTrigger {
|
|
1848
1894
|
height: auto !important;
|
|
1849
1895
|
}
|
|
1896
|
+
.virtualTable_root.virtualTable_medium .virtualTable_table {
|
|
1897
|
+
font-size: var(--text-body2-size);
|
|
1898
|
+
line-height: var(--text-body2-height);
|
|
1899
|
+
}
|
|
1900
|
+
.virtualTable_root.virtualTable_small .virtualTable_table {
|
|
1901
|
+
font-size: calc(var(--text-body2-size) - 2px);
|
|
1902
|
+
line-height: calc(var(--text-body2-height) - 2px);
|
|
1903
|
+
}
|
|
1904
|
+
.virtualTable_root.virtualTable_small .virtualTable_th {
|
|
1905
|
+
font-size: calc(var(--text-body2-size) - 4px);
|
|
1906
|
+
line-height: calc(var(--text-body2-height) - 4px);
|
|
1907
|
+
}
|
|
1850
1908
|
|
|
1851
1909
|
/* src/components/view/VirtualTable/ui/HeaderDropdown/headerDropdown.module.css */
|
|
1852
1910
|
.headerDropdown_root {
|
package/index.d.ts
CHANGED
|
@@ -264,7 +264,8 @@ interface TableCell {
|
|
|
264
264
|
payload?: {
|
|
265
265
|
[key: string]: string;
|
|
266
266
|
};
|
|
267
|
-
|
|
267
|
+
tooltip?: string;
|
|
268
|
+
fill?: 'error' | 'success';
|
|
268
269
|
}
|
|
269
270
|
|
|
270
271
|
interface TableRow {
|
|
@@ -311,7 +312,7 @@ interface TableColumn {
|
|
|
311
312
|
width?: number;
|
|
312
313
|
headerAlign?: ColumnAlign;
|
|
313
314
|
rowsAlign?: ColumnAlign;
|
|
314
|
-
valueFormat?: (value: string) => string;
|
|
315
|
+
valueFormat?: (value: string | number | undefined) => string;
|
|
315
316
|
showInModal?: boolean;
|
|
316
317
|
onClick?: (payload: {
|
|
317
318
|
[key: string]: string;
|
|
@@ -339,7 +340,7 @@ interface Props$8 {
|
|
|
339
340
|
onChangeCell?: (rowIndex: number, columnId: string, value: string | number | undefined, original?: TableRow) => void;
|
|
340
341
|
cellWidth?: (columnIndex: number) => number;
|
|
341
342
|
rowButtons?: ((original: TableRow) => AdditionalButton[]) | undefined;
|
|
342
|
-
fixedColumnsCount?:
|
|
343
|
+
fixedColumnsCount?: number;
|
|
343
344
|
headerRowHeight?: number[];
|
|
344
345
|
bodyRowHeight?: number;
|
|
345
346
|
rowActionWidth?: number;
|
package/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
AddIcon,
|
|
3
3
|
ArrowDropDownIcon,
|
|
4
4
|
ArrowDropUpIcon,
|
|
5
|
+
AttachIcon,
|
|
5
6
|
CheckboxDeselectedIcon,
|
|
6
7
|
CheckboxIcon,
|
|
7
8
|
CheckboxSeveralIcon,
|
|
@@ -722,7 +723,7 @@ function Select(props) {
|
|
|
722
723
|
icon: icon7,
|
|
723
724
|
fullWidth: fullWidth2,
|
|
724
725
|
label: label8,
|
|
725
|
-
placeholder,
|
|
726
|
+
placeholder: placeholder2,
|
|
726
727
|
items: items2,
|
|
727
728
|
defaultValue,
|
|
728
729
|
onValueChange,
|
|
@@ -797,7 +798,7 @@ function Select(props) {
|
|
|
797
798
|
ref: mergeRefs2([inputRef, ref]),
|
|
798
799
|
id: inputId,
|
|
799
800
|
className: classnames6(input2, classes?.input),
|
|
800
|
-
placeholder,
|
|
801
|
+
placeholder: placeholder2,
|
|
801
802
|
...inputProps,
|
|
802
803
|
value: selectedItem?.name ?? "",
|
|
803
804
|
onChange: () => {
|
|
@@ -1350,7 +1351,7 @@ function DateTime(props) {
|
|
|
1350
1351
|
valueType = "date",
|
|
1351
1352
|
componentSize = "medium",
|
|
1352
1353
|
fullWidth: fullWidth2,
|
|
1353
|
-
placeholder,
|
|
1354
|
+
placeholder: placeholder2,
|
|
1354
1355
|
defaultValues,
|
|
1355
1356
|
values,
|
|
1356
1357
|
onClear,
|
|
@@ -1406,7 +1407,7 @@ function DateTime(props) {
|
|
|
1406
1407
|
{
|
|
1407
1408
|
ref: mergeRefs3([inputRef, ref]),
|
|
1408
1409
|
className: classnames7(input3, classes?.input),
|
|
1409
|
-
placeholder,
|
|
1410
|
+
placeholder: placeholder2,
|
|
1410
1411
|
...inputProps,
|
|
1411
1412
|
value: stateValues?.[0] ? isPeriod && stateValues[1] ? `${dayjs3(stateValues[0]).format(valueType === "year" ? "YYYY" : "DD.MM.YYYY")} - ${dayjs3(
|
|
1412
1413
|
stateValues[1]
|
|
@@ -1502,7 +1503,7 @@ var ColorPicker = (props) => {
|
|
|
1502
1503
|
fullWidth: fullWidth2,
|
|
1503
1504
|
label: label8,
|
|
1504
1505
|
classes,
|
|
1505
|
-
placeholder,
|
|
1506
|
+
placeholder: placeholder2,
|
|
1506
1507
|
ref,
|
|
1507
1508
|
disabled: disabled2,
|
|
1508
1509
|
defaultValue,
|
|
@@ -1552,7 +1553,7 @@ var ColorPicker = (props) => {
|
|
|
1552
1553
|
ref: mergeRefs4([inputRef, ref]),
|
|
1553
1554
|
id: inputId,
|
|
1554
1555
|
className: classNames3(input4, classes?.input),
|
|
1555
|
-
placeholder,
|
|
1556
|
+
placeholder: placeholder2,
|
|
1556
1557
|
...inputProps,
|
|
1557
1558
|
value: color,
|
|
1558
1559
|
onChange: () => {
|
|
@@ -1591,18 +1592,23 @@ var ColorPicker = (props) => {
|
|
|
1591
1592
|
|
|
1592
1593
|
// src/components/common/Input/Input.tsx
|
|
1593
1594
|
import classnames8 from "classnames";
|
|
1594
|
-
import { useRef as useRef5 } from "react";
|
|
1595
|
+
import { useRef as useRef5, useState as useState7 } from "react";
|
|
1595
1596
|
import { mergeRefs as mergeRefs5 } from "react-merge-refs";
|
|
1596
1597
|
import { v4 as uuidv44 } from "uuid";
|
|
1597
1598
|
|
|
1598
1599
|
// src/components/common/Input/input.module.css
|
|
1599
1600
|
var input_exports = {};
|
|
1600
1601
|
__export(input_exports, {
|
|
1602
|
+
attachIcon: () => attachIcon,
|
|
1601
1603
|
default: () => input_default,
|
|
1604
|
+
fileDisplay: () => fileDisplay,
|
|
1605
|
+
fileInput: () => fileInput,
|
|
1606
|
+
fileName: () => fileName,
|
|
1602
1607
|
input: () => input5,
|
|
1603
1608
|
label: () => label4,
|
|
1604
1609
|
medium: () => medium6,
|
|
1605
1610
|
outlined: () => outlined5,
|
|
1611
|
+
placeholder: () => placeholder,
|
|
1606
1612
|
root: () => root9,
|
|
1607
1613
|
small: () => small6,
|
|
1608
1614
|
wrapper: () => wrapper3
|
|
@@ -1614,6 +1620,11 @@ var label4 = "input_label";
|
|
|
1614
1620
|
var wrapper3 = "input_wrapper";
|
|
1615
1621
|
var input5 = "input_input";
|
|
1616
1622
|
var outlined5 = "input_outlined";
|
|
1623
|
+
var fileInput = "input_fileInput";
|
|
1624
|
+
var fileDisplay = "input_fileDisplay";
|
|
1625
|
+
var fileName = "input_fileName";
|
|
1626
|
+
var placeholder = "input_placeholder";
|
|
1627
|
+
var attachIcon = "input_attachIcon";
|
|
1617
1628
|
var input_default = {
|
|
1618
1629
|
root: root9,
|
|
1619
1630
|
medium: medium6,
|
|
@@ -1621,11 +1632,16 @@ var input_default = {
|
|
|
1621
1632
|
label: label4,
|
|
1622
1633
|
wrapper: wrapper3,
|
|
1623
1634
|
input: input5,
|
|
1624
|
-
outlined: outlined5
|
|
1635
|
+
outlined: outlined5,
|
|
1636
|
+
fileInput,
|
|
1637
|
+
fileDisplay,
|
|
1638
|
+
fileName,
|
|
1639
|
+
placeholder,
|
|
1640
|
+
attachIcon
|
|
1625
1641
|
};
|
|
1626
1642
|
|
|
1627
1643
|
// src/components/common/Input/Input.tsx
|
|
1628
|
-
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1644
|
+
import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1629
1645
|
var Input = (props) => {
|
|
1630
1646
|
const {
|
|
1631
1647
|
variant = "outlined",
|
|
@@ -1633,13 +1649,22 @@ var Input = (props) => {
|
|
|
1633
1649
|
fullWidth: fullWidth2,
|
|
1634
1650
|
label: label8,
|
|
1635
1651
|
classes,
|
|
1636
|
-
placeholder,
|
|
1652
|
+
placeholder: placeholder2,
|
|
1637
1653
|
ref,
|
|
1638
1654
|
id,
|
|
1655
|
+
type,
|
|
1656
|
+
onChange,
|
|
1639
1657
|
...inputProps
|
|
1640
1658
|
} = props;
|
|
1641
1659
|
const inputRef = useRef5(null);
|
|
1660
|
+
const [fileName2, setFileName] = useState7("");
|
|
1642
1661
|
const inputId = id ?? uuidv44();
|
|
1662
|
+
const isFile = type === "file";
|
|
1663
|
+
const handleFileChange = (e) => {
|
|
1664
|
+
const file = e.target.files?.[0];
|
|
1665
|
+
setFileName(file?.name ?? "");
|
|
1666
|
+
onChange?.(e);
|
|
1667
|
+
};
|
|
1643
1668
|
return /* @__PURE__ */ jsxs9(
|
|
1644
1669
|
"div",
|
|
1645
1670
|
{
|
|
@@ -1658,14 +1683,39 @@ var Input = (props) => {
|
|
|
1658
1683
|
children: label8
|
|
1659
1684
|
}
|
|
1660
1685
|
),
|
|
1661
|
-
/* @__PURE__ */ jsx16("div", { className: classnames8(wrapper3, input_exports[variant], classes?.wrapper), children: /* @__PURE__ */
|
|
1686
|
+
/* @__PURE__ */ jsx16("div", { className: classnames8(wrapper3, input_exports[variant], classes?.wrapper), children: isFile ? /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
1687
|
+
/* @__PURE__ */ jsx16(
|
|
1688
|
+
"input",
|
|
1689
|
+
{
|
|
1690
|
+
ref: mergeRefs5([inputRef, ref]),
|
|
1691
|
+
id: inputId,
|
|
1692
|
+
className: fileInput,
|
|
1693
|
+
type: "file",
|
|
1694
|
+
onChange: handleFileChange,
|
|
1695
|
+
...inputProps
|
|
1696
|
+
}
|
|
1697
|
+
),
|
|
1698
|
+
/* @__PURE__ */ jsxs9(
|
|
1699
|
+
"div",
|
|
1700
|
+
{
|
|
1701
|
+
className: classnames8(input5, fileDisplay, classes?.input),
|
|
1702
|
+
onClick: () => inputRef.current?.click(),
|
|
1703
|
+
children: [
|
|
1704
|
+
/* @__PURE__ */ jsx16("span", { className: classnames8(fileName, !fileName2 && placeholder), children: fileName2 || placeholder2 }),
|
|
1705
|
+
/* @__PURE__ */ jsx16(AttachIcon, { size: 20, className: attachIcon })
|
|
1706
|
+
]
|
|
1707
|
+
}
|
|
1708
|
+
)
|
|
1709
|
+
] }) : /* @__PURE__ */ jsx16(
|
|
1662
1710
|
"input",
|
|
1663
1711
|
{
|
|
1664
1712
|
ref: mergeRefs5([inputRef, ref]),
|
|
1665
1713
|
id: inputId,
|
|
1666
1714
|
className: classnames8(input5, classes?.input),
|
|
1667
|
-
placeholder,
|
|
1715
|
+
placeholder: placeholder2,
|
|
1716
|
+
type,
|
|
1668
1717
|
autoComplete: "off",
|
|
1718
|
+
onChange,
|
|
1669
1719
|
...inputProps
|
|
1670
1720
|
}
|
|
1671
1721
|
) })
|
|
@@ -1719,7 +1769,7 @@ function SearchInput(props) {
|
|
|
1719
1769
|
componentSize = "medium",
|
|
1720
1770
|
disableIcon,
|
|
1721
1771
|
fullWidth: fullWidth2,
|
|
1722
|
-
placeholder,
|
|
1772
|
+
placeholder: placeholder2,
|
|
1723
1773
|
classes,
|
|
1724
1774
|
ref,
|
|
1725
1775
|
...inputProps
|
|
@@ -1755,7 +1805,7 @@ function SearchInput(props) {
|
|
|
1755
1805
|
{
|
|
1756
1806
|
ref: mergeRefs6([inputRef, ref]),
|
|
1757
1807
|
className: classnames9(input6, classes?.input),
|
|
1758
|
-
placeholder:
|
|
1808
|
+
placeholder: placeholder2 ?? t("\u041F\u043E\u0438\u0441\u043A..."),
|
|
1759
1809
|
...inputProps
|
|
1760
1810
|
}
|
|
1761
1811
|
)
|
|
@@ -1798,7 +1848,7 @@ import {
|
|
|
1798
1848
|
useLayoutEffect as useLayoutEffect2,
|
|
1799
1849
|
useMemo as useMemo5,
|
|
1800
1850
|
useRef as useRef7,
|
|
1801
|
-
useState as
|
|
1851
|
+
useState as useState9
|
|
1802
1852
|
} from "react";
|
|
1803
1853
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
1804
1854
|
import { mergeRefs as mergeRefs7 } from "react-merge-refs";
|
|
@@ -1881,7 +1931,7 @@ import { useCallback as useCallback7, useMemo as useMemo4 } from "react";
|
|
|
1881
1931
|
|
|
1882
1932
|
// src/components/common/Checklist/Checklist.tsx
|
|
1883
1933
|
import classnames11 from "classnames";
|
|
1884
|
-
import { useCallback as useCallback6, useMemo as useMemo3, useState as
|
|
1934
|
+
import { useCallback as useCallback6, useMemo as useMemo3, useState as useState8 } from "react";
|
|
1885
1935
|
|
|
1886
1936
|
// src/components/common/Checklist/checklist.module.css
|
|
1887
1937
|
var root13 = "checklist_root";
|
|
@@ -1903,11 +1953,11 @@ var filterItems = (items2, filterText, selectedItems) => {
|
|
|
1903
1953
|
};
|
|
1904
1954
|
|
|
1905
1955
|
// src/components/common/Checklist/Checklist.tsx
|
|
1906
|
-
import { Fragment as
|
|
1956
|
+
import { Fragment as Fragment4, jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1907
1957
|
function Checklist(props) {
|
|
1908
1958
|
const { items: items2, selected: selected5, disableSearch, isDisabled, actionWithSelected, onChangeItem, classes } = props;
|
|
1909
1959
|
const { t } = useTranslation();
|
|
1910
|
-
const [filterSubstring, setFilterSubstring] =
|
|
1960
|
+
const [filterSubstring, setFilterSubstring] = useState8("");
|
|
1911
1961
|
const filteredItems = useMemo3(() => {
|
|
1912
1962
|
return filterItems(items2, filterSubstring, selected5);
|
|
1913
1963
|
}, [items2, filterSubstring, selected5]);
|
|
@@ -1962,7 +2012,7 @@ function Checklist(props) {
|
|
|
1962
2012
|
}
|
|
1963
2013
|
),
|
|
1964
2014
|
/* @__PURE__ */ jsxs11("div", { className: classnames11(scrolled, "styledScroll", classes?.scrolled), children: [
|
|
1965
|
-
selectedItemsList.length > 0 && /* @__PURE__ */ jsxs11(
|
|
2015
|
+
selectedItemsList.length > 0 && /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
1966
2016
|
/* @__PURE__ */ jsxs11("div", { className: classnames11(actionWrap, classes?.actionWrap), children: [
|
|
1967
2017
|
/* @__PURE__ */ jsx19(Typography, { className: classnames11(classes?.typography), children: t("\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435") }),
|
|
1968
2018
|
/* @__PURE__ */ jsx19(
|
|
@@ -2086,7 +2136,7 @@ function MultiSelect(props) {
|
|
|
2086
2136
|
icon: icon7,
|
|
2087
2137
|
fullWidth: fullWidth2,
|
|
2088
2138
|
label: label8,
|
|
2089
|
-
placeholder,
|
|
2139
|
+
placeholder: placeholder2,
|
|
2090
2140
|
items: items2,
|
|
2091
2141
|
onValueChange,
|
|
2092
2142
|
selected: selected5,
|
|
@@ -2103,8 +2153,8 @@ function MultiSelect(props) {
|
|
|
2103
2153
|
const wrapperRef = useRef7(null);
|
|
2104
2154
|
const inputRef = useRef7(null);
|
|
2105
2155
|
const popoverTargetRef = useRef7(null);
|
|
2106
|
-
const [isPopoverOpen, setIsPopoverOpen] =
|
|
2107
|
-
const [popoverWidth, setPopoverWidth] =
|
|
2156
|
+
const [isPopoverOpen, setIsPopoverOpen] = useState9(false);
|
|
2157
|
+
const [popoverWidth, setPopoverWidth] = useState9();
|
|
2108
2158
|
useLayoutEffect2(() => {
|
|
2109
2159
|
const element = wrapperRef.current;
|
|
2110
2160
|
if (!element) {
|
|
@@ -2186,7 +2236,7 @@ function MultiSelect(props) {
|
|
|
2186
2236
|
ref: mergeRefs7([inputRef, ref]),
|
|
2187
2237
|
id: inputId,
|
|
2188
2238
|
className: classnames12(input7, classes?.input),
|
|
2189
|
-
placeholder,
|
|
2239
|
+
placeholder: placeholder2,
|
|
2190
2240
|
...inputProps,
|
|
2191
2241
|
value: title2,
|
|
2192
2242
|
onClick: inputClickHandler,
|
|
@@ -2290,11 +2340,11 @@ function Layout(props) {
|
|
|
2290
2340
|
|
|
2291
2341
|
// src/components/navigation/Tabs/Tabs.tsx
|
|
2292
2342
|
import classnames17 from "classnames";
|
|
2293
|
-
import { useEffect as useEffect5, useState as
|
|
2343
|
+
import { useEffect as useEffect5, useState as useState12 } from "react";
|
|
2294
2344
|
|
|
2295
2345
|
// src/components/view/Tooltip/Tooltip.tsx
|
|
2296
2346
|
import classnames16 from "classnames";
|
|
2297
|
-
import { useRef as useRef8, useState as
|
|
2347
|
+
import { useRef as useRef8, useState as useState11 } from "react";
|
|
2298
2348
|
|
|
2299
2349
|
// src/components/view/Tooltip/tooltip.module.css
|
|
2300
2350
|
var tooltip_exports = {};
|
|
@@ -2432,7 +2482,7 @@ import {
|
|
|
2432
2482
|
useInteractions as useInteractions2,
|
|
2433
2483
|
useRole as useRole2
|
|
2434
2484
|
} from "@floating-ui/react";
|
|
2435
|
-
import { useMemo as useMemo6, useState as
|
|
2485
|
+
import { useMemo as useMemo6, useState as useState10 } from "react";
|
|
2436
2486
|
function useTooltip(props = {}) {
|
|
2437
2487
|
const {
|
|
2438
2488
|
initialOpen = false,
|
|
@@ -2443,7 +2493,7 @@ function useTooltip(props = {}) {
|
|
|
2443
2493
|
arrowRef,
|
|
2444
2494
|
root: root23
|
|
2445
2495
|
} = props;
|
|
2446
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
2496
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState10(initialOpen);
|
|
2447
2497
|
const open = controlledOpen ?? uncontrolledOpen;
|
|
2448
2498
|
const setOpen = setControlledOpen ?? setUncontrolledOpen;
|
|
2449
2499
|
const data = useFloating2({
|
|
@@ -2523,7 +2573,7 @@ var TooltipTrigger = forwardRef6(
|
|
|
2523
2573
|
);
|
|
2524
2574
|
|
|
2525
2575
|
// src/components/view/Tooltip/Tooltip.tsx
|
|
2526
|
-
import { Fragment as
|
|
2576
|
+
import { Fragment as Fragment5, jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2527
2577
|
function Tooltip(props) {
|
|
2528
2578
|
const {
|
|
2529
2579
|
label: label8,
|
|
@@ -2537,10 +2587,10 @@ function Tooltip(props) {
|
|
|
2537
2587
|
children: children2,
|
|
2538
2588
|
classes
|
|
2539
2589
|
} = props;
|
|
2540
|
-
const [showTooltip, setShowTooltip] =
|
|
2590
|
+
const [showTooltip, setShowTooltip] = useState11(false);
|
|
2541
2591
|
const arrowRef = useRef8(null);
|
|
2542
2592
|
if (!label8) {
|
|
2543
|
-
return children2 ? /* @__PURE__ */ jsx27(
|
|
2593
|
+
return children2 ? /* @__PURE__ */ jsx27(Fragment5, { children: children2 }) : null;
|
|
2544
2594
|
}
|
|
2545
2595
|
if (!children2) {
|
|
2546
2596
|
return null;
|
|
@@ -2654,8 +2704,8 @@ function Tabs(props) {
|
|
|
2654
2704
|
value,
|
|
2655
2705
|
classes
|
|
2656
2706
|
} = props;
|
|
2657
|
-
const [isMounted, setIsMounted] =
|
|
2658
|
-
const [selectedTab, setSelectedTab] =
|
|
2707
|
+
const [isMounted, setIsMounted] = useState12(false);
|
|
2708
|
+
const [selectedTab, setSelectedTab] = useState12(defaultSelected);
|
|
2659
2709
|
const currentValue = useExternalState ? value : selectedTab;
|
|
2660
2710
|
const handleClick = (item3) => () => {
|
|
2661
2711
|
if (item3.isDisabled) {
|
|
@@ -2764,14 +2814,14 @@ import { defaultRangeExtractor, useVirtualizer } from "@tanstack/react-virtual";
|
|
|
2764
2814
|
import classnames22 from "classnames";
|
|
2765
2815
|
import dayjs2 from "dayjs";
|
|
2766
2816
|
import {
|
|
2767
|
-
Fragment as
|
|
2817
|
+
Fragment as Fragment9,
|
|
2768
2818
|
forwardRef as forwardRef8,
|
|
2769
2819
|
useCallback as useCallback11,
|
|
2770
2820
|
useEffect as useEffect8,
|
|
2771
2821
|
useImperativeHandle,
|
|
2772
2822
|
useMemo as useMemo8,
|
|
2773
2823
|
useRef as useRef11,
|
|
2774
|
-
useState as
|
|
2824
|
+
useState as useState16
|
|
2775
2825
|
} from "react";
|
|
2776
2826
|
import { v4 as uuidv46 } from "uuid";
|
|
2777
2827
|
|
|
@@ -2785,7 +2835,7 @@ var defaultRowHeight = 32;
|
|
|
2785
2835
|
|
|
2786
2836
|
// src/components/view/VirtualTable/ui/DefaultColumn/DefaultColumn.tsx
|
|
2787
2837
|
import classnames18 from "classnames";
|
|
2788
|
-
import { useEffect as useEffect6, useRef as useRef10, useState as
|
|
2838
|
+
import { useEffect as useEffect6, useRef as useRef10, useState as useState13 } from "react";
|
|
2789
2839
|
|
|
2790
2840
|
// src/components/view/Modal/Modal.tsx
|
|
2791
2841
|
import { forwardRef as forwardRef7, useRef as useRef9 } from "react";
|
|
@@ -2844,6 +2894,7 @@ __export(virtualTable_exports, {
|
|
|
2844
2894
|
bottomBorder: () => bottomBorder,
|
|
2845
2895
|
clickable: () => clickable,
|
|
2846
2896
|
default: () => virtualTable_default,
|
|
2897
|
+
editable: () => editable,
|
|
2847
2898
|
error: () => error2,
|
|
2848
2899
|
evenRow: () => evenRow,
|
|
2849
2900
|
firstThRow: () => firstThRow,
|
|
@@ -2858,6 +2909,7 @@ __export(virtualTable_exports, {
|
|
|
2858
2909
|
showInModal: () => showInModal,
|
|
2859
2910
|
small: () => small11,
|
|
2860
2911
|
sticky: () => sticky,
|
|
2912
|
+
success: () => success2,
|
|
2861
2913
|
table: () => table,
|
|
2862
2914
|
tableContainer: () => tableContainer,
|
|
2863
2915
|
td: () => td,
|
|
@@ -2875,9 +2927,7 @@ __export(virtualTable_exports, {
|
|
|
2875
2927
|
});
|
|
2876
2928
|
var root17 = "virtualTable_root";
|
|
2877
2929
|
var tableContainer = "virtualTable_tableContainer";
|
|
2878
|
-
var small11 = "virtualTable_small";
|
|
2879
2930
|
var table = "virtualTable_table";
|
|
2880
|
-
var medium11 = "virtualTable_medium";
|
|
2881
2931
|
var th = "virtualTable_th";
|
|
2882
2932
|
var bordersAll = "virtualTable_bordersAll";
|
|
2883
2933
|
var bordersHorizontal = "virtualTable_bordersHorizontal";
|
|
@@ -2900,7 +2950,9 @@ var marginLeftChanging = "virtualTable_marginLeftChanging";
|
|
|
2900
2950
|
var rightBorder = "virtualTable_rightBorder";
|
|
2901
2951
|
var bottomBorder = "virtualTable_bottomBorder";
|
|
2902
2952
|
var viewCell = "virtualTable_viewCell";
|
|
2953
|
+
var success2 = "virtualTable_success";
|
|
2903
2954
|
var error2 = "virtualTable_error";
|
|
2955
|
+
var editable = "virtualTable_editable";
|
|
2904
2956
|
var viewSpan = "virtualTable_viewSpan";
|
|
2905
2957
|
var showInModal = "virtualTable_showInModal";
|
|
2906
2958
|
var clickable = "virtualTable_clickable";
|
|
@@ -2909,12 +2961,12 @@ var verticalAlignFlexStart = "virtualTable_verticalAlignFlexStart";
|
|
|
2909
2961
|
var verticalAlignCenter = "virtualTable_verticalAlignCenter";
|
|
2910
2962
|
var verticalAlignFlexEnd = "virtualTable_verticalAlignFlexEnd";
|
|
2911
2963
|
var rowButtonTrigger = "virtualTable_rowButtonTrigger";
|
|
2964
|
+
var medium11 = "virtualTable_medium";
|
|
2965
|
+
var small11 = "virtualTable_small";
|
|
2912
2966
|
var virtualTable_default = {
|
|
2913
2967
|
root: root17,
|
|
2914
2968
|
tableContainer,
|
|
2915
|
-
small: small11,
|
|
2916
2969
|
table,
|
|
2917
|
-
medium: medium11,
|
|
2918
2970
|
th,
|
|
2919
2971
|
bordersAll,
|
|
2920
2972
|
bordersHorizontal,
|
|
@@ -2937,7 +2989,9 @@ var virtualTable_default = {
|
|
|
2937
2989
|
rightBorder,
|
|
2938
2990
|
bottomBorder,
|
|
2939
2991
|
viewCell,
|
|
2992
|
+
success: success2,
|
|
2940
2993
|
error: error2,
|
|
2994
|
+
editable,
|
|
2941
2995
|
viewSpan,
|
|
2942
2996
|
showInModal,
|
|
2943
2997
|
clickable,
|
|
@@ -2945,19 +2999,21 @@ var virtualTable_default = {
|
|
|
2945
2999
|
verticalAlignFlexStart,
|
|
2946
3000
|
verticalAlignCenter,
|
|
2947
3001
|
verticalAlignFlexEnd,
|
|
2948
|
-
rowButtonTrigger
|
|
3002
|
+
rowButtonTrigger,
|
|
3003
|
+
medium: medium11,
|
|
3004
|
+
small: small11
|
|
2949
3005
|
};
|
|
2950
3006
|
|
|
2951
3007
|
// src/components/view/VirtualTable/ui/DefaultColumn/DefaultColumn.tsx
|
|
2952
|
-
import { Fragment as
|
|
3008
|
+
import { Fragment as Fragment6, jsx as jsx30, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2953
3009
|
var DefaultColumn = {
|
|
2954
3010
|
cell: ({ getValue, row: { index, original }, column: { id, columnDef }, table: table2 }) => {
|
|
2955
3011
|
const initialValue = getValue();
|
|
2956
3012
|
const { meta } = columnDef;
|
|
2957
3013
|
const tableMeta = table2.options.meta;
|
|
2958
|
-
const [value, setValue] =
|
|
2959
|
-
const [isEdit, setIsEdit] =
|
|
2960
|
-
const [showModal, setShowModal] =
|
|
3014
|
+
const [value, setValue] = useState13(initialValue);
|
|
3015
|
+
const [isEdit, setIsEdit] = useState13(false);
|
|
3016
|
+
const [showModal, setShowModal] = useState13(false);
|
|
2961
3017
|
const closeModalRef = useRef10();
|
|
2962
3018
|
closeModalRef.current = () => {
|
|
2963
3019
|
setShowModal(false);
|
|
@@ -2974,39 +3030,54 @@ var DefaultColumn = {
|
|
|
2974
3030
|
const onChange = (e) => {
|
|
2975
3031
|
setValue(e.target.value);
|
|
2976
3032
|
};
|
|
2977
|
-
return /* @__PURE__ */ jsx30(
|
|
3033
|
+
return /* @__PURE__ */ jsx30(
|
|
3034
|
+
Tooltip,
|
|
3035
|
+
{
|
|
3036
|
+
label: original[id]?.tooltip ?? "",
|
|
3037
|
+
alertType: original[id]?.fill === "error" ? "error" : original[id]?.fill === "success" ? "success" : "default",
|
|
3038
|
+
children: additionalViewResult?.edit !== null && additionalViewResult?.edit !== void 0 ? additionalViewResult.edit(onChange, onBlur) : /* @__PURE__ */ jsx30(Fragment6, { children: /* @__PURE__ */ jsx30("input", { onChange, onBlur, value: value ?? "", autoFocus: true }) })
|
|
3039
|
+
}
|
|
3040
|
+
);
|
|
2978
3041
|
}
|
|
2979
|
-
const shownValue = additionalViewResult?.view !== null && additionalViewResult?.view !== void 0 ? additionalViewResult.view : meta?.valueFormat ? meta.valueFormat(initialValue
|
|
2980
|
-
return /* @__PURE__ */ jsx30(
|
|
2981
|
-
|
|
3042
|
+
const shownValue = additionalViewResult?.view !== null && additionalViewResult?.view !== void 0 ? additionalViewResult.view : meta?.valueFormat ? meta.valueFormat(initialValue) : meta?.toFixed !== void 0 && !Number.isNaN(parseFloat(initialValue)) ? parseFloat(Number(initialValue).toFixed(meta.toFixed)) : initialValue;
|
|
3043
|
+
return /* @__PURE__ */ jsx30(
|
|
3044
|
+
Tooltip,
|
|
2982
3045
|
{
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3046
|
+
label: original[id]?.tooltip ?? "",
|
|
3047
|
+
alertType: original[id]?.fill === "error" ? "error" : original[id]?.fill === "success" ? "success" : "default",
|
|
3048
|
+
children: /* @__PURE__ */ jsxs16(
|
|
3049
|
+
"div",
|
|
3050
|
+
{
|
|
3051
|
+
className: classnames18(
|
|
3052
|
+
viewCell,
|
|
3053
|
+
!!meta?.rowsAlign ? virtualTable_exports[`align${meta?.rowsAlign}`] : void 0,
|
|
3054
|
+
meta?.showInModal ? showInModal : void 0,
|
|
3055
|
+
meta?.onClick && original[id]?.payload ? clickable : void 0,
|
|
3056
|
+
!!original[id]?.fill ? virtualTable_exports[original[id].fill] : void 0,
|
|
3057
|
+
!!meta?.editable ? editable : void 0,
|
|
3058
|
+
!!meta?.verticalAlign ? virtualTable_exports[`verticalAlign${meta?.verticalAlign}`] : void 0
|
|
3059
|
+
),
|
|
3060
|
+
onClick: meta?.editable ? () => {
|
|
3061
|
+
setIsEdit(true);
|
|
3062
|
+
} : meta?.showInModal ? () => {
|
|
3063
|
+
setShowModal(true);
|
|
3064
|
+
} : meta?.onClick && original[id]?.payload ? () => meta?.onClick?.(original[id]?.payload ?? {}) : void 0,
|
|
3065
|
+
children: [
|
|
3066
|
+
/* @__PURE__ */ jsx30("span", { className: viewSpan, children: shownValue }),
|
|
3067
|
+
showModal && /* @__PURE__ */ jsx30(
|
|
3068
|
+
Modal,
|
|
3069
|
+
{
|
|
3070
|
+
root: tableMeta?.tableContainerRef?.current,
|
|
3071
|
+
open: showModal,
|
|
3072
|
+
onClose: () => closeModalRef.current?.(),
|
|
3073
|
+
children: /* @__PURE__ */ jsx30(Surface, { type: "panel", children: /* @__PURE__ */ jsx30("div", { className: modalContent, children: shownValue }) })
|
|
3074
|
+
}
|
|
3075
|
+
)
|
|
3076
|
+
]
|
|
3077
|
+
}
|
|
3078
|
+
)
|
|
3008
3079
|
}
|
|
3009
|
-
)
|
|
3080
|
+
);
|
|
3010
3081
|
}
|
|
3011
3082
|
};
|
|
3012
3083
|
|
|
@@ -3046,7 +3117,7 @@ var alphanumericCompare = (a, b) => {
|
|
|
3046
3117
|
|
|
3047
3118
|
// src/components/view/VirtualTable/ui/DateFiltration/DateFiltration.tsx
|
|
3048
3119
|
import classnames19 from "classnames";
|
|
3049
|
-
import { useCallback as useCallback9, useEffect as useEffect7, useState as
|
|
3120
|
+
import { useCallback as useCallback9, useEffect as useEffect7, useState as useState14 } from "react";
|
|
3050
3121
|
|
|
3051
3122
|
// src/components/view/VirtualTable/ui/DateFiltration/dateFiltration.module.css
|
|
3052
3123
|
var root19 = "dateFiltration_root";
|
|
@@ -3055,7 +3126,7 @@ var root19 = "dateFiltration_root";
|
|
|
3055
3126
|
import { jsx as jsx31, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3056
3127
|
function DateFiltration(props) {
|
|
3057
3128
|
const { defaultValues = [void 0, void 0], actionWithSelected } = props;
|
|
3058
|
-
const [values, setValues] =
|
|
3129
|
+
const [values, setValues] = useState14(defaultValues);
|
|
3059
3130
|
const handleChangeDates = (newValues) => {
|
|
3060
3131
|
setValues(newValues);
|
|
3061
3132
|
};
|
|
@@ -3095,7 +3166,7 @@ function DateFiltration(props) {
|
|
|
3095
3166
|
|
|
3096
3167
|
// src/components/view/VirtualTable/ui/NumberFiltration/NumberFiltration.tsx
|
|
3097
3168
|
import classnames20 from "classnames";
|
|
3098
|
-
import { useCallback as useCallback10, useState as
|
|
3169
|
+
import { useCallback as useCallback10, useState as useState15 } from "react";
|
|
3099
3170
|
|
|
3100
3171
|
// src/components/view/VirtualTable/ui/NumberFiltration/numberFiltration.module.css
|
|
3101
3172
|
var root20 = "numberFiltration_root";
|
|
@@ -3104,7 +3175,7 @@ var inputsContainer = "numberFiltration_inputsContainer";
|
|
|
3104
3175
|
var input8 = "numberFiltration_input";
|
|
3105
3176
|
|
|
3106
3177
|
// src/components/view/VirtualTable/ui/NumberFiltration/NumberFiltration.tsx
|
|
3107
|
-
import { Fragment as
|
|
3178
|
+
import { Fragment as Fragment7, jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3108
3179
|
var items = [
|
|
3109
3180
|
{ type: "item", name: "\u041E\u0442 \u2014 \u0434\u043E", value: "range" },
|
|
3110
3181
|
{ type: "item", name: "\u0411\u043E\u043B\u044C\u0448\u0435", value: "more" },
|
|
@@ -3113,10 +3184,10 @@ var items = [
|
|
|
3113
3184
|
];
|
|
3114
3185
|
function NumberFiltration(props) {
|
|
3115
3186
|
const { defaultValues = [-Infinity, Infinity], actionWithSelected } = props;
|
|
3116
|
-
const [selectedItem, setSelectedItem] =
|
|
3187
|
+
const [selectedItem, setSelectedItem] = useState15(
|
|
3117
3188
|
defaultValues[0] === -Infinity && defaultValues[1] === Infinity ? items[0] : defaultValues[0] === defaultValues[1] ? items[3] : defaultValues[0] === -Infinity ? items[2] : defaultValues[1] === Infinity ? items[1] : items[0]
|
|
3118
3189
|
);
|
|
3119
|
-
const [values, setValues] =
|
|
3190
|
+
const [values, setValues] = useState15(defaultValues);
|
|
3120
3191
|
const handleSelect = (item3) => {
|
|
3121
3192
|
if (!!item3) {
|
|
3122
3193
|
const newValues = [...values];
|
|
@@ -3162,7 +3233,7 @@ function NumberFiltration(props) {
|
|
|
3162
3233
|
tabIndex: -1
|
|
3163
3234
|
}
|
|
3164
3235
|
),
|
|
3165
|
-
/* @__PURE__ */ jsx32("div", { className: classnames20(inputsContainer), children: selectedItem.value === "range" ? /* @__PURE__ */ jsxs18(
|
|
3236
|
+
/* @__PURE__ */ jsx32("div", { className: classnames20(inputsContainer), children: selectedItem.value === "range" ? /* @__PURE__ */ jsxs18(Fragment7, { children: [
|
|
3166
3237
|
/* @__PURE__ */ jsx32(
|
|
3167
3238
|
Input,
|
|
3168
3239
|
{
|
|
@@ -3238,7 +3309,7 @@ function NumberFiltration(props) {
|
|
|
3238
3309
|
}
|
|
3239
3310
|
|
|
3240
3311
|
// src/components/view/VirtualTable/ui/HeaderDropdown/HeaderDropdown.tsx
|
|
3241
|
-
import { Fragment as
|
|
3312
|
+
import { Fragment as Fragment8, jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3242
3313
|
function HeaderDropdown(props) {
|
|
3243
3314
|
const {
|
|
3244
3315
|
headerMeta: {
|
|
@@ -3266,7 +3337,7 @@ function HeaderDropdown(props) {
|
|
|
3266
3337
|
const filterItems2 = useMemo7(() => {
|
|
3267
3338
|
const checklistItems = rows.map(
|
|
3268
3339
|
(i) => ({
|
|
3269
|
-
name: i[headerResultName] ? valueFormat ? valueFormat(i[headerResultName].value
|
|
3340
|
+
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 >",
|
|
3270
3341
|
value: i[headerResultName]?.value?.toString() || ""
|
|
3271
3342
|
})
|
|
3272
3343
|
).sort((a, b) => {
|
|
@@ -3395,7 +3466,7 @@ function HeaderDropdown(props) {
|
|
|
3395
3466
|
placement: "bottom-end",
|
|
3396
3467
|
wrapTrigger: true,
|
|
3397
3468
|
root: containerRef,
|
|
3398
|
-
description: /* @__PURE__ */ jsxs19(
|
|
3469
|
+
description: /* @__PURE__ */ jsxs19(Fragment8, { children: [
|
|
3399
3470
|
filtrationByNumber && /* @__PURE__ */ jsx33(NumberFiltration, { defaultValues: filterNumbers, actionWithSelected: actionWithSelectedNumbers }),
|
|
3400
3471
|
filtrationByDate && /* @__PURE__ */ jsx33(DateFiltration, { defaultValues: filterDates, actionWithSelected: actionWithSelectedDates }),
|
|
3401
3472
|
filtrationByValue && /* @__PURE__ */ jsx33("div", { className: classnames21(checklistWrap), children: /* @__PURE__ */ jsx33(
|
|
@@ -3552,7 +3623,7 @@ var recursiveSort = (items2, sortBy) => {
|
|
|
3552
3623
|
};
|
|
3553
3624
|
|
|
3554
3625
|
// src/components/view/VirtualTable/VirtualTable.tsx
|
|
3555
|
-
import { Fragment as
|
|
3626
|
+
import { Fragment as Fragment10, jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3556
3627
|
var VirtualTable = forwardRef8((props, ref) => {
|
|
3557
3628
|
const {
|
|
3558
3629
|
rows,
|
|
@@ -3581,8 +3652,8 @@ var VirtualTable = forwardRef8((props, ref) => {
|
|
|
3581
3652
|
showRowsNumbers
|
|
3582
3653
|
} = props;
|
|
3583
3654
|
const fixedWithNumbersCount = fixedColumnsCount + (showRowsNumbers ? 1 : 0);
|
|
3584
|
-
const [filterBy, setFilterBy] =
|
|
3585
|
-
const [sortBy, setSortBy] =
|
|
3655
|
+
const [filterBy, setFilterBy] = useState16(globalFilters ?? []);
|
|
3656
|
+
const [sortBy, setSortBy] = useState16([...globalSorts ?? [], { columnName: "isNew", direction: "desc" }]);
|
|
3586
3657
|
const tableContainerRef = useRef11(null);
|
|
3587
3658
|
const rowNumberColumnId = useMemo8(() => showRowsNumbers ? `rowNumber_${uuidv46()}` : null, [showRowsNumbers]);
|
|
3588
3659
|
const memoizedColumns = useMemo8(() => {
|
|
@@ -3755,6 +3826,19 @@ var VirtualTable = forwardRef8((props, ref) => {
|
|
|
3755
3826
|
const virtualRows = rowVirtualizer.getVirtualItems();
|
|
3756
3827
|
const virtualColumns = columnVirtualizer.getVirtualItems();
|
|
3757
3828
|
const lastVirtualColumnIndex = virtualColumns[virtualColumns.length - 1]?.index;
|
|
3829
|
+
const renderHeaderNode = (header2) => {
|
|
3830
|
+
const metaLabel = header2.column.columnDef.meta?.label;
|
|
3831
|
+
if (typeof metaLabel === "string") {
|
|
3832
|
+
const headerLines = metaLabel.split(/\r\n|\\r\\n|\n|\\n/);
|
|
3833
|
+
if (headerLines.length > 1) {
|
|
3834
|
+
return /* @__PURE__ */ jsx34(Fragment10, { children: headerLines.map((line, index) => /* @__PURE__ */ jsxs20(Fragment9, { children: [
|
|
3835
|
+
line,
|
|
3836
|
+
index < headerLines.length - 1 && /* @__PURE__ */ jsx34("br", {})
|
|
3837
|
+
] }, `${header2.id}_${index}`)) });
|
|
3838
|
+
}
|
|
3839
|
+
}
|
|
3840
|
+
return flexRender(header2.column.columnDef.header, header2.getContext());
|
|
3841
|
+
};
|
|
3758
3842
|
const [before, after] = virtualColumns.length > 0 ? [
|
|
3759
3843
|
fixedWithNumbersCount && virtualColumns[fixedWithNumbersCount].index !== fixedWithNumbersCount ? virtualColumns[fixedWithNumbersCount].start - fixedColumnsWidth : virtualColumns[0].start,
|
|
3760
3844
|
columnsTotalSize - virtualColumns[virtualColumns.length - 1].end
|
|
@@ -3791,7 +3875,6 @@ var VirtualTable = forwardRef8((props, ref) => {
|
|
|
3791
3875
|
position: "sticky",
|
|
3792
3876
|
top: 0,
|
|
3793
3877
|
zIndex: 2
|
|
3794
|
-
// marginLeft: 1,
|
|
3795
3878
|
},
|
|
3796
3879
|
children: headerGroups.map((headerGroup, hgi) => {
|
|
3797
3880
|
const innerCell = (header2) => {
|
|
@@ -3820,7 +3903,7 @@ var VirtualTable = forwardRef8((props, ref) => {
|
|
|
3820
3903
|
!!headerMeta?.headerAlign ? virtualTable_exports[`align${headerMeta?.headerAlign}`] : alignLeft
|
|
3821
3904
|
),
|
|
3822
3905
|
children: [
|
|
3823
|
-
|
|
3906
|
+
renderHeaderNode(header2),
|
|
3824
3907
|
afterNode
|
|
3825
3908
|
]
|
|
3826
3909
|
}
|
|
@@ -3833,12 +3916,12 @@ var VirtualTable = forwardRef8((props, ref) => {
|
|
|
3833
3916
|
label6,
|
|
3834
3917
|
!!headerMeta?.headerAlign ? virtualTable_exports[`align${headerMeta?.headerAlign}`] : alignLeft
|
|
3835
3918
|
),
|
|
3836
|
-
children:
|
|
3919
|
+
children: renderHeaderNode(header2)
|
|
3837
3920
|
}
|
|
3838
3921
|
) });
|
|
3839
3922
|
};
|
|
3840
|
-
return /* @__PURE__ */ jsxs20(
|
|
3841
|
-
[...Array(fixedWithNumbersCount)].map((
|
|
3923
|
+
return /* @__PURE__ */ jsxs20(Fragment9, { children: [
|
|
3924
|
+
[...Array(fixedWithNumbersCount)].map((_a, index) => {
|
|
3842
3925
|
const header2 = headerGroup.headers[index];
|
|
3843
3926
|
const nextHorizontalHeaders = getNextHorizontalHeaders(
|
|
3844
3927
|
headerGroup.headers,
|
|
@@ -3861,7 +3944,10 @@ var VirtualTable = forwardRef8((props, ref) => {
|
|
|
3861
3944
|
zIndex: 3,
|
|
3862
3945
|
width: `${columnsEstimateSize(index)}px`,
|
|
3863
3946
|
height: `${headerGroupHeight[hgi]}px`,
|
|
3864
|
-
transform: `translateX(${
|
|
3947
|
+
transform: `translateX(${Array.from({ length: index }, (_, i) => columnsEstimateSize(i)).reduce(
|
|
3948
|
+
(sum, w) => sum + w,
|
|
3949
|
+
0
|
|
3950
|
+
)}px) translateY(${headerGroupY(hgi)}px)`
|
|
3865
3951
|
},
|
|
3866
3952
|
children: innerCell(header2)
|
|
3867
3953
|
},
|
|
@@ -3906,7 +3992,7 @@ var VirtualTable = forwardRef8((props, ref) => {
|
|
|
3906
3992
|
width: `${thWidth}px`,
|
|
3907
3993
|
zIndex,
|
|
3908
3994
|
height: `${thHeight}px`,
|
|
3909
|
-
transform: `translateX(${column.start + (!!fixedWithNumbersCount ? -
|
|
3995
|
+
transform: `translateX(${column.start + (!!fixedWithNumbersCount ? -1 : 0)}px) translateY(${translateY}px)`,
|
|
3910
3996
|
borderTop: borders !== "none" && translateY === 0 ? "1px solid var(--border-color)" : void 0
|
|
3911
3997
|
},
|
|
3912
3998
|
children: innerCell(header2)
|
|
@@ -3962,7 +4048,7 @@ var VirtualTable = forwardRef8((props, ref) => {
|
|
|
3962
4048
|
style: {
|
|
3963
4049
|
...isSticky && {
|
|
3964
4050
|
left: virtualCol.start,
|
|
3965
|
-
marginLeft: -1
|
|
4051
|
+
marginLeft: virtualCol.index === 0 ? -1 : 0
|
|
3966
4052
|
// чтобы появился левый бордер
|
|
3967
4053
|
},
|
|
3968
4054
|
width: `${virtualCol.size}px`,
|
|
@@ -3988,7 +4074,7 @@ var VirtualTable = forwardRef8((props, ref) => {
|
|
|
3988
4074
|
overflow: "hidden"
|
|
3989
4075
|
}
|
|
3990
4076
|
},
|
|
3991
|
-
children: rowButtons?.(row.original)?.map((ab) => /* @__PURE__ */ jsx34(
|
|
4077
|
+
children: rowButtons?.(row.original)?.map((ab) => /* @__PURE__ */ jsx34(Fragment9, { children: ab.template ? ab.template(ab) : /* @__PURE__ */ jsx34(
|
|
3992
4078
|
Tooltip,
|
|
3993
4079
|
{
|
|
3994
4080
|
label: ab.title,
|
|
@@ -4017,7 +4103,7 @@ var VirtualTable = forwardRef8((props, ref) => {
|
|
|
4017
4103
|
]
|
|
4018
4104
|
}
|
|
4019
4105
|
),
|
|
4020
|
-
borders !== "none" && /* @__PURE__ */ jsxs20(
|
|
4106
|
+
borders !== "none" && /* @__PURE__ */ jsxs20(Fragment10, { children: [
|
|
4021
4107
|
/* @__PURE__ */ jsx34("div", { className: rightBorder, style: { height: `${rowsTotalSize + summaryHeaderHeight}px` } }),
|
|
4022
4108
|
/* @__PURE__ */ jsx34("div", { className: bottomBorder, style: { width: `${columnsTotalSize}px` } })
|
|
4023
4109
|
] })
|
|
@@ -4027,14 +4113,14 @@ var VirtualTable = forwardRef8((props, ref) => {
|
|
|
4027
4113
|
});
|
|
4028
4114
|
|
|
4029
4115
|
// src/components/view/TreeView/TreeView.tsx
|
|
4030
|
-
import { memo as memo2, useCallback as useCallback12, useMemo as useMemo9, useState as
|
|
4116
|
+
import { memo as memo2, useCallback as useCallback12, useMemo as useMemo9, useState as useState18 } from "react";
|
|
4031
4117
|
|
|
4032
4118
|
// src/components/view/TreeView/treeView.module.css
|
|
4033
4119
|
var search = "treeView_search";
|
|
4034
4120
|
|
|
4035
4121
|
// src/components/view/TreeView/ui/TreeViewItem/TreeViewItem.tsx
|
|
4036
4122
|
import classNames5 from "classnames";
|
|
4037
|
-
import { memo, useEffect as useEffect9, useState as
|
|
4123
|
+
import { memo, useEffect as useEffect9, useState as useState17 } from "react";
|
|
4038
4124
|
|
|
4039
4125
|
// src/components/view/TreeView/ui/TreeViewItem/treeViewItem.module.css
|
|
4040
4126
|
var item2 = "treeViewItem_item";
|
|
@@ -4057,7 +4143,7 @@ var TreeViewItem_default = memo(function TreeViewItem({
|
|
|
4057
4143
|
startIcons,
|
|
4058
4144
|
children: children2
|
|
4059
4145
|
}) {
|
|
4060
|
-
const [isOpen, setIsOpen] =
|
|
4146
|
+
const [isOpen, setIsOpen] = useState17(false);
|
|
4061
4147
|
useEffect9(() => {
|
|
4062
4148
|
setIsOpen(!!searchValue);
|
|
4063
4149
|
}, [searchValue]);
|
|
@@ -4117,9 +4203,9 @@ var getFilteredTree = (tree, search2) => {
|
|
|
4117
4203
|
};
|
|
4118
4204
|
|
|
4119
4205
|
// src/components/view/TreeView/TreeView.tsx
|
|
4120
|
-
import { Fragment as
|
|
4206
|
+
import { Fragment as Fragment11, jsx as jsx36, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4121
4207
|
var TreeView_default = memo2(function TreeView({ data, selected: selected5, startIcons, onSelect, withSearch = false }) {
|
|
4122
|
-
const [searchValue, setSearchValue] =
|
|
4208
|
+
const [searchValue, setSearchValue] = useState18("");
|
|
4123
4209
|
const onChangeSearchValue = useCallback12((e) => setSearchValue(e.target.value), []);
|
|
4124
4210
|
const selectedValues = useMemo9(
|
|
4125
4211
|
() => selected5.reduce(
|
|
@@ -4134,7 +4220,7 @@ var TreeView_default = memo2(function TreeView({ data, selected: selected5, star
|
|
|
4134
4220
|
const filteredData = useMemo9(() => {
|
|
4135
4221
|
return getFilteredTree(data, searchValue);
|
|
4136
4222
|
}, [data, searchValue]);
|
|
4137
|
-
return /* @__PURE__ */ jsxs22(
|
|
4223
|
+
return /* @__PURE__ */ jsxs22(Fragment11, { children: [
|
|
4138
4224
|
withSearch && /* @__PURE__ */ jsx36(
|
|
4139
4225
|
SearchInput,
|
|
4140
4226
|
{
|
|
@@ -4175,11 +4261,11 @@ var valuesWithBorders = "pairs_valuesWithBorders";
|
|
|
4175
4261
|
var dimTypography = "pairs_dimTypography";
|
|
4176
4262
|
|
|
4177
4263
|
// src/components/view/Pairs/ui/TypographyWithTooltip.tsx
|
|
4178
|
-
import { useState as
|
|
4264
|
+
import { useState as useState19 } from "react";
|
|
4179
4265
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
4180
4266
|
function TypographyWithTooltip(props) {
|
|
4181
4267
|
const { label: label8 } = props;
|
|
4182
|
-
const [tooltip, setTooltip] =
|
|
4268
|
+
const [tooltip, setTooltip] = useState19(label8);
|
|
4183
4269
|
return /* @__PURE__ */ jsx37(Tooltip, { label: tooltip, children: /* @__PURE__ */ jsx37(
|
|
4184
4270
|
Typography,
|
|
4185
4271
|
{
|
|
@@ -4197,7 +4283,7 @@ function TypographyWithTooltip(props) {
|
|
|
4197
4283
|
}
|
|
4198
4284
|
|
|
4199
4285
|
// src/components/view/Pairs/Pairs.tsx
|
|
4200
|
-
import { Fragment as
|
|
4286
|
+
import { Fragment as Fragment12, jsx as jsx38, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4201
4287
|
function Pairs(props) {
|
|
4202
4288
|
const { pairs, column1Width = "50%", column2Width = "50%", showBorder, minRowHeight, classes } = props;
|
|
4203
4289
|
return /* @__PURE__ */ jsx38("div", { className: classNames6(classes?.root), children: pairs.map((pair, i) => /* @__PURE__ */ jsx38(
|
|
@@ -4207,7 +4293,7 @@ function Pairs(props) {
|
|
|
4207
4293
|
className: classNames6(classes?.rowContainer, {
|
|
4208
4294
|
[rowContainerBorders]: showBorder
|
|
4209
4295
|
}),
|
|
4210
|
-
children: pair && /* @__PURE__ */ jsxs23(
|
|
4296
|
+
children: pair && /* @__PURE__ */ jsxs23(Fragment12, { children: [
|
|
4211
4297
|
/* @__PURE__ */ jsx38(
|
|
4212
4298
|
"div",
|
|
4213
4299
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nntc-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.82",
|
|
4
4
|
"author": "NNTC",
|
|
5
5
|
"description": "React UI-kit for NNTC",
|
|
6
6
|
"type": "module",
|
|
@@ -118,4 +118,4 @@
|
|
|
118
118
|
"vite-plugin-svgr": "^4.5.0",
|
|
119
119
|
"vite-tsconfig-paths": "^5.1.4"
|
|
120
120
|
}
|
|
121
|
-
}
|
|
121
|
+
}
|
package/styles/themes/dark.css
CHANGED
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
--theme-accent: #7bd3f6;
|
|
28
28
|
|
|
29
29
|
--theme-success: #4caf50;
|
|
30
|
-
--theme-warning: #
|
|
30
|
+
--theme-warning: #ff9800;
|
|
31
|
+
--theme-info: #03a9f4;
|
|
31
32
|
--theme-error: #ef5350;
|
|
32
33
|
--theme-focus: #7bd3f6;
|
|
33
34
|
|
|
@@ -37,7 +38,8 @@
|
|
|
37
38
|
--theme-table-hover-row: #494949;
|
|
38
39
|
--theme-table-selected-row: rgba(3, 169, 244, 0.08);
|
|
39
40
|
--theme-table-hover-selected-row: rgba(3, 169, 244, 0.16);
|
|
40
|
-
--theme-table-
|
|
41
|
+
--theme-table-success: rgba(76, 175, 80, 0.08);
|
|
42
|
+
--theme-table-error: rgba(239, 83, 80, 0.08);
|
|
41
43
|
|
|
42
44
|
--theme-tooltip-background: rgba(40, 40, 40, 0.9);
|
|
43
45
|
|
package/styles/themes/light.css
CHANGED
|
@@ -26,9 +26,10 @@
|
|
|
26
26
|
|
|
27
27
|
--theme-accent: #03a9f4;
|
|
28
28
|
|
|
29
|
-
--theme-success: #
|
|
30
|
-
--theme-warning: #
|
|
31
|
-
--theme-
|
|
29
|
+
--theme-success: #4caf50;
|
|
30
|
+
--theme-warning: #ff9800;
|
|
31
|
+
--theme-info: #03a9f4;
|
|
32
|
+
--theme-error: #ef5350;
|
|
32
33
|
--theme-focus: #03a9f4;
|
|
33
34
|
|
|
34
35
|
--theme-table-background: #ffffff;
|
|
@@ -37,7 +38,8 @@
|
|
|
37
38
|
--theme-table-hover-row: #f5f5f5;
|
|
38
39
|
--theme-table-selected-row: rgba(3, 169, 244, 0.08);
|
|
39
40
|
--theme-table-hover-selected-row: rgba(3, 169, 244, 0.16);
|
|
40
|
-
--theme-table-
|
|
41
|
+
--theme-table-success: rgba(76, 175, 80, 0.08);
|
|
42
|
+
--theme-table-error: rgba(239, 83, 80, 0.08);
|
|
41
43
|
|
|
42
44
|
--theme-tooltip-background: rgba(215, 215, 215, 0.9);
|
|
43
45
|
|