@dartech/arsenal-ui 1.4.43 → 1.4.45

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { styled, createTheme, responsiveFontSizes, ThemeProvider } from '@mui/material/styles';
1
+ import { createTheme, responsiveFontSizes, styled, ThemeProvider } from '@mui/material/styles';
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import Button from '@mui/material/Button';
4
4
  import Dialog from '@mui/material/Dialog';
@@ -44,16 +44,17 @@ import { toString, parse as parse$1 } from 'duration-fns';
44
44
  import InputMask from 'react-input-mask';
45
45
  import Pagination from '@mui/material/Pagination';
46
46
  import MuiTablePagination from '@mui/material/TablePagination';
47
- import { useGridApiContext, useGridSelector, gridPageSelector, gridPageCountSelector, gridRowCountSelector, gridPageSizeSelector, GridColumnMenuContainer, GridFilterMenuItem, DataGrid, GridActionsCellItem } from '@mui/x-data-grid';
47
+ import { useGridApiContext, useGridSelector, gridPageSelector, gridPageCountSelector, gridRowCountSelector, gridPageSizeSelector, GridColumnMenuContainer, GridFilterMenuItem, GridActionsCellItem } from '@mui/x-data-grid';
48
+ import { DataGrid } from '@mui/x-data-grid/DataGrid';
48
49
  import MuiTable from '@mui/material/Table';
49
50
  import TableBody from '@mui/material/TableBody';
50
51
  import TableCell from '@mui/material/TableCell';
51
52
  import TableContainer from '@mui/material/TableContainer';
52
53
  import TableHead from '@mui/material/TableHead';
53
54
  import TableRow from '@mui/material/TableRow';
54
- import TableSortLabel from '@mui/material/TableSortLabel';
55
55
  import TableFooter from '@mui/material/TableFooter';
56
56
  import Backdrop from '@mui/material/Backdrop';
57
+ import MuiTableSortLabel from '@mui/material/TableSortLabel';
57
58
  import Menu from '@mui/material/Menu';
58
59
  import MoreHorizIcon from '@mui/icons-material/MoreHoriz';
59
60
  import Paper from '@mui/material/Paper';
@@ -786,8 +787,8 @@ const useAutocomplete = ({
786
787
  };
787
788
  var useAutocomplete$1 = useAutocomplete;
788
789
 
789
- var img$4 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z' fill='%238B8C9E'/%3e%3c/svg%3e";
790
- var PopupIcon = img$4;
790
+ var img$7 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z' fill='%238B8C9E'/%3e%3c/svg%3e";
791
+ var PopupIcon = img$7;
791
792
 
792
793
  /**
793
794
  * Material UI `Autocomplete` controlled component. Used with react-hook-form
@@ -1512,211 +1513,637 @@ const JsonTypeCell = ({
1512
1513
  };
1513
1514
  var JsonTypeCell$1 = JsonTypeCell;
1514
1515
 
1515
- const formatTableRowValue = ({
1516
- value,
1517
- canCopy,
1518
- copyValue,
1519
- shortId,
1520
- fullText,
1521
- textParams
1522
- }) => {
1523
- const {
1524
- displayAs = 'text',
1525
- dateFormat = null,
1526
- statusVariant = null
1527
- } = textParams || {};
1528
- switch (displayAs) {
1529
- case 'boolean':
1530
- return value ? jsx(SvgIcon, Object.assign({
1531
- color: "primary",
1532
- fontSize: "small"
1533
- }, {
1534
- children: jsx("path", {
1535
- d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
1536
- })
1537
- })) : jsx(SvgIcon, Object.assign({
1538
- fontSize: "small"
1539
- }, {
1540
- children: jsx("path", {
1541
- d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"
1542
- })
1543
- }));
1544
- case 'date':
1545
- return value ? dateFormat ? jsx(Box, {
1546
- children: dateFormat.map(formatString => jsx(Box, {
1547
- children: format(new Date(value), formatString)
1548
- }))
1549
- }) : jsxs(Box, {
1550
- children: [jsx(Box, {
1551
- children: format(new Date(value), 'dd.MM.yyyy')
1552
- }), jsx(Box, {
1553
- children: format(new Date(value), 'HH:mm:ss')
1554
- })]
1555
- }) : '';
1556
- case 'status':
1557
- return jsx(Status, {
1558
- text: value,
1559
- status: statusVariant ? statusVariant : 'default'
1560
- });
1561
- case 'json_text':
1562
- return jsx(JsonTypeCell$1, {
1563
- value: value,
1564
- textField: true
1565
- });
1566
- case 'json_code':
1567
- return jsx(JsonTypeCell$1, {
1568
- value: value,
1569
- copyButton: true
1570
- });
1571
- case 'array':
1572
- return jsx(Box, {
1573
- children: value.map((val, index) => jsx(Box, {
1574
- children: val
1575
- }, index))
1576
- });
1577
- case 'number':
1578
- return jsx(Box, Object.assign({
1579
- display: "flex",
1580
- justifyContent: "flex-end"
1581
- }, {
1582
- children: jsx(Box, {
1583
- children: value.toLocaleString('ru-Ru', {
1584
- minimumFractionDigits: 2
1585
- })
1586
- })
1587
- }));
1588
- case 'text':
1589
- default:
1590
- return value ? jsxs(Box, Object.assign({
1591
- display: "flex",
1592
- alignItems: "center",
1593
- width: "100%"
1594
- }, {
1595
- children: [shortId ? jsx(Tooltip, Object.assign({
1596
- title: value
1597
- }, {
1598
- children: jsx(Box, Object.assign({
1599
- mr: "auto"
1600
- }, {
1601
- children: value ? `${value.slice(0, 6)}...${value.slice(-6)}` : '...'
1602
- }))
1603
- })) : fullText ? jsx(Box, Object.assign({
1604
- sx: {
1605
- whiteSpace: 'normal'
1606
- }
1607
- }, {
1608
- children: typeof value === 'string' ? value : JSON.stringify(value)
1609
- })) : jsx(Tooltip, Object.assign({
1610
- title: value
1611
- }, {
1612
- children: jsx(Box, Object.assign({
1613
- className: "MuiDataGrid-cellContent"
1614
- }, {
1615
- children: typeof value === 'string' ? value : JSON.stringify(value)
1616
- }))
1617
- })), canCopy && jsx(CopyButton, {
1618
- copyText: copyValue ? typeof copyValue === 'string' ? copyValue : JSON.stringify(copyValue) : value
1619
- })]
1620
- })) : '';
1621
- }
1622
- };
1623
-
1624
- const digitsOnly = new RegExp('^[-+]?[0-9]+$');
1625
- const floatsOnly = new RegExp(/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/);
1626
- const isExpression = (value, useRecursion) => {
1627
- if (typeof value === 'string') return /\$(?:S?JS)?(?:\{|\()/g.test(value);
1628
- if (useRecursion) {
1629
- if (Array.isArray(value)) {
1630
- for (const item of value) {
1631
- if (isExpression(item, useRecursion)) return true;
1632
- }
1516
+ const baseThemeOptions = {
1517
+ spacing: 4,
1518
+ palette: {
1519
+ primary: {
1520
+ main: '#E0613A',
1521
+ dark: '#d9512e',
1522
+ light: '#E0613A'
1523
+ },
1524
+ secondary: {
1525
+ main: '#007994',
1526
+ dark: '#262842',
1527
+ light: '#cbe8ee'
1528
+ },
1529
+ text: {
1530
+ disabled: '#A9A9B8'
1531
+ },
1532
+ success: {
1533
+ main: '#2DB77B',
1534
+ light: '#DBFCEE'
1535
+ },
1536
+ grey: {
1537
+ 700: '#101F2B'
1633
1538
  }
1634
- if (typeof value === 'object') {
1635
- for (const key in value) {
1636
- if (isExpression(value[key], useRecursion)) return true;
1637
- }
1539
+ },
1540
+ typography: {
1541
+ fontSize: 14,
1542
+ allVariants: {
1543
+ fontFamily: ['Euclid', '-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'].join(',')
1544
+ },
1545
+ h1: {
1546
+ fontWeight: 400
1547
+ },
1548
+ h3: {
1549
+ fontWeight: 500
1550
+ },
1551
+ h4: {
1552
+ fontWeight: 500
1638
1553
  }
1639
1554
  }
1640
- return false;
1641
- // return typeof value === 'string' ? /\$(?:S?JS)?\(/g.test(value) : false;
1642
- };
1643
-
1644
- const isDateType = propertyType => {
1645
- return propertyType === PropertyType.DATE || propertyType === PropertyType.DATE_TIME || propertyType === PropertyType.TIME;
1646
1555
  };
1647
- const numberFormat = new Intl.NumberFormat('ru-RU', {
1648
- style: 'decimal'
1649
- });
1556
+ var baseTheme = createTheme(baseThemeOptions);
1650
1557
 
1651
- const isPropertyValueEmpty = value => {
1652
- if (value || value === 0 || value === false) {
1653
- return false;
1654
- }
1655
- return true;
1656
- };
1657
- const formatPropertyValue = (propertyType, value, params) => {
1658
- if (value === null || value === undefined) {
1659
- return null;
1660
- }
1661
- if (isExpression(value)) return value;
1662
- let parsedValue = value;
1663
- // console.log(value);
1664
- switch (propertyType) {
1665
- case PropertyType.BOOLEAN:
1666
- if (value) {
1667
- parsedValue = true;
1668
- } else if (!value && value !== null) {
1669
- parsedValue = false;
1670
- } else {
1671
- parsedValue = null;
1558
+ const inputThemeOptions = {
1559
+ components: {
1560
+ MuiButton: {
1561
+ styleOverrides: {
1562
+ root: {
1563
+ lineHeight: 1.429
1564
+ }
1672
1565
  }
1673
- break;
1674
- case PropertyType.INTEGER:
1675
- case PropertyType.BIG_INTEGER:
1676
- case PropertyType.BIG_DECIMAL:
1677
- case PropertyType.FLOAT:
1678
- case PropertyType.LONG:
1679
- case PropertyType.DOUBLE:
1680
- parsedValue = Number(value);
1681
- break;
1682
- case PropertyType.DATE:
1683
- case PropertyType.DATE_TIME:
1684
- case PropertyType.TIME:
1685
- {
1686
- if (value) {
1687
- try {
1688
- const formatString = params.formatText.replace(/[Z,z,x]+/g, 'XX');
1689
- parsedValue = format(parse(value, formatString, new Date()), formatString);
1690
- } catch (e) {
1691
- console.error(e);
1692
- }
1566
+ },
1567
+ MuiInputBase: {
1568
+ styleOverrides: {
1569
+ root: {
1570
+ borderRadius: baseTheme.spacing(3),
1571
+ minWidth: baseTheme.spacing(25),
1572
+ background: baseTheme.palette.background.default
1573
+ // height: 40
1574
+ },
1575
+
1576
+ // sizeSmall: {
1577
+ // padding: baseTheme.spacing(1, 0, 1, 4),
1578
+ // },
1579
+ input: {
1580
+ minWidth: baseTheme.spacing(25)
1581
+ // padding: 0,
1582
+ // height: '32px',
1693
1583
  }
1694
- break;
1695
1584
  }
1696
- case PropertyType.JSON:
1697
- try {
1698
- if (typeof value !== 'string') {
1699
- parsedValue = JSON.stringify(value);
1585
+ },
1586
+
1587
+ MuiSelect: {
1588
+ styleOverrides: {
1589
+ nativeInput: {
1590
+ padding: 0,
1591
+ height: '32px'
1700
1592
  }
1701
- parsedValue = JSON.parse(parsedValue);
1702
- } catch (e) {
1703
- console.log(e);
1704
- parsedValue = null;
1705
1593
  }
1706
- break;
1707
- case PropertyType.ANY:
1708
- try {
1709
- if (typeof value === 'string') {
1710
- parsedValue = JSON.parse(parsedValue);
1711
- } else {
1712
- parsedValue = value;
1594
+ },
1595
+ MuiTextField: {
1596
+ styleOverrides: {
1597
+ root: {
1598
+ minWidth: baseTheme.spacing(25)
1713
1599
  }
1714
- // parsedValue = JSON.parse(parsedValue as string);
1715
- } catch (e) {
1716
- // console.log(e);
1717
- parsedValue = value;
1718
1600
  }
1719
- break;
1601
+ },
1602
+ MuiInputLabel: {
1603
+ styleOverrides: {
1604
+ root: {
1605
+ position: 'relative',
1606
+ overflow: 'initial',
1607
+ transform: 'none',
1608
+ marginBottom: baseTheme.spacing(1),
1609
+ fontWeight: 500,
1610
+ fontSize: '14px',
1611
+ lineHeight: '20px',
1612
+ pointerEvents: 'auto'
1613
+ }
1614
+ }
1615
+ },
1616
+ MuiOutlinedInput: {
1617
+ styleOverrides: {
1618
+ root: {
1619
+ borderRadius: baseTheme.spacing(3),
1620
+ minWidth: baseTheme.spacing(25)
1621
+ },
1622
+ notchedOutline: {
1623
+ top: 0,
1624
+ '& legend': {
1625
+ display: 'none',
1626
+ transition: 'none'
1627
+ }
1628
+ }
1629
+ }
1630
+ },
1631
+ MuiAutocomplete: {
1632
+ styleOverrides: {
1633
+ paper: {
1634
+ marginTop: 8,
1635
+ borderRadius: 12,
1636
+ boxShadow: '0px 8px 16px rgba(0, 0, 0, 0.04)'
1637
+ },
1638
+ listbox: {
1639
+ '::-webkit-scrollbar': {
1640
+ width: '6px',
1641
+ backgroundColor: 'white'
1642
+ },
1643
+ '::-webkit-scrollbar-thumb': {
1644
+ borderRadius: '10px',
1645
+ backgroundColor: 'rgba(38, 40, 66, 0.24)'
1646
+ }
1647
+ }
1648
+ }
1649
+ },
1650
+ MuiMenu: {
1651
+ styleOverrides: {
1652
+ list: {
1653
+ paddingTop: 0,
1654
+ paddingBottom: 0,
1655
+ background: 'white',
1656
+ '& li.Mui-selected': {
1657
+ background: 'rgba(38, 40, 66, 0.08) !important'
1658
+ }
1659
+ }
1660
+ }
1661
+ },
1662
+ MuiPopover: {
1663
+ styleOverrides: {
1664
+ paper: {
1665
+ marginTop: 8,
1666
+ borderRadius: 12,
1667
+ boxShadow: '0px 8px 16px rgba(0, 0, 0, 0.04)'
1668
+ }
1669
+ }
1670
+ },
1671
+ MuiFormLabel: {
1672
+ styleOverrides: {
1673
+ root: {
1674
+ fontSize: 14,
1675
+ fontWeight: 500
1676
+ },
1677
+ asterisk: {
1678
+ color: '#D6331F',
1679
+ '&$error': {
1680
+ color: '#D6331F'
1681
+ }
1682
+ }
1683
+ }
1684
+ },
1685
+ MuiTooltip: {
1686
+ styleOverrides: {
1687
+ tooltip: {
1688
+ fontSize: 14
1689
+ },
1690
+ backgroundColor: baseTheme.palette.secondary.dark,
1691
+ padding: baseTheme.spacing(2, 3),
1692
+ borderRadius: 8,
1693
+ textAlign: 'center'
1694
+ }
1695
+ }
1696
+ }
1697
+ };
1698
+ var inputThemeOptions$1 = inputThemeOptions;
1699
+
1700
+ const tableThemeOptions = {
1701
+ components: {
1702
+ MuiTableContainer: {
1703
+ styleOverrides: {
1704
+ root: {
1705
+ borderRadius: baseTheme.spacing(3),
1706
+ border: '1px solid rgba(38, 40, 66, 0.08)',
1707
+ overflow: 'hidden'
1708
+ }
1709
+ }
1710
+ },
1711
+ MuiTableHead: {
1712
+ styleOverrides: {
1713
+ root: {
1714
+ backgroundColor: '#F7F8FC'
1715
+ }
1716
+ }
1717
+ },
1718
+ MuiTableRow: {
1719
+ styleOverrides: {
1720
+ root: {
1721
+ '&:hover': {
1722
+ backgroundColor: '#F7F8FC!important'
1723
+ }
1724
+ }
1725
+ }
1726
+ },
1727
+ MuiTableCell: {
1728
+ styleOverrides: {
1729
+ root: {
1730
+ padding: baseTheme.spacing(1, 2),
1731
+ '&:first-of-type': {
1732
+ paddingLeft: baseTheme.spacing(4)
1733
+ }
1734
+ },
1735
+ head: {
1736
+ padding: baseTheme.spacing(2.75, 2),
1737
+ color: '#6D6E85'
1738
+ },
1739
+ body: {
1740
+ wordBreak: 'break-all'
1741
+ }
1742
+ }
1743
+ },
1744
+ MuiTableSortLabel: {
1745
+ styleOverrides: {
1746
+ root: {
1747
+ maxHeight: '24px',
1748
+ lineHeight: 1
1749
+ }
1750
+ }
1751
+ }
1752
+ }
1753
+ };
1754
+ var tableThemeOptions$1 = tableThemeOptions;
1755
+
1756
+ const stepperThemeOptions = {
1757
+ components: {
1758
+ MuiStepIcon: {
1759
+ styleOverrides: {
1760
+ root: {
1761
+ fontSize: '20px',
1762
+ color: baseTheme.palette.text.disabled,
1763
+ '&.Mui-active, &.Mui-completed': {
1764
+ color: baseTheme.palette.secondary.main
1765
+ }
1766
+ }
1767
+ }
1768
+ }
1769
+ }
1770
+ };
1771
+ var stepperThemeOptions$1 = stepperThemeOptions;
1772
+
1773
+ const typographyThemeOptions = {
1774
+ components: {
1775
+ MuiTypography: {
1776
+ styleOverrides: {
1777
+ h1: {
1778
+ [baseTheme.breakpoints.up('lg')]: {
1779
+ fontSize: '1.5rem'
1780
+ }
1781
+ },
1782
+ h3: {
1783
+ fontSize: '1.25rem',
1784
+ [baseTheme.breakpoints.up('lg')]: {
1785
+ fontSize: '1.125rem'
1786
+ }
1787
+ },
1788
+ h4: {
1789
+ fontSize: '1rem',
1790
+ [baseTheme.breakpoints.up('lg')]: {
1791
+ fontSize: '1rem'
1792
+ }
1793
+ },
1794
+ subtitle2: {
1795
+ color: '#6D6E85'
1796
+ }
1797
+ }
1798
+ }
1799
+ }
1800
+ };
1801
+ var typographyThemeOptions$1 = typographyThemeOptions;
1802
+
1803
+ const arsenalTheme = () => {
1804
+ if (document) {
1805
+ const url = "https://dev-qa-arsenal-frontend-fonts-bucket.s3.eu-north-1.amazonaws.com/fonts.css";
1806
+ const fontsLink = document.querySelectorAll(`link[href="${url}"]`);
1807
+ if (!fontsLink.length) {
1808
+ const link = document.createElement('link');
1809
+ link.href = url;
1810
+ link.rel = 'stylesheet';
1811
+ document.head.appendChild(link);
1812
+ }
1813
+ }
1814
+ return responsiveFontSizes(createTheme(baseTheme, {
1815
+ components: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, inputThemeOptions$1.components), tableThemeOptions$1.components), stepperThemeOptions$1.components), typographyThemeOptions$1.components), {
1816
+ MuiToolbar: {
1817
+ styleOverrides: {
1818
+ root: {
1819
+ [baseTheme.breakpoints.up('sm')]: {
1820
+ minHeight: '56px'
1821
+ }
1822
+ }
1823
+ }
1824
+ },
1825
+ // MuiBackdrop: {
1826
+ // styleOverrides: {
1827
+ // root: {
1828
+ // backgroundColor: 'rgba(0, 0, 0, 0.2)',
1829
+ // },
1830
+ // },
1831
+ // },
1832
+ MuiAppBar: {
1833
+ styleOverrides: {
1834
+ root: {
1835
+ boxShadow: 'none',
1836
+ backgroundColor: '#007F9B'
1837
+ }
1838
+ }
1839
+ },
1840
+ MuiButton: {
1841
+ styleOverrides: {
1842
+ root: {
1843
+ borderRadius: baseTheme.spacing(2.5),
1844
+ padding: baseTheme.spacing(2.5, 4),
1845
+ lineHeight: '20px',
1846
+ fontSize: '1rem',
1847
+ textTransform: 'none'
1848
+ },
1849
+ outlined: {
1850
+ color: '#262842',
1851
+ backgroundColor: '#FFFFFF !important',
1852
+ border: '1px solid rgba(38, 40, 66, 0.12)'
1853
+ },
1854
+ text: {
1855
+ color: baseTheme.palette.secondary.dark
1856
+ }
1857
+ }
1858
+ },
1859
+ MuiDialog: {
1860
+ styleOverrides: {
1861
+ root: {
1862
+ '& .MuiModal-backdrop': {
1863
+ background: 'rgba(28, 55, 77, 0.5)',
1864
+ backdropFilter: 'blur(2px)'
1865
+ }
1866
+ },
1867
+ paper: {
1868
+ borderRadius: baseTheme.spacing(3)
1869
+ },
1870
+ paperWidthXs: {
1871
+ maxWidth: 500
1872
+ }
1873
+ }
1874
+ },
1875
+ // MuiPaper: {
1876
+ // styleOverrides: {
1877
+ // root: {
1878
+ // borderRadius: baseTheme.spacing(3),
1879
+ // },
1880
+ // },
1881
+ // },
1882
+ MuiDialogContent: {
1883
+ styleOverrides: {
1884
+ root: {
1885
+ color: '#6D6E85'
1886
+ }
1887
+ }
1888
+ },
1889
+ MuiDialogActions: {
1890
+ styleOverrides: {
1891
+ root: {
1892
+ background: '#F7F8FC',
1893
+ borderTop: '1px solid rgba(38, 40, 66, 0.08)',
1894
+ padding: baseTheme.spacing(3, 6)
1895
+ }
1896
+ }
1897
+ },
1898
+ MuiTabs: {
1899
+ styleOverrides: {
1900
+ root: {
1901
+ minHeight: '38px'
1902
+ },
1903
+ indicator: {
1904
+ backgroundColor: baseTheme.palette.secondary.main
1905
+ }
1906
+ }
1907
+ },
1908
+ MuiTab: {
1909
+ styleOverrides: {
1910
+ root: {
1911
+ fontSize: 14,
1912
+ fontWeight: 500,
1913
+ textTransform: 'none',
1914
+ padding: '10px 12px',
1915
+ lineHeight: '1.125rem',
1916
+ minHeight: '38px',
1917
+ color: '#8B8C9E',
1918
+ '&.Mui-selected': {
1919
+ color: baseTheme.palette.secondary.main
1920
+ }
1921
+ }
1922
+ }
1923
+ }
1924
+ })
1925
+ }));
1926
+ };
1927
+ const theme = arsenalTheme();
1928
+
1929
+ const formatTableRowValue = ({
1930
+ value,
1931
+ canCopy,
1932
+ copyValue,
1933
+ shortId,
1934
+ fullText: _fullText = false,
1935
+ textParams
1936
+ }) => {
1937
+ const {
1938
+ displayAs = 'text',
1939
+ tooltipLinkComponent = null,
1940
+ dateFormat = null,
1941
+ statusVariant = null
1942
+ } = textParams || {};
1943
+ switch (displayAs) {
1944
+ case 'boolean':
1945
+ return value ? jsx(SvgIcon, Object.assign({
1946
+ color: "primary",
1947
+ fontSize: "small"
1948
+ }, {
1949
+ children: jsx("path", {
1950
+ d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
1951
+ })
1952
+ })) : jsx(SvgIcon, Object.assign({
1953
+ fontSize: "small"
1954
+ }, {
1955
+ children: jsx("path", {
1956
+ d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"
1957
+ })
1958
+ }));
1959
+ case 'date':
1960
+ return value ? dateFormat ? jsx(Box, {
1961
+ children: dateFormat.map((formatString, index) => jsx(Box, {
1962
+ children: format(new Date(value), formatString)
1963
+ }, index))
1964
+ }) : jsxs(Box, {
1965
+ children: [jsx(Box, {
1966
+ children: format(new Date(value), 'dd.MM.yyyy')
1967
+ }), jsx(Box, {
1968
+ children: format(new Date(value), 'HH:mm:ss')
1969
+ })]
1970
+ }) : '';
1971
+ case 'status':
1972
+ return jsx(Status, {
1973
+ text: value,
1974
+ status: statusVariant ? statusVariant : 'default'
1975
+ });
1976
+ case 'json_text':
1977
+ return jsx(JsonTypeCell$1, {
1978
+ value: value,
1979
+ textField: true
1980
+ });
1981
+ case 'json_code':
1982
+ return jsx(JsonTypeCell$1, {
1983
+ value: value,
1984
+ copyButton: true
1985
+ });
1986
+ case 'array':
1987
+ return jsx(Box, {
1988
+ children: value === null || value === void 0 ? void 0 : value.map((val, index) => jsx(Box, {
1989
+ children: val
1990
+ }, index))
1991
+ });
1992
+ case 'collapsed_array':
1993
+ return value && jsx(Box, {
1994
+ children: jsx(Tooltip, Object.assign({
1995
+ arrow: true,
1996
+ title: tooltipLinkComponent ? tooltipLinkComponent : value.map((val, index) => jsx(Box, Object.assign({
1997
+ fontSize: 14,
1998
+ style: {
1999
+ paddingTop: theme.spacing(1)
2000
+ }
2001
+ }, {
2002
+ children: val
2003
+ }), index))
2004
+ }, {
2005
+ children: jsx(Box, {
2006
+ children: value.length > 1 ? `${value[0]} (+${value.length - 1})` : value[0]
2007
+ })
2008
+ }))
2009
+ });
2010
+ case 'number':
2011
+ return jsx(Box, Object.assign({
2012
+ display: "flex",
2013
+ justifyContent: "flex-end"
2014
+ }, {
2015
+ children: jsx(Box, {
2016
+ children: value.toLocaleString('ru-Ru', {
2017
+ minimumFractionDigits: 2
2018
+ })
2019
+ })
2020
+ }));
2021
+ case 'text':
2022
+ default:
2023
+ return value ? jsxs(Box, Object.assign({
2024
+ display: "flex",
2025
+ alignItems: "center",
2026
+ width: "100%"
2027
+ }, {
2028
+ children: [shortId ? jsx(OverflowTip, {
2029
+ children: jsx(Box, Object.assign({
2030
+ mr: "auto"
2031
+ }, {
2032
+ children: value ? `${value.slice(0, 6)}...${value.slice(-6)}` : '...'
2033
+ }))
2034
+ }) : _fullText ? jsx(Box, Object.assign({
2035
+ sx: {
2036
+ whiteSpace: 'normal'
2037
+ }
2038
+ }, {
2039
+ children: typeof value === 'string' ? value : JSON.stringify(value)
2040
+ })) : jsx(Box, {
2041
+ children: jsx(OverflowTip, {
2042
+ children: typeof value === 'string' ? value : JSON.stringify(value)
2043
+ })
2044
+ }), canCopy && jsx(CopyButton, {
2045
+ copyText: copyValue ? typeof copyValue === 'string' ? copyValue : JSON.stringify(copyValue) : value
2046
+ })]
2047
+ })) : '';
2048
+ }
2049
+ };
2050
+
2051
+ const digitsOnly = new RegExp('^[-+]?[0-9]+$');
2052
+ const floatsOnly = new RegExp(/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/);
2053
+ const isExpression = (value, useRecursion) => {
2054
+ if (typeof value === 'string') return /\$(?:S?JS)?(?:\{|\()/g.test(value);
2055
+ if (useRecursion) {
2056
+ if (Array.isArray(value)) {
2057
+ for (const item of value) {
2058
+ if (isExpression(item, useRecursion)) return true;
2059
+ }
2060
+ }
2061
+ if (typeof value === 'object') {
2062
+ for (const key in value) {
2063
+ if (isExpression(value[key], useRecursion)) return true;
2064
+ }
2065
+ }
2066
+ }
2067
+ return false;
2068
+ // return typeof value === 'string' ? /\$(?:S?JS)?\(/g.test(value) : false;
2069
+ };
2070
+
2071
+ const isDateType = propertyType => {
2072
+ return propertyType === PropertyType.DATE || propertyType === PropertyType.DATE_TIME || propertyType === PropertyType.TIME;
2073
+ };
2074
+ const numberFormat = new Intl.NumberFormat('ru-RU', {
2075
+ style: 'decimal'
2076
+ });
2077
+
2078
+ const isPropertyValueEmpty = value => {
2079
+ if (value || value === 0 || value === false) {
2080
+ return false;
2081
+ }
2082
+ return true;
2083
+ };
2084
+ const formatPropertyValue = (propertyType, value, params) => {
2085
+ if (value === null || value === undefined) {
2086
+ return null;
2087
+ }
2088
+ if (isExpression(value)) return value;
2089
+ let parsedValue = value;
2090
+ // console.log(value);
2091
+ switch (propertyType) {
2092
+ case PropertyType.BOOLEAN:
2093
+ if (value) {
2094
+ parsedValue = true;
2095
+ } else if (!value && value !== null) {
2096
+ parsedValue = false;
2097
+ } else {
2098
+ parsedValue = null;
2099
+ }
2100
+ break;
2101
+ case PropertyType.INTEGER:
2102
+ case PropertyType.BIG_INTEGER:
2103
+ case PropertyType.BIG_DECIMAL:
2104
+ case PropertyType.FLOAT:
2105
+ case PropertyType.LONG:
2106
+ case PropertyType.DOUBLE:
2107
+ parsedValue = Number(value);
2108
+ break;
2109
+ case PropertyType.DATE:
2110
+ case PropertyType.DATE_TIME:
2111
+ case PropertyType.TIME:
2112
+ {
2113
+ if (value) {
2114
+ try {
2115
+ const formatString = params.formatText.replace(/[Z,z,x]+/g, 'XX');
2116
+ parsedValue = format(parse(value, formatString, new Date()), formatString);
2117
+ } catch (e) {
2118
+ console.error(e);
2119
+ }
2120
+ }
2121
+ break;
2122
+ }
2123
+ case PropertyType.JSON:
2124
+ try {
2125
+ if (typeof value !== 'string') {
2126
+ parsedValue = JSON.stringify(value);
2127
+ }
2128
+ parsedValue = JSON.parse(parsedValue);
2129
+ } catch (e) {
2130
+ console.log(e);
2131
+ parsedValue = null;
2132
+ }
2133
+ break;
2134
+ case PropertyType.ANY:
2135
+ try {
2136
+ if (typeof value === 'string') {
2137
+ parsedValue = JSON.parse(parsedValue);
2138
+ } else {
2139
+ parsedValue = value;
2140
+ }
2141
+ // parsedValue = JSON.parse(parsedValue as string);
2142
+ } catch (e) {
2143
+ // console.log(e);
2144
+ parsedValue = value;
2145
+ }
2146
+ break;
1720
2147
  case PropertyType.ENTITY:
1721
2148
  parsedValue = formatDefinitionData(params.properties, value);
1722
2149
  break;
@@ -2212,8 +2639,8 @@ const ControlSwitch = _a => {
2212
2639
  });
2213
2640
  };
2214
2641
 
2215
- var img$3 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M17.75 3C18.612 3 19.4386 3.34241 20.0481 3.9519C20.6576 4.5614 21 5.38805 21 6.25V17.75C21 18.612 20.6576 19.4386 20.0481 20.0481C19.4386 20.6576 18.612 21 17.75 21H6.25C5.38805 21 4.5614 20.6576 3.9519 20.0481C3.34241 19.4386 3 18.612 3 17.75V6.25C3 5.38805 3.34241 4.5614 3.9519 3.9519C4.5614 3.34241 5.38805 3 6.25 3H17.75ZM19.5 8.5H4.5V17.75C4.5 18.716 5.284 19.5 6.25 19.5H17.75C18.2141 19.5 18.6592 19.3156 18.9874 18.9874C19.3156 18.6592 19.5 18.2141 19.5 17.75V8.5ZM7.75 14.5C8.08152 14.5 8.39946 14.6317 8.63388 14.8661C8.8683 15.1005 9 15.4185 9 15.75C9 16.0815 8.8683 16.3995 8.63388 16.6339C8.39946 16.8683 8.08152 17 7.75 17C7.41848 17 7.10054 16.8683 6.86612 16.6339C6.6317 16.3995 6.5 16.0815 6.5 15.75C6.5 15.4185 6.6317 15.1005 6.86612 14.8661C7.10054 14.6317 7.41848 14.5 7.75 14.5ZM12 14.5C12.3315 14.5 12.6495 14.6317 12.8839 14.8661C13.1183 15.1005 13.25 15.4185 13.25 15.75C13.25 16.0815 13.1183 16.3995 12.8839 16.6339C12.6495 16.8683 12.3315 17 12 17C11.6685 17 11.3505 16.8683 11.1161 16.6339C10.8817 16.3995 10.75 16.0815 10.75 15.75C10.75 15.4185 10.8817 15.1005 11.1161 14.8661C11.3505 14.6317 11.6685 14.5 12 14.5ZM7.75 10.5C8.08152 10.5 8.39946 10.6317 8.63388 10.8661C8.8683 11.1005 9 11.4185 9 11.75C9 12.0815 8.8683 12.3995 8.63388 12.6339C8.39946 12.8683 8.08152 13 7.75 13C7.41848 13 7.10054 12.8683 6.86612 12.6339C6.6317 12.3995 6.5 12.0815 6.5 11.75C6.5 11.4185 6.6317 11.1005 6.86612 10.8661C7.10054 10.6317 7.41848 10.5 7.75 10.5ZM12 10.5C12.3315 10.5 12.6495 10.6317 12.8839 10.8661C13.1183 11.1005 13.25 11.4185 13.25 11.75C13.25 12.0815 13.1183 12.3995 12.8839 12.6339C12.6495 12.8683 12.3315 13 12 13C11.6685 13 11.3505 12.8683 11.1161 12.6339C10.8817 12.3995 10.75 12.0815 10.75 11.75C10.75 11.4185 10.8817 11.1005 11.1161 10.8661C11.3505 10.6317 11.6685 10.5 12 10.5ZM16.25 10.5C16.5815 10.5 16.8995 10.6317 17.1339 10.8661C17.3683 11.1005 17.5 11.4185 17.5 11.75C17.5 12.0815 17.3683 12.3995 17.1339 12.6339C16.8995 12.8683 16.5815 13 16.25 13C15.9185 13 15.6005 12.8683 15.3661 12.6339C15.1317 12.3995 15 12.0815 15 11.75C15 11.4185 15.1317 11.1005 15.3661 10.8661C15.6005 10.6317 15.9185 10.5 16.25 10.5ZM17.75 4.5H6.25C5.78587 4.5 5.34075 4.68437 5.01256 5.01256C4.68437 5.34075 4.5 5.78587 4.5 6.25V7H19.5V6.25C19.5 5.78587 19.3156 5.34075 18.9874 5.01256C18.6592 4.68437 18.2141 4.5 17.75 4.5Z' fill='%238B8C9E'/%3e%3c/svg%3e";
2216
- var DateIcon = img$3;
2642
+ var img$6 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M17.75 3C18.612 3 19.4386 3.34241 20.0481 3.9519C20.6576 4.5614 21 5.38805 21 6.25V17.75C21 18.612 20.6576 19.4386 20.0481 20.0481C19.4386 20.6576 18.612 21 17.75 21H6.25C5.38805 21 4.5614 20.6576 3.9519 20.0481C3.34241 19.4386 3 18.612 3 17.75V6.25C3 5.38805 3.34241 4.5614 3.9519 3.9519C4.5614 3.34241 5.38805 3 6.25 3H17.75ZM19.5 8.5H4.5V17.75C4.5 18.716 5.284 19.5 6.25 19.5H17.75C18.2141 19.5 18.6592 19.3156 18.9874 18.9874C19.3156 18.6592 19.5 18.2141 19.5 17.75V8.5ZM7.75 14.5C8.08152 14.5 8.39946 14.6317 8.63388 14.8661C8.8683 15.1005 9 15.4185 9 15.75C9 16.0815 8.8683 16.3995 8.63388 16.6339C8.39946 16.8683 8.08152 17 7.75 17C7.41848 17 7.10054 16.8683 6.86612 16.6339C6.6317 16.3995 6.5 16.0815 6.5 15.75C6.5 15.4185 6.6317 15.1005 6.86612 14.8661C7.10054 14.6317 7.41848 14.5 7.75 14.5ZM12 14.5C12.3315 14.5 12.6495 14.6317 12.8839 14.8661C13.1183 15.1005 13.25 15.4185 13.25 15.75C13.25 16.0815 13.1183 16.3995 12.8839 16.6339C12.6495 16.8683 12.3315 17 12 17C11.6685 17 11.3505 16.8683 11.1161 16.6339C10.8817 16.3995 10.75 16.0815 10.75 15.75C10.75 15.4185 10.8817 15.1005 11.1161 14.8661C11.3505 14.6317 11.6685 14.5 12 14.5ZM7.75 10.5C8.08152 10.5 8.39946 10.6317 8.63388 10.8661C8.8683 11.1005 9 11.4185 9 11.75C9 12.0815 8.8683 12.3995 8.63388 12.6339C8.39946 12.8683 8.08152 13 7.75 13C7.41848 13 7.10054 12.8683 6.86612 12.6339C6.6317 12.3995 6.5 12.0815 6.5 11.75C6.5 11.4185 6.6317 11.1005 6.86612 10.8661C7.10054 10.6317 7.41848 10.5 7.75 10.5ZM12 10.5C12.3315 10.5 12.6495 10.6317 12.8839 10.8661C13.1183 11.1005 13.25 11.4185 13.25 11.75C13.25 12.0815 13.1183 12.3995 12.8839 12.6339C12.6495 12.8683 12.3315 13 12 13C11.6685 13 11.3505 12.8683 11.1161 12.6339C10.8817 12.3995 10.75 12.0815 10.75 11.75C10.75 11.4185 10.8817 11.1005 11.1161 10.8661C11.3505 10.6317 11.6685 10.5 12 10.5ZM16.25 10.5C16.5815 10.5 16.8995 10.6317 17.1339 10.8661C17.3683 11.1005 17.5 11.4185 17.5 11.75C17.5 12.0815 17.3683 12.3995 17.1339 12.6339C16.8995 12.8683 16.5815 13 16.25 13C15.9185 13 15.6005 12.8683 15.3661 12.6339C15.1317 12.3995 15 12.0815 15 11.75C15 11.4185 15.1317 11.1005 15.3661 10.8661C15.6005 10.6317 15.9185 10.5 16.25 10.5ZM17.75 4.5H6.25C5.78587 4.5 5.34075 4.68437 5.01256 5.01256C4.68437 5.34075 4.5 5.78587 4.5 6.25V7H19.5V6.25C19.5 5.78587 19.3156 5.34075 18.9874 5.01256C18.6592 4.68437 18.2141 4.5 17.75 4.5Z' fill='%238B8C9E'/%3e%3c/svg%3e";
2643
+ var DateIcon = img$6;
2217
2644
 
2218
2645
  const DateIconComponent$1 = () => {
2219
2646
  return jsx("img", {
@@ -2779,8 +3206,8 @@ const ControlPeriodInput = ({
2779
3206
  });
2780
3207
  };
2781
3208
 
2782
- var img$2 = "data:image/svg+xml,%3csvg width='32' height='24' viewBox='0 0 32 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_6762_5474)'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3cmask id='mask0_6762_5474' style='mask-type:luminance' maskUnits='userSpaceOnUse' x='0' y='0' width='32' height='24'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3c/mask%3e%3cg mask='url(%23mask0_6762_5474)'%3e%3crect width='32' height='24' fill='%2330C6E0'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M16.0001 16.8002C18.5249 16.8002 20.5716 14.6512 20.5716 12.0002C20.5716 9.34923 18.5249 7.2002 16.0001 7.2002C13.4754 7.2002 11.4287 9.34923 11.4287 12.0002C11.4287 14.6512 13.4754 16.8002 16.0001 16.8002Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M14.1352 20.5791L16.0001 17.6561L17.865 20.5791L18.3374 17.096L21.2255 18.8799L20.2118 15.5264L23.5511 15.818L21.252 13.2584L24.381 11.9998L21.252 10.7411L23.5511 8.1816L20.2118 8.47311L21.2255 5.11966L18.3374 6.90359L17.865 3.42041L16.0001 6.34344L14.1352 3.42041L13.6628 6.90359L10.7747 5.11966L11.7884 8.47311L8.44912 8.1816L10.7482 10.7411L7.61914 11.9998L10.7482 13.2584L8.44912 15.818L11.7884 15.5264L10.7747 18.8799L13.6628 17.096L14.1352 20.5791ZM21.3334 11.9998C21.3334 15.0926 18.9456 17.5998 16.0001 17.5998C13.0546 17.5998 10.6668 15.0926 10.6668 11.9998C10.6668 8.90698 13.0546 6.39978 16.0001 6.39978C18.9456 6.39978 21.3334 8.90698 21.3334 11.9998Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.52393 1.93343C1.52393 1.74934 1.67316 1.6001 1.85726 1.6001H2.7144C2.8985 1.6001 3.04774 1.74934 3.04774 1.93343V2.86676C3.04774 3.05086 2.8985 3.2001 2.7144 3.2001H1.85726C1.67316 3.2001 1.52393 3.05086 1.52393 2.86676V1.93343ZM1.52393 5.13343C1.52393 4.94934 1.67316 4.8001 1.85726 4.8001H2.7144C2.8985 4.8001 3.04774 4.94934 3.04774 5.13343V6.06676C3.04774 6.25086 2.8985 6.4001 2.7144 6.4001H1.85726C1.67316 6.4001 1.52393 6.25086 1.52393 6.06676V5.13343ZM1.85726 8.0001C1.67316 8.0001 1.52393 8.14934 1.52393 8.33343V9.26676C1.52393 9.45086 1.67316 9.6001 1.85726 9.6001H2.7144C2.8985 9.6001 3.04774 9.45086 3.04774 9.26676V8.33343C3.04774 8.14934 2.8985 8.0001 2.7144 8.0001H1.85726ZM1.52393 11.5334C1.52393 11.3493 1.67316 11.2001 1.85726 11.2001H2.7144C2.8985 11.2001 3.04774 11.3493 3.04774 11.5334V12.4668C3.04774 12.6509 2.8985 12.8001 2.7144 12.8001H1.85726C1.67316 12.8001 1.52393 12.6509 1.52393 12.4668V11.5334ZM1.85726 14.4001C1.67316 14.4001 1.52393 14.5493 1.52393 14.7334V15.6668C1.52393 15.8509 1.67316 16.0001 1.85726 16.0001H2.7144C2.8985 16.0001 3.04774 15.8509 3.04774 15.6668V14.7334C3.04774 14.5493 2.8985 14.4001 2.7144 14.4001H1.85726ZM1.52393 17.9334C1.52393 17.7493 1.67316 17.6001 1.85726 17.6001H2.7144C2.8985 17.6001 3.04774 17.7493 3.04774 17.9334V18.8668C3.04774 19.0509 2.8985 19.2001 2.7144 19.2001H1.85726C1.67316 19.2001 1.52393 19.0509 1.52393 18.8668V17.9334ZM1.85726 20.8001C1.67316 20.8001 1.52393 20.9493 1.52393 21.1334V22.0668C1.52393 22.2509 1.67316 22.4001 1.85726 22.4001H2.7144C2.8985 22.4001 3.04774 22.2509 3.04774 22.0668V21.1334C3.04774 20.9493 2.8985 20.8001 2.7144 20.8001H1.85726ZM3.04774 19.5334C3.04774 19.3493 3.19697 19.2001 3.38107 19.2001H4.23821C4.42231 19.2001 4.57154 19.3493 4.57154 19.5334V20.4668C4.57154 20.6509 4.42231 20.8001 4.23821 20.8001H3.38107C3.19697 20.8001 3.04774 20.6509 3.04774 20.4668V19.5334ZM3.38107 16.0001C3.19697 16.0001 3.04774 16.1493 3.04774 16.3334V17.2668C3.04774 17.4509 3.19697 17.6001 3.38107 17.6001H4.23821C4.42231 17.6001 4.57154 17.4509 4.57154 17.2668V16.3334C4.57154 16.1493 4.42231 16.0001 4.23821 16.0001H3.38107ZM3.04774 13.1334C3.04774 12.9493 3.19697 12.8001 3.38107 12.8001H4.23821C4.42231 12.8001 4.57154 12.9493 4.57154 13.1334V14.0668C4.57154 14.2509 4.42231 14.4001 4.23821 14.4001H3.38107C3.19697 14.4001 3.04774 14.2509 3.04774 14.0668V13.1334ZM3.38107 9.6001C3.19697 9.6001 3.04774 9.74934 3.04774 9.93343V10.8668C3.04774 11.0509 3.19697 11.2001 3.38107 11.2001H4.23821C4.42231 11.2001 4.57154 11.0509 4.57154 10.8668V9.93343C4.57154 9.74934 4.42231 9.6001 4.23821 9.6001H3.38107ZM3.04774 6.73343C3.04774 6.54934 3.19697 6.4001 3.38107 6.4001H4.23821C4.42231 6.4001 4.57154 6.54934 4.57154 6.73343V7.66676C4.57154 7.85086 4.42231 8.0001 4.23821 8.0001H3.38107C3.19697 8.0001 3.04774 7.85086 3.04774 7.66676V6.73343ZM3.38107 3.2001C3.19697 3.2001 3.04774 3.34934 3.04774 3.53343V4.46676C3.04774 4.65086 3.19697 4.8001 3.38107 4.8001H4.23821C4.42231 4.8001 4.57154 4.65086 4.57154 4.46676V3.53343C4.57154 3.34934 4.42231 3.2001 4.23821 3.2001H3.38107Z' fill='%23FFCD4B'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0_6762_5474'%3e%3crect width='32' height='24' rx='4' fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
2783
- var FlagKz = img$2;
3209
+ var img$5 = "data:image/svg+xml,%3csvg width='32' height='24' viewBox='0 0 32 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_6762_5474)'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3cmask id='mask0_6762_5474' style='mask-type:luminance' maskUnits='userSpaceOnUse' x='0' y='0' width='32' height='24'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3c/mask%3e%3cg mask='url(%23mask0_6762_5474)'%3e%3crect width='32' height='24' fill='%2330C6E0'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M16.0001 16.8002C18.5249 16.8002 20.5716 14.6512 20.5716 12.0002C20.5716 9.34923 18.5249 7.2002 16.0001 7.2002C13.4754 7.2002 11.4287 9.34923 11.4287 12.0002C11.4287 14.6512 13.4754 16.8002 16.0001 16.8002Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M14.1352 20.5791L16.0001 17.6561L17.865 20.5791L18.3374 17.096L21.2255 18.8799L20.2118 15.5264L23.5511 15.818L21.252 13.2584L24.381 11.9998L21.252 10.7411L23.5511 8.1816L20.2118 8.47311L21.2255 5.11966L18.3374 6.90359L17.865 3.42041L16.0001 6.34344L14.1352 3.42041L13.6628 6.90359L10.7747 5.11966L11.7884 8.47311L8.44912 8.1816L10.7482 10.7411L7.61914 11.9998L10.7482 13.2584L8.44912 15.818L11.7884 15.5264L10.7747 18.8799L13.6628 17.096L14.1352 20.5791ZM21.3334 11.9998C21.3334 15.0926 18.9456 17.5998 16.0001 17.5998C13.0546 17.5998 10.6668 15.0926 10.6668 11.9998C10.6668 8.90698 13.0546 6.39978 16.0001 6.39978C18.9456 6.39978 21.3334 8.90698 21.3334 11.9998Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.52393 1.93343C1.52393 1.74934 1.67316 1.6001 1.85726 1.6001H2.7144C2.8985 1.6001 3.04774 1.74934 3.04774 1.93343V2.86676C3.04774 3.05086 2.8985 3.2001 2.7144 3.2001H1.85726C1.67316 3.2001 1.52393 3.05086 1.52393 2.86676V1.93343ZM1.52393 5.13343C1.52393 4.94934 1.67316 4.8001 1.85726 4.8001H2.7144C2.8985 4.8001 3.04774 4.94934 3.04774 5.13343V6.06676C3.04774 6.25086 2.8985 6.4001 2.7144 6.4001H1.85726C1.67316 6.4001 1.52393 6.25086 1.52393 6.06676V5.13343ZM1.85726 8.0001C1.67316 8.0001 1.52393 8.14934 1.52393 8.33343V9.26676C1.52393 9.45086 1.67316 9.6001 1.85726 9.6001H2.7144C2.8985 9.6001 3.04774 9.45086 3.04774 9.26676V8.33343C3.04774 8.14934 2.8985 8.0001 2.7144 8.0001H1.85726ZM1.52393 11.5334C1.52393 11.3493 1.67316 11.2001 1.85726 11.2001H2.7144C2.8985 11.2001 3.04774 11.3493 3.04774 11.5334V12.4668C3.04774 12.6509 2.8985 12.8001 2.7144 12.8001H1.85726C1.67316 12.8001 1.52393 12.6509 1.52393 12.4668V11.5334ZM1.85726 14.4001C1.67316 14.4001 1.52393 14.5493 1.52393 14.7334V15.6668C1.52393 15.8509 1.67316 16.0001 1.85726 16.0001H2.7144C2.8985 16.0001 3.04774 15.8509 3.04774 15.6668V14.7334C3.04774 14.5493 2.8985 14.4001 2.7144 14.4001H1.85726ZM1.52393 17.9334C1.52393 17.7493 1.67316 17.6001 1.85726 17.6001H2.7144C2.8985 17.6001 3.04774 17.7493 3.04774 17.9334V18.8668C3.04774 19.0509 2.8985 19.2001 2.7144 19.2001H1.85726C1.67316 19.2001 1.52393 19.0509 1.52393 18.8668V17.9334ZM1.85726 20.8001C1.67316 20.8001 1.52393 20.9493 1.52393 21.1334V22.0668C1.52393 22.2509 1.67316 22.4001 1.85726 22.4001H2.7144C2.8985 22.4001 3.04774 22.2509 3.04774 22.0668V21.1334C3.04774 20.9493 2.8985 20.8001 2.7144 20.8001H1.85726ZM3.04774 19.5334C3.04774 19.3493 3.19697 19.2001 3.38107 19.2001H4.23821C4.42231 19.2001 4.57154 19.3493 4.57154 19.5334V20.4668C4.57154 20.6509 4.42231 20.8001 4.23821 20.8001H3.38107C3.19697 20.8001 3.04774 20.6509 3.04774 20.4668V19.5334ZM3.38107 16.0001C3.19697 16.0001 3.04774 16.1493 3.04774 16.3334V17.2668C3.04774 17.4509 3.19697 17.6001 3.38107 17.6001H4.23821C4.42231 17.6001 4.57154 17.4509 4.57154 17.2668V16.3334C4.57154 16.1493 4.42231 16.0001 4.23821 16.0001H3.38107ZM3.04774 13.1334C3.04774 12.9493 3.19697 12.8001 3.38107 12.8001H4.23821C4.42231 12.8001 4.57154 12.9493 4.57154 13.1334V14.0668C4.57154 14.2509 4.42231 14.4001 4.23821 14.4001H3.38107C3.19697 14.4001 3.04774 14.2509 3.04774 14.0668V13.1334ZM3.38107 9.6001C3.19697 9.6001 3.04774 9.74934 3.04774 9.93343V10.8668C3.04774 11.0509 3.19697 11.2001 3.38107 11.2001H4.23821C4.42231 11.2001 4.57154 11.0509 4.57154 10.8668V9.93343C4.57154 9.74934 4.42231 9.6001 4.23821 9.6001H3.38107ZM3.04774 6.73343C3.04774 6.54934 3.19697 6.4001 3.38107 6.4001H4.23821C4.42231 6.4001 4.57154 6.54934 4.57154 6.73343V7.66676C4.57154 7.85086 4.42231 8.0001 4.23821 8.0001H3.38107C3.19697 8.0001 3.04774 7.85086 3.04774 7.66676V6.73343ZM3.38107 3.2001C3.19697 3.2001 3.04774 3.34934 3.04774 3.53343V4.46676C3.04774 4.65086 3.19697 4.8001 3.38107 4.8001H4.23821C4.42231 4.8001 4.57154 4.65086 4.57154 4.46676V3.53343C4.57154 3.34934 4.42231 3.2001 4.23821 3.2001H3.38107Z' fill='%23FFCD4B'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0_6762_5474'%3e%3crect width='32' height='24' rx='4' fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
3210
+ var FlagKz = img$5;
2784
3211
 
2785
3212
  const ControlPhoneInput = _a => {
2786
3213
  var {
@@ -2859,6 +3286,13 @@ const TablePagination = () => {
2859
3286
  const pageSize = useGridSelector(apiRef, gridPageSizeSelector);
2860
3287
  const onPageChange = value => apiRef.current.setPage(value);
2861
3288
  const onRowsPerPageChange = event => apiRef.current.setPageSize(parseInt(event.target.value, 10));
3289
+ const labelDisplayedRows = ({
3290
+ from,
3291
+ to,
3292
+ count
3293
+ }) => {
3294
+ return `${from}–${to} из ${count !== -1 ? count : `более ${to}`}`;
3295
+ };
2862
3296
  return jsxs(Box, Object.assign({
2863
3297
  px: 2,
2864
3298
  display: "flex",
@@ -2872,6 +3306,8 @@ const TablePagination = () => {
2872
3306
  rowsPerPageOptions: [10, 20, 50, 100],
2873
3307
  onPageChange: (event, value) => onPageChange(value),
2874
3308
  onRowsPerPageChange: onRowsPerPageChange,
3309
+ labelRowsPerPage: "\u0421\u0442\u0440\u043E\u043A \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435",
3310
+ labelDisplayedRows: labelDisplayedRows,
2875
3311
  ActionsComponent: undefined
2876
3312
  }), jsx(Pagination, {
2877
3313
  count: pageCount,
@@ -3002,20 +3438,55 @@ const usePagination = initialPageSize => {
3002
3438
  };
3003
3439
  var usePagination$1 = usePagination;
3004
3440
 
3005
- const styles = {
3441
+ const StyledDataGrid = styled(DataGrid)(({
3442
+ theme
3443
+ }) => ({
3444
+ borderRadius: theme.spacing(3),
3006
3445
  width: '100%',
3007
- '& .MuiDataGrid-virtualScrollerContent': {
3008
- height: 'auto !important',
3009
- minHeight: '56px !important'
3446
+ color: theme.palette.mode === 'light' ? 'rgba(0,0,0,.85)' : 'rgba(255,255,255,0.85)',
3447
+ '& .MuiDataGrid-columnsContainer': {
3448
+ borderRadius: theme.spacing(3),
3449
+ border: '1px solid rgba(38, 40, 66, 0.08)'
3010
3450
  },
3011
- '& .MuiDataGrid-virtualScrollerRenderZone': {
3012
- position: 'static'
3451
+ '& .MuiDataGrid-columnHeaders': {
3452
+ minHeight: '48px !important',
3453
+ backgroundColor: '#F7F8FC',
3454
+ borderTopLeftRadius: theme.spacing(3),
3455
+ borderTopRightRadius: theme.spacing(3)
3013
3456
  },
3014
- '& .MuiDataGrid-renderingZone': {
3015
- maxHeight: 'none !important'
3457
+ '& .MuiDataGrid-columnHeader, .MuiDataGrid-cell': {
3458
+ padding: theme.spacing(2.75, 2),
3459
+ color: '#6D6E85',
3460
+ '&.Sorted': {
3461
+ color: '#262842'
3462
+ },
3463
+ '&:first-of-type': {
3464
+ paddingLeft: theme.spacing(4)
3465
+ },
3466
+ borderRight: 0,
3467
+ borderLeft: 0,
3468
+ minHeight: '48px !important'
3469
+ },
3470
+ '& .MuiDataGrid-columnsContainer, .MuiDataGrid-cell': {
3471
+ padding: theme.spacing(1, 2),
3472
+ '&:first-of-type': {
3473
+ paddingLeft: theme.spacing(4)
3474
+ }
3475
+ },
3476
+ '& .MuiDataGrid-row': {
3477
+ maxHeight: 'none !important',
3478
+ minHeight: '48px !important',
3479
+ '&:hover': {
3480
+ backgroundColor: '#F7F8FC!important'
3481
+ }
3016
3482
  },
3017
3483
  '& .MuiDataGrid-cell': {
3484
+ color: theme.palette.mode === 'light' ? 'rgba(0,0,0,.85)' : 'rgba(255,255,255,0.65)',
3485
+ '&:focus': {
3486
+ border: 0
3487
+ },
3018
3488
  maxHeight: 'none !important',
3489
+ minHeight: '48px !important',
3019
3490
  lineHeight: 'unset !important',
3020
3491
  // whiteSpace: 'normal !important',
3021
3492
  textOverflow: 'ellipsis',
@@ -3029,29 +3500,75 @@ const styles = {
3029
3500
  }
3030
3501
  }
3031
3502
  },
3032
- '& .MuiDataGrid-row': {
3503
+ '& .MuiPaginationItem-root': {
3504
+ borderRadius: 0
3505
+ },
3506
+ '& .MuiDataGrid-virtualScrollerContent': {
3507
+ height: 'auto !important',
3508
+ minHeight: '48px !important'
3509
+ },
3510
+ '& .MuiDataGrid-virtualScrollerRenderZone': {
3511
+ position: 'static'
3512
+ },
3513
+ '& .MuiDataGrid-renderingZone': {
3033
3514
  maxHeight: 'none !important'
3034
3515
  },
3516
+ '& .MuiDataGrid-cell:focus-within, & .MuiDataGrid-cell:focus': {
3517
+ outline: 'none !important'
3518
+ },
3519
+ '& .MuiDataGrid-columnHeader:focus-within, & .MuiDataGrid-columnHeader:focus': {
3520
+ outline: 'none !important'
3521
+ },
3522
+ '& .MuiTablePagination-actions': {
3523
+ display: 'none !important'
3524
+ },
3525
+ '& .MuiDataGrid-iconButtonContainer': {
3526
+ '& img': {
3527
+ visibility: 'visible !important',
3528
+ opacity: '0.5!important'
3529
+ }
3530
+ },
3035
3531
  '& .Sorted': {
3036
3532
  '& .MuiDataGrid-iconButtonContainer': {
3037
- visibility: 'visible',
3038
- width: 'auto',
3039
- '& svg': {
3040
- opacity: '1 !important'
3041
- }
3042
- },
3043
- '&.--desc': {
3044
- '& svg': {
3045
- transform: 'rotate(180deg)'
3533
+ '& img': {
3534
+ visibility: 'visible !important',
3535
+ opacity: '1!important'
3046
3536
  }
3047
3537
  }
3048
3538
  }
3049
- };
3539
+ }));
3540
+
3541
+ var img$4 = "data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M3.47341 10.4087C3.3698 10.2747 3.32108 10.1063 3.33715 9.9377C3.35321 9.76909 3.43285 9.61291 3.55989 9.50088C3.68693 9.38886 3.85185 9.3294 4.02115 9.33457C4.19045 9.33974 4.35144 9.40915 4.47141 9.52872L8.00008 13.0574L11.5287 9.52872L11.5914 9.47338C11.7254 9.36978 11.8938 9.32106 12.0624 9.33712C12.231 9.35318 12.3872 9.43282 12.4992 9.55987C12.6113 9.68691 12.6707 9.85183 12.6656 10.0211C12.6604 10.1904 12.591 10.3514 12.4714 10.4714L8.47141 14.4714L8.40874 14.5267C8.28047 14.6262 8.12031 14.6755 7.95829 14.6653C7.79627 14.6551 7.64354 14.5862 7.52874 14.4714L3.52874 10.4714L3.47341 10.4087ZM12.5267 5.59138C12.6304 5.72538 12.6791 5.89379 12.663 6.0624C12.6469 6.23102 12.5673 6.3872 12.4403 6.49922C12.3132 6.61124 12.1483 6.67071 11.979 6.66554C11.8097 6.66037 11.6487 6.59095 11.5287 6.47138L8.00008 2.94272L4.47141 6.47138L4.40874 6.52672C4.27475 6.63032 4.10634 6.67905 3.93773 6.66298C3.76911 6.64692 3.61293 6.56728 3.50091 6.44024C3.38889 6.31319 3.32942 6.14827 3.33459 5.97897C3.33976 5.80967 3.40918 5.64869 3.52874 5.52872L7.52874 1.52872L7.59141 1.47338C7.71968 1.37388 7.87985 1.3246 8.04187 1.33479C8.20388 1.34498 8.35662 1.41393 8.47141 1.52872L12.4714 5.52872L12.5267 5.59138Z' fill='%23262842'/%3e%3c/svg%3e";
3542
+ var SortIcon = img$4;
3543
+
3544
+ var img$3 = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg transform='matrix(1%2c 0%2c 0%2c 1%2c 0.05728%2c 0.935561)'%3e %3cpath d='M 3.473 9.409 C 3.37 9.275 3.321 9.106 3.337 8.938 C 3.353 8.769 3.433 8.613 3.56 8.501 C 3.687 8.389 3.852 8.329 4.021 8.335 C 4.19 8.34 4.351 8.409 4.471 8.529 L 8 12.057 L 11.529 8.529 L 11.591 8.473 C 11.725 8.37 11.894 8.321 12.062 8.337 C 12.231 8.353 12.387 8.433 12.499 8.56 C 12.611 8.687 12.671 8.852 12.666 9.021 C 12.66 9.19 12.591 9.351 12.471 9.471 L 8.471 13.471 L 8.409 13.527 C 8.28 13.626 8.12 13.676 7.958 13.665 C 7.796 13.655 7.644 13.586 7.529 13.471 L 3.529 9.471 L 3.473 9.409 Z' fill='%23262842' style='fill-opacity: 0.6%3b'/%3e %3cpath d='M 12.472 4.636 C 12.575 4.77 12.624 4.939 12.608 5.107 C 12.592 5.276 12.512 5.432 12.385 5.544 C 12.258 5.656 12.093 5.716 11.924 5.71 C 11.755 5.705 11.594 5.636 11.474 5.516 L 7.945 1.988 L 4.416 5.516 L 4.354 5.572 C 4.22 5.675 4.051 5.724 3.883 5.708 C 3.714 5.692 3.558 5.612 3.446 5.485 C 3.334 5.358 3.274 5.193 3.28 5.024 C 3.285 4.855 3.354 4.694 3.474 4.574 L 7.474 0.574 L 7.536 0.518 C 7.665 0.419 7.825 0.37 7.987 0.38 C 8.149 0.39 8.302 0.459 8.416 0.574 L 12.416 4.574 L 12.472 4.636 Z' fill='%23262842' style='fill-opacity: 1%3b'/%3e %3c/g%3e%3c/svg%3e";
3545
+ var SortAscIcon = img$3;
3546
+
3547
+ var img$2 = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg transform='matrix(1%2c 0%2c 0%2c 1%2c 0.05728%2c 0.935561)'%3e %3cpath d='M 3.473 9.409 C 3.37 9.275 3.321 9.106 3.337 8.938 C 3.353 8.769 3.433 8.613 3.56 8.501 C 3.687 8.389 3.852 8.329 4.021 8.335 C 4.19 8.34 4.351 8.409 4.471 8.529 L 8 12.057 L 11.529 8.529 L 11.591 8.473 C 11.725 8.37 11.894 8.321 12.062 8.337 C 12.231 8.353 12.387 8.433 12.499 8.56 C 12.611 8.687 12.671 8.852 12.666 9.021 C 12.66 9.19 12.591 9.351 12.471 9.471 L 8.471 13.471 L 8.409 13.527 C 8.28 13.626 8.12 13.676 7.958 13.665 C 7.796 13.655 7.644 13.586 7.529 13.471 L 3.529 9.471 L 3.473 9.409 Z' fill='%23262842' style='fill-opacity: 1%3b'/%3e %3cpath d='M 12.472 4.636 C 12.575 4.77 12.624 4.939 12.608 5.107 C 12.592 5.276 12.512 5.432 12.385 5.544 C 12.258 5.656 12.093 5.716 11.924 5.71 C 11.755 5.705 11.594 5.636 11.474 5.516 L 7.945 1.988 L 4.416 5.516 L 4.354 5.572 C 4.22 5.675 4.051 5.724 3.883 5.708 C 3.714 5.692 3.558 5.612 3.446 5.485 C 3.334 5.358 3.274 5.193 3.28 5.024 C 3.285 4.855 3.354 4.694 3.474 4.574 L 7.474 0.574 L 7.536 0.518 C 7.665 0.419 7.825 0.37 7.987 0.38 C 8.149 0.39 8.302 0.459 8.416 0.574 L 12.416 4.574 L 12.472 4.636 Z' fill='%23262842' style='fill-opacity: 0.6%3b'/%3e %3c/g%3e%3c/svg%3e";
3548
+ var SortDescIcon = img$2;
3050
3549
 
3051
3550
  /**
3052
3551
  * Main data display component. MUI DataGrid used
3053
3552
  * @category Common UI components
3054
3553
  */
3554
+ const SortIconComponent$1 = () => {
3555
+ return jsx("img", {
3556
+ src: SortIcon,
3557
+ alt: ""
3558
+ });
3559
+ };
3560
+ const SortAscIconComponent$1 = () => {
3561
+ return jsx("img", {
3562
+ src: SortAscIcon,
3563
+ alt: ""
3564
+ });
3565
+ };
3566
+ const SortDescIconComponent$1 = () => {
3567
+ return jsx("img", {
3568
+ src: SortDescIcon,
3569
+ alt: ""
3570
+ });
3571
+ };
3055
3572
  const Table = ({
3056
3573
  columns,
3057
3574
  rows,
@@ -3085,11 +3602,24 @@ const Table = ({
3085
3602
  pageSize: _mode === 'server' ? size : _pagination ? pageSize : rowCount,
3086
3603
  onPageSizeChange: _mode === 'server' ? onSizeChange : handlePageSizeChange,
3087
3604
  components: {
3088
- Pagination: TablePagination$1
3605
+ BaseTooltip: Tooltip,
3606
+ Pagination: TablePagination$1,
3607
+ ColumnUnsortedIcon: _a => {
3608
+ __rest(_a, ["sortingOrder"]);
3609
+ return jsx(SortIconComponent$1, {});
3610
+ },
3611
+ ColumnSortedDescendingIcon: _a => {
3612
+ __rest(_a, ["sortingOrder"]);
3613
+ return jsx(SortDescIconComponent$1, {});
3614
+ },
3615
+ ColumnSortedAscendingIcon: _a => {
3616
+ __rest(_a, ["sortingOrder"]);
3617
+ return jsx(SortAscIconComponent$1, {});
3618
+ }
3089
3619
  }
3090
3620
  };
3091
3621
  if (_mode === 'server') {
3092
- tableProps['sortModel'] = [];
3622
+ // tableProps['sortModel'] = [];
3093
3623
  tableProps['onColumnHeaderClick'] = onColumnHeaderClick;
3094
3624
  tableProps['page'] = page;
3095
3625
  tableProps['onPageChange'] = onPageChange;
@@ -3098,8 +3628,7 @@ const Table = ({
3098
3628
  return jsx(Box, Object.assign({
3099
3629
  mt: disableMargin ? 0 : 2
3100
3630
  }, {
3101
- children: jsx(DataGrid, Object.assign({
3102
- sx: styles,
3631
+ children: jsx(StyledDataGrid, Object.assign({
3103
3632
  autoHeight: true,
3104
3633
  hideFooterPagination: !_pagination,
3105
3634
  hideFooter: !_pagination,
@@ -3108,6 +3637,7 @@ const Table = ({
3108
3637
  showCellRightBorder: true,
3109
3638
  loading: loading,
3110
3639
  rows: rows,
3640
+ disableColumnMenu: true,
3111
3641
  columns: getSortedColumns(columns),
3112
3642
  rowCount: rowCount,
3113
3643
  rowsPerPageOptions: [10, 20, 50, 100],
@@ -3207,7 +3737,7 @@ const useTableSorting = () => {
3207
3737
  const sortParams = useMemo(() => searchParams.getAll('sort').map(param => param.split(',')), [searchParams]);
3208
3738
  const onSortChanged = useCallback(sortKey => {
3209
3739
  setSearchParams(params => {
3210
- console.log(sortKey, params.get('page'));
3740
+ // console.log(sortKey, params.get('page'));
3211
3741
  params.delete('sort');
3212
3742
  let keyFound = false;
3213
3743
  sortParams.forEach(([key, value]) => {
@@ -3238,6 +3768,33 @@ const useTableSorting = () => {
3238
3768
  };
3239
3769
  var useTableSorting$1 = useTableSorting;
3240
3770
 
3771
+ const TableSortLabel = styled(MuiTableSortLabel)(({
3772
+ active
3773
+ }) => ({
3774
+ '.MuiSvgIcon-root': {
3775
+ opacity: active ? 1 : 0.5,
3776
+ marginTop: '4%'
3777
+ }
3778
+ }));
3779
+
3780
+ const SortIconComponent = () => {
3781
+ return jsx("img", {
3782
+ src: SortIcon,
3783
+ alt: ""
3784
+ });
3785
+ };
3786
+ const SortAscIconComponent = () => {
3787
+ return jsx("img", {
3788
+ src: SortAscIcon,
3789
+ alt: ""
3790
+ });
3791
+ };
3792
+ const SortDescIconComponent = () => {
3793
+ return jsx("img", {
3794
+ src: SortDescIcon,
3795
+ alt: ""
3796
+ });
3797
+ };
3241
3798
  function TableInner({
3242
3799
  columns = [],
3243
3800
  rows = [],
@@ -3247,7 +3804,8 @@ function TableInner({
3247
3804
  loading = false,
3248
3805
  onRowClick,
3249
3806
  emptyDataText,
3250
- verticalAlign = 'middle'
3807
+ verticalAlign = 'middle',
3808
+ labelRowsPerPage
3251
3809
  }, ref) {
3252
3810
  const {
3253
3811
  page,
@@ -3259,99 +3817,130 @@ function TableInner({
3259
3817
  onSortChanged,
3260
3818
  getColumnSorting
3261
3819
  } = useTableSorting$1();
3262
- return jsxs(TableContainer, Object.assign({
3820
+ const labelDisplayedRows = ({
3821
+ from,
3822
+ to,
3823
+ count
3824
+ }) => {
3825
+ return `${from}–${to} из ${count !== -1 ? count : `более ${to}`}`;
3826
+ };
3827
+ return jsx(Box, Object.assign({
3263
3828
  sx: {
3264
- position: 'relative',
3265
- overflow: 'visible'
3829
+ overflow: 'auto'
3266
3830
  }
3267
3831
  }, {
3268
- children: [jsx(Backdrop, Object.assign({
3269
- open: loading,
3832
+ children: jsxs(TableContainer, Object.assign({
3270
3833
  sx: {
3271
- position: 'absolute',
3272
- top: 0,
3273
- left: 0
3834
+ width: '100%',
3835
+ display: 'table',
3836
+ tableLayout: 'fixed'
3274
3837
  }
3275
3838
  }, {
3276
- children: jsx(Loader, {})
3277
- })), jsxs(MuiTable, Object.assign({
3278
- ref: ref
3279
- }, {
3280
- children: [jsx(TableHead, {
3281
- children: jsx(TableRow, {
3282
- children: columns.map((column, index) => {
3283
- const sortDirection = column.sortKey ? getColumnSorting(column.sortKey) : false;
3284
- return jsx(TableCell, Object.assign({
3839
+ children: [jsx(Backdrop, Object.assign({
3840
+ open: loading,
3841
+ sx: {
3842
+ position: 'absolute',
3843
+ top: 0,
3844
+ left: 0
3845
+ }
3846
+ }, {
3847
+ children: jsx(Loader, {})
3848
+ })), jsxs(MuiTable, Object.assign({
3849
+ ref: ref
3850
+ }, {
3851
+ children: [jsx(TableHead, {
3852
+ children: jsx(TableRow, {
3853
+ children: columns.map((column, index) => {
3854
+ const sortDirection = column.sortKey ? getColumnSorting(column.sortKey) : false;
3855
+ return jsx(TableCell, Object.assign({
3856
+ align: column.align ? column.align : 'left',
3857
+ sortDirection: sortDirection,
3858
+ sx: {
3859
+ width: column.width ? `${column.width}%` : 'unset'
3860
+ }
3861
+ }, {
3862
+ children: jsx(TableSortLabel, Object.assign({
3863
+ active: !!sortDirection,
3864
+ hideSortIcon: !column.sortKey,
3865
+ direction: sortDirection || 'asc',
3866
+ IconComponent: sortDirection === 'asc' ? SortAscIconComponent : sortDirection === 'desc' ? SortDescIconComponent : SortIconComponent,
3867
+ onClick: () => column.sortKey ? onSortChanged(column.sortKey) : {}
3868
+ }, {
3869
+ children: column.label
3870
+ }))
3871
+ }), index);
3872
+ })
3873
+ })
3874
+ }), jsx(TableBody, {
3875
+ children: rows.length ? rows.map((row, index) => jsx(TableRow, Object.assign({
3876
+ hover: true,
3877
+ onClick: onRowClick ? () => onRowClick(row) : row.onClick,
3878
+ sx: {
3879
+ verticalAlign
3880
+ }
3881
+ }, {
3882
+ children: columns.map((column, idx) => jsx(TableCell, Object.assign({
3285
3883
  align: column.align ? column.align : 'left',
3286
- sortDirection: sortDirection,
3287
3884
  sx: {
3288
- width: column.width ? `${column.width}%` : 'unset'
3885
+ maxWidth: column.width ? `${column.width}%` : 'unset'
3289
3886
  }
3290
3887
  }, {
3291
- children: jsx(TableSortLabel, Object.assign({
3292
- active: !!sortDirection,
3293
- hideSortIcon: !column.sortKey,
3294
- direction: sortDirection || 'asc',
3295
- onClick: () => column.sortKey ? onSortChanged(column.sortKey) : {}
3888
+ children: jsx(Box, Object.assign({
3889
+ sx: {
3890
+ maxWidth: '90%',
3891
+ overflow: 'hidden',
3892
+ whiteSpace: 'nowrap',
3893
+ textOverflow: 'ellipsis',
3894
+ padding: ({
3895
+ spacing
3896
+ }) => spacing(2.5, 0)
3897
+ }
3296
3898
  }, {
3297
- children: column.label
3899
+ children: jsx(Box, {
3900
+ children: column.renderCell ? column.renderCell(row, index) : row[column.id]
3901
+ })
3298
3902
  }))
3299
- }), index);
3300
- })
3301
- })
3302
- }), jsx(TableBody, {
3303
- children: rows.length ? rows.map((row, index) => jsx(TableRow, Object.assign({
3304
- hover: true,
3305
- onClick: onRowClick ? () => onRowClick(row) : row.onClick,
3306
- sx: {
3307
- verticalAlign
3308
- }
3309
- }, {
3310
- children: columns.map((column, idx) => jsx(TableCell, Object.assign({
3311
- align: column.align ? column.align : 'left',
3903
+ }), idx))
3904
+ }), index)) : jsx(TableRow, Object.assign({
3312
3905
  sx: {
3313
- width: column.width ? `${column.width}%` : 'unset'
3906
+ verticalAlign
3314
3907
  }
3315
3908
  }, {
3316
- children: column.renderCell ? column.renderCell(row, index) : row[column.id]
3317
- }), idx))
3318
- }), index)) : jsx(TableRow, Object.assign({
3319
- sx: {
3320
- verticalAlign
3321
- }
3322
- }, {
3323
- children: jsx(TableCell, Object.assign({
3324
- align: "center",
3325
- colSpan: columns.length
3326
- }, {
3327
- children: emptyDataText !== null && emptyDataText !== void 0 ? emptyDataText : 'Нет данных'
3909
+ children: jsx(TableCell, Object.assign({
3910
+ align: "center",
3911
+ colSpan: columns.length
3912
+ }, {
3913
+ children: emptyDataText !== null && emptyDataText !== void 0 ? emptyDataText : 'Нет данных'
3914
+ }))
3328
3915
  }))
3329
- }))
3330
- }), pagination || children ? jsx(TableFooter, {
3331
- children: jsxs(TableRow, {
3332
- children: [children && jsx(TableCell, Object.assign({
3333
- colSpan: columns.length,
3334
- sx: {
3335
- background: '#F0F0F7',
3336
- px: 4,
3337
- py: 3
3338
- }
3339
- }, {
3340
- children: children
3341
- })), pagination && !!rows.length ? jsx(MuiTablePagination, {
3342
- rowsPerPageOptions: [5, 10, 25],
3343
- count: totalCount,
3344
- rowsPerPage: +size,
3345
- page: +page,
3346
- sx: {
3347
- borderBottom: 'none'
3348
- },
3349
- onPageChange: (_, page) => onPageChange(page),
3350
- onRowsPerPageChange: event => onSizeChange(+event.target.value)
3351
- }) : null]
3352
- })
3353
- }) : null]
3354
- }))]
3916
+ }), pagination || children ? jsx(TableFooter, {
3917
+ children: jsxs(TableRow, {
3918
+ children: [children && jsx(TableCell, Object.assign({
3919
+ colSpan: columns.length,
3920
+ sx: {
3921
+ background: '#F0F0F7',
3922
+ px: 4,
3923
+ py: 3
3924
+ }
3925
+ }, {
3926
+ children: children
3927
+ })), pagination && !!rows.length ? jsx(MuiTablePagination, {
3928
+ rowsPerPageOptions: [5, 10, 25],
3929
+ count: totalCount,
3930
+ rowsPerPage: +size,
3931
+ page: +page,
3932
+ sx: {
3933
+ borderBottom: 'none'
3934
+ },
3935
+ labelRowsPerPage: labelRowsPerPage,
3936
+ labelDisplayedRows: labelRowsPerPage ? labelDisplayedRows : undefined,
3937
+ onPageChange: (_, page) => onPageChange(page),
3938
+ onRowsPerPageChange: event => onSizeChange(+event.target.value)
3939
+ }) : null]
3940
+ })
3941
+ }) : null]
3942
+ }))]
3943
+ }))
3355
3944
  }));
3356
3945
  }
3357
3946
  const SimpleTable = /*#__PURE__*/forwardRef(TableInner);
@@ -6491,869 +7080,475 @@ const MultiplePropertyFiller = ({
6491
7080
  })) : null, fillOption === 'expression' && (propertyType === PropertyType.JSON || propertyType === PropertyType.ENTITY || propertyType === PropertyType.ANY ? jsx(ControlAceEditor, {
6492
7081
  name: name,
6493
7082
  control: control,
6494
- label: valueLabel,
6495
- parseValue: true,
6496
- hideErrorMessage: true,
6497
- useCleanValue: true,
6498
- mode: propertyType === PropertyType.ANY ? 'text' : 'json'
6499
- }) : jsx(ControlInput, {
6500
- required: true,
6501
- hideErrorMessage: true,
6502
- control: control,
6503
- name: name,
6504
- label: valueLabel
6505
- })), fillOption === 'json_valid' && jsx(ControlAceEditor, {
6506
- name: name,
6507
- control: control,
6508
- label: valueLabel,
6509
- parseValue: true,
6510
- validateJson: true,
6511
- hideErrorMessage: true
6512
- })
6513
- // <JsonEditor validate name={name} ref={ref} useParsedValue />
6514
- , fillOption === 'widget' && jsx(MultiplePropertyWidget$1, {
6515
- property: property,
6516
- name: name,
6517
- useExpression: useExpression,
6518
- required: required,
6519
- label: label,
6520
- entityReferenceDefinitionSources: entityReferenceDefinitionSources,
6521
- entityReferenceValueComponent: entityReferenceValueComponent,
6522
- fileReferenceValueComponent: fileReferenceValueComponent
6523
- }), error && jsx(FormHelperText, Object.assign({
6524
- error: true
6525
- }, {
6526
- children: error.message
6527
- }))]
6528
- });
6529
- };
6530
-
6531
- const DefinitionFiller = ({
6532
- properties,
6533
- dataFieldName,
6534
- useExpression: _useExpression = false,
6535
- title,
6536
- entityReferenceDefinitionSources,
6537
- entityReferenceValueComponent,
6538
- fileReferenceValueComponent
6539
- }) => {
6540
- const stepperData = useMemo(() => {
6541
- if (properties) {
6542
- return properties.map(property => {
6543
- var _a;
6544
- const propertyType = typeof property.propertyType === 'string' ? property.propertyType : (_a = property['propertyType']) === null || _a === void 0 ? void 0 : _a['value'];
6545
- return {
6546
- label: jsxs(Box, Object.assign({
6547
- display: "flex",
6548
- flexDirection: "column"
6549
- }, {
6550
- children: [jsxs("b", {
6551
- children: [property.name, property.isRequired ? '*' : '']
6552
- }), jsxs("span", {
6553
- children: [property.key, " | ", property.isMultiple ? 'multiple' : 'single', " |", ' ', propertyType]
6554
- })]
6555
- })),
6556
- content: property.isMultiple ? jsx(MultiplePropertyFiller, {
6557
- property: property,
6558
- name: `${dataFieldName}.${property.key}`,
6559
- useExpression: _useExpression,
6560
- label: property.name,
6561
- required: property.isRequired,
6562
- entityReferenceValueComponent: entityReferenceValueComponent,
6563
- fileReferenceValueComponent: fileReferenceValueComponent,
6564
- entityReferenceDefinitionSources: entityReferenceDefinitionSources
6565
- }) : jsx(PropertyFiller, {
6566
- property: property,
6567
- name: `${dataFieldName}.${property.key}`,
6568
- useExpression: _useExpression,
6569
- label: property.name,
6570
- required: property.isRequired,
6571
- entityReferenceDefinitionSources: entityReferenceDefinitionSources,
6572
- entityReferenceValueComponent: entityReferenceValueComponent,
6573
- fileReferenceValueComponent: fileReferenceValueComponent
6574
- })
6575
- };
6576
- });
6577
- }
6578
- return [];
6579
- }, [properties, dataFieldName, _useExpression, entityReferenceValueComponent, entityReferenceDefinitionSources, fileReferenceValueComponent]);
6580
- return jsx(LocalizationProvider, Object.assign({
6581
- dateAdapter: AdapterDateFns
6582
- }, {
6583
- children: jsxs(Grid, Object.assign({
6584
- container: true,
6585
- direction: "column",
6586
- spacing: 2
6587
- }, {
6588
- children: [title && jsx(Grid, Object.assign({
6589
- xs: 12
6590
- }, {
6591
- children: jsx("div", Object.assign({
6592
- style: {
6593
- fontWeight: '600'
6594
- }
6595
- }, {
6596
- children: title
6597
- }))
6598
- })), jsx(StepperView, {
6599
- data: stepperData
6600
- })]
6601
- }))
6602
- }));
6603
- };
6604
-
6605
- const FileDefinitionValueView = ({
6606
- property,
6607
- data
6608
- }) => {
6609
- const {
6610
- name
6611
- } = property;
6612
- const downloadFile = useCallback((contentBase64, fileName) => {
6613
- const linkSource = contentBase64;
6614
- const downloadLink = document.createElement('a');
6615
- document.body.appendChild(downloadLink);
6616
- downloadLink.href = linkSource;
6617
- downloadLink.target = '_self';
6618
- downloadLink.download = fileName;
6619
- downloadLink.click();
6620
- }, []);
6621
- return jsx(Button, Object.assign({
6622
- component: "label",
6623
- variant: "contained",
6624
- size: "large",
6625
- color: "primary",
6626
- onClick: () => downloadFile(data, name)
6627
- }, {
6628
- children: "Download File"
6629
- }));
6630
- };
6631
- var FileDefinitionValueView$1 = FileDefinitionValueView;
6632
-
6633
- const PropertyValueComponent = ({
6634
- property,
6635
- data,
6636
- properties
6637
- }) => {
6638
- const defaultRender = value => jsx(Box, Object.assign({
6639
- style: {
6640
- backgroundColor: '#fff',
6641
- border: '1px solid #ccc',
6642
- borderRadius: '4px',
6643
- padding: '4px',
6644
- overflow: 'hidden',
6645
- whiteSpace: 'nowrap',
6646
- textOverflow: 'ellipsis'
6647
- }
6648
- }, {
6649
- children: value === null ? 'null' : value.toString()
6650
- }));
6651
- switch (property.propertyType) {
6652
- case PropertyType.JSON:
6653
- return jsx(JsonView, {
6654
- value: data
6655
- });
6656
- case PropertyType.ENTITY:
6657
- return jsx(DefinitionValueView, {
6658
- properties: properties,
6659
- data: data
6660
- });
6661
- case PropertyType.ANY:
6662
- // TODO need to prefetch data and show as is
6663
- return typeof data === 'object' ? jsx(JsonView, {
6664
- value: data
6665
- }) : defaultRender(data);
6666
- case PropertyType.FILE_REFERENCE:
6667
- return data === null ? defaultRender(data) : jsx(Button, Object.assign({
6668
- component: Link,
6669
- color: "primary",
6670
- variant: "contained",
6671
- target: "_blank",
6672
- to: data,
6673
- sx: {
6674
- marginTop: 4
6675
- }
6676
- }, {
6677
- children: "Download via link"
6678
- }));
6679
- case PropertyType.FILE:
6680
- return data === null ? defaultRender(data) : jsx(FileDefinitionValueView$1, {
6681
- data: data,
6682
- property: property
6683
- });
6684
- default:
6685
- return defaultRender(data);
6686
- }
6687
- };
6688
- const PropertyDataView = ({
6689
- property,
6690
- data,
6691
- hasBackground: _hasBackground = false
6692
- }) => {
6693
- const properties = useMemo(() => {
6694
- if (property.propertyType === PropertyType.ENTITY) {
6695
- if (Array.isArray(property.properties)) {
6696
- return property.properties;
6697
- }
6698
- return propertiesObjectToArray(property.properties);
6699
- }
6700
- return [];
6701
- }, [property]);
6702
- return jsx(Box, Object.assign({
6703
- style: {
6704
- backgroundColor: _hasBackground ? '#f1f1f1' : 'none'
6705
- }
6706
- }, {
6707
- children: jsx(PropertyValueComponent, {
6708
- property: property,
6709
- data: data,
6710
- properties: properties
7083
+ label: valueLabel,
7084
+ parseValue: true,
7085
+ hideErrorMessage: true,
7086
+ useCleanValue: true,
7087
+ mode: propertyType === PropertyType.ANY ? 'text' : 'json'
7088
+ }) : jsx(ControlInput, {
7089
+ required: true,
7090
+ hideErrorMessage: true,
7091
+ control: control,
7092
+ name: name,
7093
+ label: valueLabel
7094
+ })), fillOption === 'json_valid' && jsx(ControlAceEditor, {
7095
+ name: name,
7096
+ control: control,
7097
+ label: valueLabel,
7098
+ parseValue: true,
7099
+ validateJson: true,
7100
+ hideErrorMessage: true
6711
7101
  })
6712
- }));
7102
+ // <JsonEditor validate name={name} ref={ref} useParsedValue />
7103
+ , fillOption === 'widget' && jsx(MultiplePropertyWidget$1, {
7104
+ property: property,
7105
+ name: name,
7106
+ useExpression: useExpression,
7107
+ required: required,
7108
+ label: label,
7109
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
7110
+ entityReferenceValueComponent: entityReferenceValueComponent,
7111
+ fileReferenceValueComponent: fileReferenceValueComponent
7112
+ }), error && jsx(FormHelperText, Object.assign({
7113
+ error: true
7114
+ }, {
7115
+ children: error.message
7116
+ }))]
7117
+ });
6713
7118
  };
6714
- var PropertyDataView$1 = PropertyDataView;
6715
7119
 
6716
- const DefinitionValueView = ({
7120
+ const DefinitionFiller = ({
6717
7121
  properties,
6718
- data
7122
+ dataFieldName,
7123
+ useExpression: _useExpression = false,
7124
+ title,
7125
+ entityReferenceDefinitionSources,
7126
+ entityReferenceValueComponent,
7127
+ fileReferenceValueComponent
6719
7128
  }) => {
6720
7129
  const stepperData = useMemo(() => {
6721
- if (properties && data) {
7130
+ if (properties) {
6722
7131
  return properties.map(property => {
6723
- const {
6724
- key,
6725
- name,
6726
- isMultiple,
6727
- propertyType
6728
- } = property;
6729
- const value = data[property.key] ? data[property.key] : null;
7132
+ var _a;
7133
+ const propertyType = typeof property.propertyType === 'string' ? property.propertyType : (_a = property['propertyType']) === null || _a === void 0 ? void 0 : _a['value'];
6730
7134
  return {
6731
7135
  label: jsxs(Box, Object.assign({
6732
7136
  display: "flex",
6733
7137
  flexDirection: "column"
6734
7138
  }, {
6735
- children: [jsx("b", {
6736
- children: name
7139
+ children: [jsxs("b", {
7140
+ children: [property.name, property.isRequired ? '*' : '']
6737
7141
  }), jsxs("span", {
6738
- children: [key, " | ", isMultiple ? 'multiple' : 'single', " | ", propertyType]
7142
+ children: [property.key, " | ", property.isMultiple ? 'multiple' : 'single', " |", ' ', propertyType]
6739
7143
  })]
6740
7144
  })),
6741
- content: isMultiple && Array.isArray(value) && property.propertyType !== PropertyType.ANY ? jsx(Fragment, {
6742
- children: value.map((itemValue, index) => jsx(Box, Object.assign({
6743
- mb: 2
6744
- }, {
6745
- children: jsx(PropertyDataView$1, {
6746
- property: property,
6747
- data: itemValue,
6748
- hasBackground: true
6749
- })
6750
- }), index))
6751
- }) : jsx(PropertyDataView$1, {
7145
+ content: property.isMultiple ? jsx(MultiplePropertyFiller, {
6752
7146
  property: property,
6753
- data: value
7147
+ name: `${dataFieldName}.${property.key}`,
7148
+ useExpression: _useExpression,
7149
+ label: property.name,
7150
+ required: property.isRequired,
7151
+ entityReferenceValueComponent: entityReferenceValueComponent,
7152
+ fileReferenceValueComponent: fileReferenceValueComponent,
7153
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources
7154
+ }) : jsx(PropertyFiller, {
7155
+ property: property,
7156
+ name: `${dataFieldName}.${property.key}`,
7157
+ useExpression: _useExpression,
7158
+ label: property.name,
7159
+ required: property.isRequired,
7160
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
7161
+ entityReferenceValueComponent: entityReferenceValueComponent,
7162
+ fileReferenceValueComponent: fileReferenceValueComponent
6754
7163
  })
6755
7164
  };
6756
7165
  });
6757
7166
  }
6758
7167
  return [];
6759
- }, [properties, data]);
6760
- return jsx(Grid, Object.assign({
6761
- container: true,
6762
- direction: "column",
6763
- spacing: 2
6764
- }, {
6765
- children: jsx(StepperView, {
6766
- data: stepperData
6767
- })
6768
- }));
6769
- };
6770
-
6771
- const StyledBox = styled(Box)(({
6772
- theme
6773
- }) => ({
6774
- backgroundColor: '#eee',
6775
- fontSize: '14px',
6776
- padding: '0 8px',
6777
- borderRadius: '10px',
6778
- width: 'fit-content',
6779
- '&.success': {
6780
- backgroundColor: '#a9dfa9'
6781
- },
6782
- '&.error': {
6783
- backgroundColor: '#ff7e7e'
6784
- },
6785
- '&.warning': {
6786
- backgroundColor: theme.palette.warning.main
6787
- }
6788
- }));
6789
- const Status = ({
6790
- text,
6791
- status: _status = 'default'
6792
- }) => {
6793
- return jsx(StyledBox, Object.assign({
6794
- className: classnames('root', {
6795
- [_status]: true
6796
- })
6797
- }, {
6798
- children: text
6799
- }));
6800
- };
6801
-
6802
- const PropertyStep = ({
6803
- properties,
6804
- parentKey: _parentKey = '',
6805
- activePath: _activePath = '',
6806
- prefix: _prefix = '',
6807
- onClick
6808
- }) => {
6809
- const handleClick = path => {
6810
- if (_prefix) {
6811
- onClick(`${_prefix}.${path}`);
6812
- } else {
6813
- onClick(path);
6814
- }
6815
- };
6816
- return jsx(Stepper, Object.assign({
6817
- orientation: "vertical",
6818
- onClick: event => event.stopPropagation()
6819
- }, {
6820
- children: properties && properties.map(property => {
6821
- var _a;
6822
- const fullPropertyPath = _parentKey ? `${_parentKey}.${property.key}` : property.key;
6823
- const propertyType = (_a = property.propertyType['value']) !== null && _a !== void 0 ? _a : property.propertyType;
6824
- return jsxs(Step, Object.assign({
6825
- expanded: true,
6826
- onClick: () => handleClick(fullPropertyPath)
6827
- }, {
6828
- children: [jsx(StepLabel, Object.assign({
6829
- StepIconProps: {
6830
- icon: '',
6831
- completed: false,
6832
- active: _activePath === fullPropertyPath
6833
- }
6834
- }, {
6835
- children: jsxs(Box, Object.assign({
6836
- sx: {
6837
- propertyStepLabel: {
6838
- '&:hover': {
6839
- fontWeight: '600',
6840
- cursor: 'pointer'
6841
- }
6842
- }
6843
- }
6844
- }, {
6845
- children: [property.name, " - ", property.key, " - ", propertyType]
6846
- }))
6847
- })), jsx(StepContent, {
6848
- children: jsx("div", {
6849
- children: propertyType === PropertyType.ENTITY && jsx(PropertyStep, {
6850
- onClick: onClick,
6851
- activePath: _activePath,
6852
- properties: property.properties,
6853
- parentKey: fullPropertyPath
6854
- }, property.key)
6855
- })
6856
- })]
6857
- }), property.key);
6858
- })
6859
- }));
6860
- };
6861
- var PropertyStep$1 = PropertyStep;
6862
-
6863
- const JsonPathPicker = ({
6864
- open: _open = false,
6865
- onClose,
6866
- onPaste,
6867
- properties
6868
- }) => {
6869
- const [selectedPropertyPath, setSelectedPropertyPath] = useState('');
6870
- const onCopy = () => {
6871
- navigator.clipboard.writeText(`$(${selectedPropertyPath})`);
6872
- toast.success('Copied!');
6873
- };
6874
- const handlePaste = () => {
6875
- onPaste(`$(${selectedPropertyPath})`);
6876
- toast.success('Pasted!');
6877
- };
6878
- return jsxs(Dialog, Object.assign({
6879
- open: _open,
6880
- onClose: onClose,
6881
- fullWidth: true,
6882
- maxWidth: "md"
6883
- }, {
6884
- children: [jsx(DialogTitle, {
6885
- children: "JSON path picker"
6886
- }), jsxs(DialogContent, {
6887
- children: [(properties === null || properties === void 0 ? void 0 : properties.length) ? properties.map((propEl, index) => jsxs("div", {
6888
- children: [jsx(Typography, Object.assign({
6889
- variant: "h6"
6890
- }, {
6891
- children: propEl.title
6892
- })), jsx(PropertyStep$1, {
6893
- properties: propEl.properties,
6894
- prefix: propEl.pathPrefix,
6895
- onClick: setSelectedPropertyPath,
6896
- activePath: selectedPropertyPath
6897
- })]
6898
- }, index)) : jsx(Typography, {
6899
- children: "Please, add properties"
6900
- }), selectedPropertyPath && jsxs(Typography, Object.assign({
6901
- variant: "h6",
6902
- gutterBottom: true
6903
- }, {
6904
- children: ["Selected path : $(", selectedPropertyPath, ")"]
6905
- }))]
6906
- }), jsxs(DialogActions, {
6907
- children: [jsx(Button, Object.assign({
6908
- variant: "contained",
6909
- color: "primary",
6910
- onClick: onCopy
6911
- }, {
6912
- children: "Copy"
6913
- })), jsx(Button, Object.assign({
6914
- variant: "contained",
6915
- color: "primary",
6916
- onClick: handlePaste
6917
- }, {
6918
- children: "Paste"
6919
- })), jsx(Button, Object.assign({
6920
- variant: "contained",
6921
- color: "secondary",
6922
- onClick: onClose
7168
+ }, [properties, dataFieldName, _useExpression, entityReferenceValueComponent, entityReferenceDefinitionSources, fileReferenceValueComponent]);
7169
+ return jsx(LocalizationProvider, Object.assign({
7170
+ dateAdapter: AdapterDateFns
7171
+ }, {
7172
+ children: jsxs(Grid, Object.assign({
7173
+ container: true,
7174
+ direction: "column",
7175
+ spacing: 2
7176
+ }, {
7177
+ children: [title && jsx(Grid, Object.assign({
7178
+ xs: 12
6923
7179
  }, {
6924
- children: "Close"
6925
- }))]
6926
- })]
7180
+ children: jsx("div", Object.assign({
7181
+ style: {
7182
+ fontWeight: '600'
7183
+ }
7184
+ }, {
7185
+ children: title
7186
+ }))
7187
+ })), jsx(StepperView, {
7188
+ data: stepperData
7189
+ })]
7190
+ }))
6927
7191
  }));
6928
7192
  };
6929
7193
 
6930
- const SidebarContext = /*#__PURE__*/createContext({
6931
- collapsed: false,
6932
- toggleCollapse: () => {
6933
- console.log('collapse toggle');
6934
- }
6935
- });
6936
- const useSidebarContext = () => useContext(SidebarContext);
6937
- const SidebarContextProvider = ({
6938
- children
7194
+ const FileDefinitionValueView = ({
7195
+ property,
7196
+ data
6939
7197
  }) => {
6940
- const [collapsed, setCollapsed] = useState(localStorage.getItem('sidebar_collapsed') === 'true');
6941
- const toggleCollapse = useCallback(() => {
6942
- setCollapsed(!collapsed);
6943
- localStorage.setItem('sidebar_collapsed', `${!collapsed}`);
6944
- window.dispatchEvent(new CustomEvent('sidebar_collapsed', {
6945
- detail: {
6946
- collapsed: !collapsed
6947
- }
6948
- }));
6949
- }, [collapsed]);
6950
- const toggleRootElementLink = useCallback((name, isCollapsed) => {
6951
- localStorage.setItem(`${name.toLowerCase()}_collapsed`, `${!isCollapsed}`);
7198
+ const {
7199
+ name
7200
+ } = property;
7201
+ const downloadFile = useCallback((contentBase64, fileName) => {
7202
+ const linkSource = contentBase64;
7203
+ const downloadLink = document.createElement('a');
7204
+ document.body.appendChild(downloadLink);
7205
+ downloadLink.href = linkSource;
7206
+ downloadLink.target = '_self';
7207
+ downloadLink.download = fileName;
7208
+ downloadLink.click();
6952
7209
  }, []);
6953
- return jsx(SidebarContext.Provider, Object.assign({
6954
- value: {
6955
- collapsed,
6956
- toggleCollapse,
6957
- toggleRootElementLink
6958
- }
7210
+ return jsx(Button, Object.assign({
7211
+ component: "label",
7212
+ variant: "contained",
7213
+ size: "large",
7214
+ color: "primary",
7215
+ onClick: () => downloadFile(data, name)
6959
7216
  }, {
6960
- children: children
7217
+ children: "Download File"
6961
7218
  }));
6962
7219
  };
7220
+ var FileDefinitionValueView$1 = FileDefinitionValueView;
6963
7221
 
6964
- const baseThemeOptions = {
6965
- spacing: 4,
6966
- palette: {
6967
- primary: {
6968
- main: '#E0613A',
6969
- dark: '#d9512e',
6970
- light: '#E0613A'
6971
- },
6972
- secondary: {
6973
- main: '#007994',
6974
- dark: '#262842',
6975
- light: '#cbe8ee'
6976
- },
6977
- text: {
6978
- disabled: '#A9A9B8'
6979
- },
6980
- success: {
6981
- main: '#2DB77B',
6982
- light: '#DBFCEE'
6983
- },
6984
- grey: {
6985
- 700: '#101F2B'
6986
- }
6987
- },
6988
- typography: {
6989
- fontSize: 14,
6990
- allVariants: {
6991
- fontFamily: ['Euclid', '-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'].join(',')
6992
- },
6993
- h1: {
6994
- fontWeight: 400
6995
- },
6996
- h3: {
6997
- fontWeight: 500
6998
- },
6999
- h4: {
7000
- fontWeight: 500
7222
+ const PropertyValueComponent = ({
7223
+ property,
7224
+ data,
7225
+ properties
7226
+ }) => {
7227
+ const defaultRender = value => jsx(Box, Object.assign({
7228
+ style: {
7229
+ backgroundColor: '#fff',
7230
+ border: '1px solid #ccc',
7231
+ borderRadius: '4px',
7232
+ padding: '4px',
7233
+ overflow: 'hidden',
7234
+ whiteSpace: 'nowrap',
7235
+ textOverflow: 'ellipsis'
7001
7236
  }
7002
- }
7003
- };
7004
- var baseTheme = createTheme(baseThemeOptions);
7005
-
7006
- const inputThemeOptions = {
7007
- components: {
7008
- MuiButton: {
7009
- styleOverrides: {
7010
- root: {
7011
- lineHeight: 1.429
7012
- }
7013
- }
7014
- },
7015
- MuiInputBase: {
7016
- styleOverrides: {
7017
- root: {
7018
- borderRadius: baseTheme.spacing(3),
7019
- minWidth: baseTheme.spacing(25),
7020
- background: baseTheme.palette.background.default
7021
- // height: 40
7022
- },
7023
-
7024
- // sizeSmall: {
7025
- // padding: baseTheme.spacing(1, 0, 1, 4),
7026
- // },
7027
- input: {
7028
- minWidth: baseTheme.spacing(25)
7029
- // padding: 0,
7030
- // height: '32px',
7031
- }
7032
- }
7033
- },
7034
-
7035
- MuiSelect: {
7036
- styleOverrides: {
7037
- nativeInput: {
7038
- padding: 0,
7039
- height: '32px'
7040
- }
7041
- }
7042
- },
7043
- MuiTextField: {
7044
- styleOverrides: {
7045
- root: {
7046
- minWidth: baseTheme.spacing(25)
7047
- }
7048
- }
7049
- },
7050
- MuiInputLabel: {
7051
- styleOverrides: {
7052
- root: {
7053
- position: 'relative',
7054
- overflow: 'initial',
7055
- transform: 'none',
7056
- marginBottom: baseTheme.spacing(1),
7057
- fontWeight: 500,
7058
- fontSize: '14px',
7059
- lineHeight: '20px',
7060
- pointerEvents: 'auto'
7061
- }
7062
- }
7063
- },
7064
- MuiOutlinedInput: {
7065
- styleOverrides: {
7066
- root: {
7067
- borderRadius: baseTheme.spacing(3),
7068
- minWidth: baseTheme.spacing(25)
7069
- },
7070
- notchedOutline: {
7071
- top: 0,
7072
- '& legend': {
7073
- display: 'none',
7074
- transition: 'none'
7075
- }
7076
- }
7077
- }
7078
- },
7079
- MuiAutocomplete: {
7080
- styleOverrides: {
7081
- paper: {
7082
- marginTop: 8,
7083
- borderRadius: 12,
7084
- boxShadow: '0px 8px 16px rgba(0, 0, 0, 0.04)'
7085
- },
7086
- listbox: {
7087
- '::-webkit-scrollbar': {
7088
- width: '6px',
7089
- backgroundColor: 'white'
7090
- },
7091
- '::-webkit-scrollbar-thumb': {
7092
- borderRadius: '10px',
7093
- backgroundColor: 'rgba(38, 40, 66, 0.24)'
7094
- }
7095
- }
7096
- }
7097
- },
7098
- MuiMenu: {
7099
- styleOverrides: {
7100
- list: {
7101
- paddingTop: 0,
7102
- paddingBottom: 0,
7103
- background: 'white',
7104
- '& li.Mui-selected': {
7105
- background: 'rgba(38, 40, 66, 0.08) !important'
7106
- }
7107
- }
7108
- }
7109
- },
7110
- MuiPopover: {
7111
- styleOverrides: {
7112
- paper: {
7113
- marginTop: 8,
7114
- borderRadius: 12,
7115
- boxShadow: '0px 8px 16px rgba(0, 0, 0, 0.04)'
7116
- }
7117
- }
7118
- },
7119
- MuiFormLabel: {
7120
- styleOverrides: {
7121
- root: {
7122
- fontSize: 14,
7123
- fontWeight: 500
7124
- },
7125
- asterisk: {
7126
- color: '#D6331F',
7127
- '&$error': {
7128
- color: '#D6331F'
7129
- }
7237
+ }, {
7238
+ children: value === null ? 'null' : value.toString()
7239
+ }));
7240
+ switch (property.propertyType) {
7241
+ case PropertyType.JSON:
7242
+ return jsx(JsonView, {
7243
+ value: data
7244
+ });
7245
+ case PropertyType.ENTITY:
7246
+ return jsx(DefinitionValueView, {
7247
+ properties: properties,
7248
+ data: data
7249
+ });
7250
+ case PropertyType.ANY:
7251
+ // TODO need to prefetch data and show as is
7252
+ return typeof data === 'object' ? jsx(JsonView, {
7253
+ value: data
7254
+ }) : defaultRender(data);
7255
+ case PropertyType.FILE_REFERENCE:
7256
+ return data === null ? defaultRender(data) : jsx(Button, Object.assign({
7257
+ component: Link,
7258
+ color: "primary",
7259
+ variant: "contained",
7260
+ target: "_blank",
7261
+ to: data,
7262
+ sx: {
7263
+ marginTop: 4
7130
7264
  }
7265
+ }, {
7266
+ children: "Download via link"
7267
+ }));
7268
+ case PropertyType.FILE:
7269
+ return data === null ? defaultRender(data) : jsx(FileDefinitionValueView$1, {
7270
+ data: data,
7271
+ property: property
7272
+ });
7273
+ default:
7274
+ return defaultRender(data);
7275
+ }
7276
+ };
7277
+ const PropertyDataView = ({
7278
+ property,
7279
+ data,
7280
+ hasBackground: _hasBackground = false
7281
+ }) => {
7282
+ const properties = useMemo(() => {
7283
+ if (property.propertyType === PropertyType.ENTITY) {
7284
+ if (Array.isArray(property.properties)) {
7285
+ return property.properties;
7131
7286
  }
7287
+ return propertiesObjectToArray(property.properties);
7132
7288
  }
7133
- }
7289
+ return [];
7290
+ }, [property]);
7291
+ return jsx(Box, Object.assign({
7292
+ style: {
7293
+ backgroundColor: _hasBackground ? '#f1f1f1' : 'none'
7294
+ }
7295
+ }, {
7296
+ children: jsx(PropertyValueComponent, {
7297
+ property: property,
7298
+ data: data,
7299
+ properties: properties
7300
+ })
7301
+ }));
7134
7302
  };
7135
- var inputThemeOptions$1 = inputThemeOptions;
7303
+ var PropertyDataView$1 = PropertyDataView;
7136
7304
 
7137
- const tableThemeOptions = {
7138
- components: {
7139
- MuiTableContainer: {
7140
- styleOverrides: {
7141
- root: {
7142
- borderRadius: baseTheme.spacing(3),
7143
- border: '1px solid rgba(38, 40, 66, 0.08)'
7144
- }
7145
- }
7146
- },
7147
- MuiTableHead: {
7148
- styleOverrides: {
7149
- root: {
7150
- backgroundColor: '#F7F8FC'
7151
- }
7152
- }
7153
- },
7154
- MuiTableCell: {
7155
- styleOverrides: {
7156
- root: {
7157
- minHeight: 48,
7158
- padding: baseTheme.spacing(1, 2),
7159
- '&:first-of-type': {
7160
- paddingLeft: baseTheme.spacing(4)
7161
- }
7162
- },
7163
- head: {
7164
- maxHeight: '40px',
7165
- padding: baseTheme.spacing(2.75, 2),
7166
- color: '#6D6E85'
7167
- },
7168
- body: {
7169
- wordBreak: 'break-all'
7170
- }
7171
- }
7172
- },
7173
- MuiTableSortLabel: {
7174
- styleOverrides: {
7175
- root: {
7176
- maxHeight: '24px',
7177
- lineHeight: 1
7178
- }
7179
- }
7305
+ const DefinitionValueView = ({
7306
+ properties,
7307
+ data
7308
+ }) => {
7309
+ const stepperData = useMemo(() => {
7310
+ if (properties && data) {
7311
+ return properties.map(property => {
7312
+ const {
7313
+ key,
7314
+ name,
7315
+ isMultiple,
7316
+ propertyType
7317
+ } = property;
7318
+ const value = data[property.key] ? data[property.key] : null;
7319
+ return {
7320
+ label: jsxs(Box, Object.assign({
7321
+ display: "flex",
7322
+ flexDirection: "column"
7323
+ }, {
7324
+ children: [jsx("b", {
7325
+ children: name
7326
+ }), jsxs("span", {
7327
+ children: [key, " | ", isMultiple ? 'multiple' : 'single', " | ", propertyType]
7328
+ })]
7329
+ })),
7330
+ content: isMultiple && Array.isArray(value) && property.propertyType !== PropertyType.ANY ? jsx(Fragment, {
7331
+ children: value.map((itemValue, index) => jsx(Box, Object.assign({
7332
+ mb: 2
7333
+ }, {
7334
+ children: jsx(PropertyDataView$1, {
7335
+ property: property,
7336
+ data: itemValue,
7337
+ hasBackground: true
7338
+ })
7339
+ }), index))
7340
+ }) : jsx(PropertyDataView$1, {
7341
+ property: property,
7342
+ data: value
7343
+ })
7344
+ };
7345
+ });
7180
7346
  }
7347
+ return [];
7348
+ }, [properties, data]);
7349
+ return jsx(Grid, Object.assign({
7350
+ container: true,
7351
+ direction: "column",
7352
+ spacing: 2
7353
+ }, {
7354
+ children: jsx(StepperView, {
7355
+ data: stepperData
7356
+ })
7357
+ }));
7358
+ };
7359
+
7360
+ const StyledBox = styled(Box)(({
7361
+ theme
7362
+ }) => ({
7363
+ backgroundColor: '#eee',
7364
+ fontSize: '14px',
7365
+ padding: '0 8px',
7366
+ borderRadius: '10px',
7367
+ width: 'fit-content',
7368
+ '&.success': {
7369
+ backgroundColor: '#a9dfa9'
7370
+ },
7371
+ '&.error': {
7372
+ backgroundColor: '#ff7e7e'
7373
+ },
7374
+ '&.warning': {
7375
+ backgroundColor: theme.palette.warning.main
7181
7376
  }
7377
+ }));
7378
+ const Status = ({
7379
+ text,
7380
+ status: _status = 'default'
7381
+ }) => {
7382
+ return jsx(StyledBox, Object.assign({
7383
+ className: classnames('root', {
7384
+ [_status]: true
7385
+ })
7386
+ }, {
7387
+ children: text
7388
+ }));
7182
7389
  };
7183
- var tableThemeOptions$1 = tableThemeOptions;
7184
7390
 
7185
- const stepperThemeOptions = {
7186
- components: {
7187
- MuiStepIcon: {
7188
- styleOverrides: {
7189
- root: {
7190
- fontSize: '20px',
7191
- color: baseTheme.palette.text.disabled,
7192
- '&.Mui-active, &.Mui-completed': {
7193
- color: baseTheme.palette.secondary.main
7194
- }
7195
- }
7196
- }
7391
+ const PropertyStep = ({
7392
+ properties,
7393
+ parentKey: _parentKey = '',
7394
+ activePath: _activePath = '',
7395
+ prefix: _prefix = '',
7396
+ onClick
7397
+ }) => {
7398
+ const handleClick = path => {
7399
+ if (_prefix) {
7400
+ onClick(`${_prefix}.${path}`);
7401
+ } else {
7402
+ onClick(path);
7197
7403
  }
7198
- }
7404
+ };
7405
+ return jsx(Stepper, Object.assign({
7406
+ orientation: "vertical",
7407
+ onClick: event => event.stopPropagation()
7408
+ }, {
7409
+ children: properties && properties.map(property => {
7410
+ var _a;
7411
+ const fullPropertyPath = _parentKey ? `${_parentKey}.${property.key}` : property.key;
7412
+ const propertyType = (_a = property.propertyType['value']) !== null && _a !== void 0 ? _a : property.propertyType;
7413
+ return jsxs(Step, Object.assign({
7414
+ expanded: true,
7415
+ onClick: () => handleClick(fullPropertyPath)
7416
+ }, {
7417
+ children: [jsx(StepLabel, Object.assign({
7418
+ StepIconProps: {
7419
+ icon: '',
7420
+ completed: false,
7421
+ active: _activePath === fullPropertyPath
7422
+ }
7423
+ }, {
7424
+ children: jsxs(Box, Object.assign({
7425
+ sx: {
7426
+ propertyStepLabel: {
7427
+ '&:hover': {
7428
+ fontWeight: '600',
7429
+ cursor: 'pointer'
7430
+ }
7431
+ }
7432
+ }
7433
+ }, {
7434
+ children: [property.name, " - ", property.key, " - ", propertyType]
7435
+ }))
7436
+ })), jsx(StepContent, {
7437
+ children: jsx("div", {
7438
+ children: propertyType === PropertyType.ENTITY && jsx(PropertyStep, {
7439
+ onClick: onClick,
7440
+ activePath: _activePath,
7441
+ properties: property.properties,
7442
+ parentKey: fullPropertyPath
7443
+ }, property.key)
7444
+ })
7445
+ })]
7446
+ }), property.key);
7447
+ })
7448
+ }));
7199
7449
  };
7200
- var stepperThemeOptions$1 = stepperThemeOptions;
7450
+ var PropertyStep$1 = PropertyStep;
7201
7451
 
7202
- const typographyThemeOptions = {
7203
- components: {
7204
- MuiTypography: {
7205
- styleOverrides: {
7206
- h1: {
7207
- [baseTheme.breakpoints.up('lg')]: {
7208
- fontSize: '1.5rem'
7209
- }
7210
- },
7211
- h3: {
7212
- fontSize: '1.25rem',
7213
- [baseTheme.breakpoints.up('lg')]: {
7214
- fontSize: '1.125rem'
7215
- }
7216
- },
7217
- h4: {
7218
- fontSize: '1rem',
7219
- [baseTheme.breakpoints.up('lg')]: {
7220
- fontSize: '1rem'
7221
- }
7222
- },
7223
- subtitle2: {
7224
- color: '#6D6E85'
7225
- }
7226
- }
7227
- }
7228
- }
7452
+ const JsonPathPicker = ({
7453
+ open: _open = false,
7454
+ onClose,
7455
+ onPaste,
7456
+ properties
7457
+ }) => {
7458
+ const [selectedPropertyPath, setSelectedPropertyPath] = useState('');
7459
+ const onCopy = () => {
7460
+ navigator.clipboard.writeText(`$(${selectedPropertyPath})`);
7461
+ toast.success('Copied!');
7462
+ };
7463
+ const handlePaste = () => {
7464
+ onPaste(`$(${selectedPropertyPath})`);
7465
+ toast.success('Pasted!');
7466
+ };
7467
+ return jsxs(Dialog, Object.assign({
7468
+ open: _open,
7469
+ onClose: onClose,
7470
+ fullWidth: true,
7471
+ maxWidth: "md"
7472
+ }, {
7473
+ children: [jsx(DialogTitle, {
7474
+ children: "JSON path picker"
7475
+ }), jsxs(DialogContent, {
7476
+ children: [(properties === null || properties === void 0 ? void 0 : properties.length) ? properties.map((propEl, index) => jsxs("div", {
7477
+ children: [jsx(Typography, Object.assign({
7478
+ variant: "h6"
7479
+ }, {
7480
+ children: propEl.title
7481
+ })), jsx(PropertyStep$1, {
7482
+ properties: propEl.properties,
7483
+ prefix: propEl.pathPrefix,
7484
+ onClick: setSelectedPropertyPath,
7485
+ activePath: selectedPropertyPath
7486
+ })]
7487
+ }, index)) : jsx(Typography, {
7488
+ children: "Please, add properties"
7489
+ }), selectedPropertyPath && jsxs(Typography, Object.assign({
7490
+ variant: "h6",
7491
+ gutterBottom: true
7492
+ }, {
7493
+ children: ["Selected path : $(", selectedPropertyPath, ")"]
7494
+ }))]
7495
+ }), jsxs(DialogActions, {
7496
+ children: [jsx(Button, Object.assign({
7497
+ variant: "contained",
7498
+ color: "primary",
7499
+ onClick: onCopy
7500
+ }, {
7501
+ children: "Copy"
7502
+ })), jsx(Button, Object.assign({
7503
+ variant: "contained",
7504
+ color: "primary",
7505
+ onClick: handlePaste
7506
+ }, {
7507
+ children: "Paste"
7508
+ })), jsx(Button, Object.assign({
7509
+ variant: "contained",
7510
+ color: "secondary",
7511
+ onClick: onClose
7512
+ }, {
7513
+ children: "Close"
7514
+ }))]
7515
+ })]
7516
+ }));
7229
7517
  };
7230
- var typographyThemeOptions$1 = typographyThemeOptions;
7231
7518
 
7232
- const arsenalTheme = () => {
7233
- if (document) {
7234
- const url = "https://dev-qa-arsenal-frontend-fonts-bucket.s3.eu-north-1.amazonaws.com/fonts.css";
7235
- const fontsLink = document.querySelectorAll(`link[href="${url}"]`);
7236
- if (!fontsLink.length) {
7237
- const link = document.createElement('link');
7238
- link.href = url;
7239
- link.rel = 'stylesheet';
7240
- document.head.appendChild(link);
7241
- }
7519
+ const SidebarContext = /*#__PURE__*/createContext({
7520
+ collapsed: false,
7521
+ toggleCollapse: () => {
7522
+ console.log('collapse toggle');
7242
7523
  }
7243
- return responsiveFontSizes(createTheme(baseTheme, {
7244
- components: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, inputThemeOptions$1.components), tableThemeOptions$1.components), stepperThemeOptions$1.components), typographyThemeOptions$1.components), {
7245
- MuiToolbar: {
7246
- styleOverrides: {
7247
- root: {
7248
- [baseTheme.breakpoints.up('sm')]: {
7249
- minHeight: '56px'
7250
- }
7251
- }
7252
- }
7253
- },
7254
- // MuiBackdrop: {
7255
- // styleOverrides: {
7256
- // root: {
7257
- // backgroundColor: 'rgba(0, 0, 0, 0.2)',
7258
- // },
7259
- // },
7260
- // },
7261
- MuiAppBar: {
7262
- styleOverrides: {
7263
- root: {
7264
- boxShadow: 'none',
7265
- backgroundColor: '#007F9B'
7266
- }
7267
- }
7268
- },
7269
- MuiButton: {
7270
- styleOverrides: {
7271
- root: {
7272
- borderRadius: baseTheme.spacing(2.5),
7273
- padding: baseTheme.spacing(2.5, 4),
7274
- lineHeight: '20px',
7275
- fontSize: '1rem',
7276
- textTransform: 'none'
7277
- },
7278
- outlined: {
7279
- color: '#262842',
7280
- backgroundColor: '#FFFFFF !important',
7281
- border: '1px solid rgba(38, 40, 66, 0.12)'
7282
- },
7283
- text: {
7284
- color: baseTheme.palette.secondary.dark
7285
- }
7286
- }
7287
- },
7288
- MuiDialog: {
7289
- styleOverrides: {
7290
- root: {
7291
- '& .MuiModal-backdrop': {
7292
- background: 'rgba(28, 55, 77, 0.5)',
7293
- backdropFilter: 'blur(2px)'
7294
- }
7295
- },
7296
- paper: {
7297
- borderRadius: baseTheme.spacing(3)
7298
- },
7299
- paperWidthXs: {
7300
- maxWidth: 500
7301
- }
7302
- }
7303
- },
7304
- // MuiPaper: {
7305
- // styleOverrides: {
7306
- // root: {
7307
- // borderRadius: baseTheme.spacing(3),
7308
- // },
7309
- // },
7310
- // },
7311
- MuiDialogContent: {
7312
- styleOverrides: {
7313
- root: {
7314
- color: '#6D6E85'
7315
- }
7316
- }
7317
- },
7318
- MuiDialogActions: {
7319
- styleOverrides: {
7320
- root: {
7321
- background: '#F7F8FC',
7322
- borderTop: '1px solid rgba(38, 40, 66, 0.08)',
7323
- padding: baseTheme.spacing(3, 6)
7324
- }
7325
- }
7326
- },
7327
- MuiTabs: {
7328
- styleOverrides: {
7329
- root: {
7330
- minHeight: '38px'
7331
- },
7332
- indicator: {
7333
- backgroundColor: baseTheme.palette.secondary.main
7334
- }
7335
- }
7336
- },
7337
- MuiTab: {
7338
- styleOverrides: {
7339
- root: {
7340
- fontSize: 14,
7341
- fontWeight: 500,
7342
- textTransform: 'none',
7343
- padding: '10px 12px',
7344
- lineHeight: '1.125rem',
7345
- minHeight: '38px',
7346
- color: '#8B8C9E',
7347
- '&.Mui-selected': {
7348
- color: baseTheme.palette.secondary.main
7349
- }
7350
- }
7351
- }
7524
+ });
7525
+ const useSidebarContext = () => useContext(SidebarContext);
7526
+ const SidebarContextProvider = ({
7527
+ children
7528
+ }) => {
7529
+ const [collapsed, setCollapsed] = useState(localStorage.getItem('sidebar_collapsed') === 'true');
7530
+ const toggleCollapse = useCallback(() => {
7531
+ setCollapsed(!collapsed);
7532
+ localStorage.setItem('sidebar_collapsed', `${!collapsed}`);
7533
+ window.dispatchEvent(new CustomEvent('sidebar_collapsed', {
7534
+ detail: {
7535
+ collapsed: !collapsed
7352
7536
  }
7353
- })
7537
+ }));
7538
+ }, [collapsed]);
7539
+ const toggleRootElementLink = useCallback((name, isCollapsed) => {
7540
+ localStorage.setItem(`${name.toLowerCase()}_collapsed`, `${!isCollapsed}`);
7541
+ }, []);
7542
+ return jsx(SidebarContext.Provider, Object.assign({
7543
+ value: {
7544
+ collapsed,
7545
+ toggleCollapse,
7546
+ toggleRootElementLink
7547
+ }
7548
+ }, {
7549
+ children: children
7354
7550
  }));
7355
7551
  };
7356
- const theme = arsenalTheme();
7357
7552
 
7358
7553
  const drawerWidth = 248;
7359
7554
  const Container = styled('div')({
@@ -8039,4 +8234,33 @@ const Breadcrumbs = ({
8039
8234
  }));
8040
8235
  };
8041
8236
 
8042
- export { AlertDialog, BackButton, Breadcrumbs, ContentLayout, ControlAceEditor, ControlArrayInput, ControlAutocomplete, ControlCheckbox, ControlDate, ControlDateTime, ControlDebouncedInput, ControlInput, ControlNumberInput, ControlPeriodInput, ControlPhoneInput, ControlQueryAutocomplete, ControlRadio, ControlSelect, ControlSwitch, ControlTime, CopyButton, CreateDefinition, CreatePropertiesList, CreatePropertiesListContext, CreatePropertyFormFields, DATE_DEFAULT_FORMAT, DATE_TIME_DEFAULT_FORMAT, DEFAULT_DATE_VALIDATION_ERROR_TEXT, DEFAULT_ERROR_TEXT, DEFAULT_REQUIRED_ERROR_TEXT, DefinitionFiller, DefinitionValueView, InfoItem, JsonModalView, JsonPathPicker, JsonView, Loader, MenuIcon, MultiplePropertyFiller, PropertyFiller, PropertyType, PropertyValueField, RoundingMode, RouteTabs, Sidebar, SimpleTable, Status, StepperView, TIME_DEFAULT_FORMAT, TabPanel, Table, TableAction, TableActionCell, ViewPropertiesList, ViewProperty, capitalize, deepParseJson, defaultDefinitionArrayValue, defaultDefinitionObjectValue, digitsOnly, floatsOnly, formatDefinitionData, formatTableRowValue, getDemPropertyDateFormat, getEntityStarterValue, getJsonStringValue, getMultiplePropertyFillOptions, getSinglePropertyFillOptions, isDateType, isExpression, isPropertyValueEmpty, numberFormat, propertiesArrayToObject, propertiesObjectToArray, removeArrayItem, safeParseJson, sortArrayOfObjects, theme, useDebounce, useToggle, validateJson };
8237
+ const OverflowTip = ({
8238
+ children
8239
+ }) => {
8240
+ const [isOverflowed, setIsOverflow] = useState(false);
8241
+ const handleRect = useCallback(node => {
8242
+ setIsOverflow((node === null || node === void 0 ? void 0 : node.scrollWidth) > (node === null || node === void 0 ? void 0 : node.clientWidth));
8243
+ const change = () => {
8244
+ setIsOverflow((node === null || node === void 0 ? void 0 : node.scrollWidth) > (node === null || node === void 0 ? void 0 : node.clientWidth));
8245
+ };
8246
+ window.addEventListener('resize', change);
8247
+ }, []);
8248
+ return jsx(Tooltip, Object.assign({
8249
+ title: children,
8250
+ arrow: true,
8251
+ disableHoverListener: !isOverflowed
8252
+ }, {
8253
+ children: jsx("div", Object.assign({
8254
+ ref: handleRect,
8255
+ style: {
8256
+ whiteSpace: 'nowrap',
8257
+ overflow: 'hidden',
8258
+ textOverflow: 'ellipsis'
8259
+ }
8260
+ }, {
8261
+ children: children
8262
+ }))
8263
+ }));
8264
+ };
8265
+
8266
+ export { AlertDialog, BackButton, Breadcrumbs, ContentLayout, ControlAceEditor, ControlArrayInput, ControlAutocomplete, ControlCheckbox, ControlDate, ControlDateTime, ControlDebouncedInput, ControlInput, ControlNumberInput, ControlPeriodInput, ControlPhoneInput, ControlQueryAutocomplete, ControlRadio, ControlSelect, ControlSwitch, ControlTime, CopyButton, CreateDefinition, CreatePropertiesList, CreatePropertiesListContext, CreatePropertyFormFields, DATE_DEFAULT_FORMAT, DATE_TIME_DEFAULT_FORMAT, DEFAULT_DATE_VALIDATION_ERROR_TEXT, DEFAULT_ERROR_TEXT, DEFAULT_REQUIRED_ERROR_TEXT, DefinitionFiller, DefinitionValueView, InfoItem, JsonModalView, JsonPathPicker, JsonView, Loader, MenuIcon, MultiplePropertyFiller, OverflowTip, PropertyFiller, PropertyType, PropertyValueField, RoundingMode, RouteTabs, Sidebar, SimpleTable, Status, StepperView, TIME_DEFAULT_FORMAT, TabPanel, Table, TableAction, TableActionCell, ViewPropertiesList, ViewProperty, capitalize, deepParseJson, defaultDefinitionArrayValue, defaultDefinitionObjectValue, digitsOnly, floatsOnly, formatDefinitionData, formatTableRowValue, getDemPropertyDateFormat, getEntityStarterValue, getJsonStringValue, getMultiplePropertyFillOptions, getSinglePropertyFillOptions, isDateType, isExpression, isPropertyValueEmpty, numberFormat, propertiesArrayToObject, propertiesObjectToArray, removeArrayItem, safeParseJson, sortArrayOfObjects, theme, useDebounce, useToggle, validateJson };