@dartech/arsenal-ui 1.4.42 → 1.4.44

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,209 +1513,639 @@ 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;
1600
+ }
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
+ height: 40
1716
+ }
1717
+ }
1718
+ },
1719
+ MuiTableRow: {
1720
+ styleOverrides: {
1721
+ root: {
1722
+ '&:hover': {
1723
+ backgroundColor: '#F7F8FC!important'
1724
+ },
1725
+ height: 40
1726
+ }
1727
+ }
1728
+ },
1729
+ MuiTableCell: {
1730
+ styleOverrides: {
1731
+ root: {
1732
+ minHeight: 40,
1733
+ padding: baseTheme.spacing(1, 2),
1734
+ '&:first-of-type': {
1735
+ paddingLeft: baseTheme.spacing(4)
1736
+ }
1737
+ },
1738
+ head: {
1739
+ maxHeight: '40px',
1740
+ padding: baseTheme.spacing(2.75, 2),
1741
+ color: '#6D6E85'
1742
+ },
1743
+ body: {
1744
+ wordBreak: 'break-all'
1745
+ }
1746
+ }
1747
+ },
1748
+ MuiTableSortLabel: {
1749
+ styleOverrides: {
1750
+ root: {
1751
+ maxHeight: '24px',
1752
+ lineHeight: 1
1753
+ }
1754
+ }
1755
+ }
1756
+ }
1757
+ };
1758
+ var tableThemeOptions$1 = tableThemeOptions;
1759
+
1760
+ const stepperThemeOptions = {
1761
+ components: {
1762
+ MuiStepIcon: {
1763
+ styleOverrides: {
1764
+ root: {
1765
+ fontSize: '20px',
1766
+ color: baseTheme.palette.text.disabled,
1767
+ '&.Mui-active, &.Mui-completed': {
1768
+ color: baseTheme.palette.secondary.main
1769
+ }
1770
+ }
1771
+ }
1772
+ }
1773
+ }
1774
+ };
1775
+ var stepperThemeOptions$1 = stepperThemeOptions;
1776
+
1777
+ const typographyThemeOptions = {
1778
+ components: {
1779
+ MuiTypography: {
1780
+ styleOverrides: {
1781
+ h1: {
1782
+ [baseTheme.breakpoints.up('lg')]: {
1783
+ fontSize: '1.5rem'
1784
+ }
1785
+ },
1786
+ h3: {
1787
+ fontSize: '1.25rem',
1788
+ [baseTheme.breakpoints.up('lg')]: {
1789
+ fontSize: '1.125rem'
1790
+ }
1791
+ },
1792
+ h4: {
1793
+ fontSize: '1rem',
1794
+ [baseTheme.breakpoints.up('lg')]: {
1795
+ fontSize: '1rem'
1796
+ }
1797
+ },
1798
+ subtitle2: {
1799
+ color: '#6D6E85'
1800
+ }
1801
+ }
1802
+ }
1803
+ }
1804
+ };
1805
+ var typographyThemeOptions$1 = typographyThemeOptions;
1806
+
1807
+ const arsenalTheme = () => {
1808
+ if (document) {
1809
+ const url = "https://dev-qa-arsenal-frontend-fonts-bucket.s3.eu-north-1.amazonaws.com/fonts.css";
1810
+ const fontsLink = document.querySelectorAll(`link[href="${url}"]`);
1811
+ if (!fontsLink.length) {
1812
+ const link = document.createElement('link');
1813
+ link.href = url;
1814
+ link.rel = 'stylesheet';
1815
+ document.head.appendChild(link);
1816
+ }
1817
+ }
1818
+ return responsiveFontSizes(createTheme(baseTheme, {
1819
+ components: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, inputThemeOptions$1.components), tableThemeOptions$1.components), stepperThemeOptions$1.components), typographyThemeOptions$1.components), {
1820
+ MuiToolbar: {
1821
+ styleOverrides: {
1822
+ root: {
1823
+ [baseTheme.breakpoints.up('sm')]: {
1824
+ minHeight: '56px'
1825
+ }
1826
+ }
1827
+ }
1828
+ },
1829
+ // MuiBackdrop: {
1830
+ // styleOverrides: {
1831
+ // root: {
1832
+ // backgroundColor: 'rgba(0, 0, 0, 0.2)',
1833
+ // },
1834
+ // },
1835
+ // },
1836
+ MuiAppBar: {
1837
+ styleOverrides: {
1838
+ root: {
1839
+ boxShadow: 'none',
1840
+ backgroundColor: '#007F9B'
1841
+ }
1842
+ }
1843
+ },
1844
+ MuiButton: {
1845
+ styleOverrides: {
1846
+ root: {
1847
+ borderRadius: baseTheme.spacing(2.5),
1848
+ padding: baseTheme.spacing(2.5, 4),
1849
+ lineHeight: '20px',
1850
+ fontSize: '1rem',
1851
+ textTransform: 'none'
1852
+ },
1853
+ outlined: {
1854
+ color: '#262842',
1855
+ backgroundColor: '#FFFFFF !important',
1856
+ border: '1px solid rgba(38, 40, 66, 0.12)'
1857
+ },
1858
+ text: {
1859
+ color: baseTheme.palette.secondary.dark
1860
+ }
1861
+ }
1862
+ },
1863
+ MuiDialog: {
1864
+ styleOverrides: {
1865
+ root: {
1866
+ '& .MuiModal-backdrop': {
1867
+ background: 'rgba(28, 55, 77, 0.5)',
1868
+ backdropFilter: 'blur(2px)'
1869
+ }
1870
+ },
1871
+ paper: {
1872
+ borderRadius: baseTheme.spacing(3)
1873
+ },
1874
+ paperWidthXs: {
1875
+ maxWidth: 500
1876
+ }
1877
+ }
1878
+ },
1879
+ // MuiPaper: {
1880
+ // styleOverrides: {
1881
+ // root: {
1882
+ // borderRadius: baseTheme.spacing(3),
1883
+ // },
1884
+ // },
1885
+ // },
1886
+ MuiDialogContent: {
1887
+ styleOverrides: {
1888
+ root: {
1889
+ color: '#6D6E85'
1890
+ }
1891
+ }
1892
+ },
1893
+ MuiDialogActions: {
1894
+ styleOverrides: {
1895
+ root: {
1896
+ background: '#F7F8FC',
1897
+ borderTop: '1px solid rgba(38, 40, 66, 0.08)',
1898
+ padding: baseTheme.spacing(3, 6)
1899
+ }
1900
+ }
1901
+ },
1902
+ MuiTabs: {
1903
+ styleOverrides: {
1904
+ root: {
1905
+ minHeight: '38px'
1906
+ },
1907
+ indicator: {
1908
+ backgroundColor: baseTheme.palette.secondary.main
1909
+ }
1910
+ }
1911
+ },
1912
+ MuiTab: {
1913
+ styleOverrides: {
1914
+ root: {
1915
+ fontSize: 14,
1916
+ fontWeight: 500,
1917
+ textTransform: 'none',
1918
+ padding: '10px 12px',
1919
+ lineHeight: '1.125rem',
1920
+ minHeight: '38px',
1921
+ color: '#8B8C9E',
1922
+ '&.Mui-selected': {
1923
+ color: baseTheme.palette.secondary.main
1924
+ }
1925
+ }
1926
+ }
1927
+ }
1928
+ })
1929
+ }));
1930
+ };
1931
+ const theme = arsenalTheme();
1932
+
1933
+ const formatTableRowValue = ({
1934
+ value,
1935
+ canCopy,
1936
+ copyValue,
1937
+ shortId,
1938
+ fullText: _fullText = false,
1939
+ textParams
1940
+ }) => {
1941
+ const {
1942
+ displayAs = 'text',
1943
+ tooltipLinkComponent = null,
1944
+ dateFormat = null,
1945
+ statusVariant = null
1946
+ } = textParams || {};
1947
+ switch (displayAs) {
1948
+ case 'boolean':
1949
+ return value ? jsx(SvgIcon, Object.assign({
1950
+ color: "primary",
1951
+ fontSize: "small"
1952
+ }, {
1953
+ children: jsx("path", {
1954
+ 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"
1955
+ })
1956
+ })) : jsx(SvgIcon, Object.assign({
1957
+ fontSize: "small"
1958
+ }, {
1959
+ children: jsx("path", {
1960
+ 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"
1961
+ })
1962
+ }));
1963
+ case 'date':
1964
+ return value ? dateFormat ? jsx(Box, {
1965
+ children: dateFormat.map((formatString, index) => jsx(Box, {
1966
+ children: format(new Date(value), formatString)
1967
+ }, index))
1968
+ }) : jsxs(Box, {
1969
+ children: [jsx(Box, {
1970
+ children: format(new Date(value), 'dd.MM.yyyy')
1971
+ }), jsx(Box, {
1972
+ children: format(new Date(value), 'HH:mm:ss')
1973
+ })]
1974
+ }) : '';
1975
+ case 'status':
1976
+ return jsx(Status, {
1977
+ text: value,
1978
+ status: statusVariant ? statusVariant : 'default'
1979
+ });
1980
+ case 'json_text':
1981
+ return jsx(JsonTypeCell$1, {
1982
+ value: value,
1983
+ textField: true
1984
+ });
1985
+ case 'json_code':
1986
+ return jsx(JsonTypeCell$1, {
1987
+ value: value,
1988
+ copyButton: true
1989
+ });
1990
+ case 'array':
1991
+ return jsx(Box, {
1992
+ children: value.map((val, index) => jsx(Box, {
1993
+ children: val
1994
+ }, index))
1995
+ });
1996
+ case 'collapsed_array':
1997
+ return value && jsx(Box, {
1998
+ children: jsx(Tooltip, Object.assign({
1999
+ arrow: true,
2000
+ title: tooltipLinkComponent ? tooltipLinkComponent : value.map((val, index) => jsx(Box, Object.assign({
2001
+ fontSize: 14,
2002
+ style: {
2003
+ paddingTop: theme.spacing(1)
2004
+ }
2005
+ }, {
2006
+ children: val
2007
+ }), index))
2008
+ }, {
2009
+ children: jsx(Box, {
2010
+ children: value.length > 1 ? `${value[0]} (+${value.length - 1})` : value[0]
2011
+ })
2012
+ }))
2013
+ });
2014
+ case 'number':
2015
+ return jsx(Box, Object.assign({
2016
+ display: "flex",
2017
+ justifyContent: "flex-end"
2018
+ }, {
2019
+ children: jsx(Box, {
2020
+ children: value.toLocaleString('ru-Ru', {
2021
+ minimumFractionDigits: 2
2022
+ })
2023
+ })
2024
+ }));
2025
+ case 'text':
2026
+ default:
2027
+ return value ? jsxs(Box, Object.assign({
2028
+ display: "flex",
2029
+ alignItems: "center",
2030
+ width: "100%"
2031
+ }, {
2032
+ children: [shortId ? jsx(OverflowTip, {
2033
+ children: jsx(Box, Object.assign({
2034
+ mr: "auto"
2035
+ }, {
2036
+ children: value ? `${value.slice(0, 6)}...${value.slice(-6)}` : '...'
2037
+ }))
2038
+ }) : _fullText ? jsx(Box, Object.assign({
2039
+ sx: {
2040
+ whiteSpace: 'normal'
2041
+ }
2042
+ }, {
2043
+ children: typeof value === 'string' ? value : JSON.stringify(value)
2044
+ })) : jsx(Box, {
2045
+ children: jsx(OverflowTip, {
2046
+ children: typeof value === 'string' ? value : JSON.stringify(value)
2047
+ })
2048
+ }), canCopy && jsx(CopyButton, {
2049
+ copyText: copyValue ? typeof copyValue === 'string' ? copyValue : JSON.stringify(copyValue) : value
2050
+ })]
2051
+ })) : '';
2052
+ }
2053
+ };
2054
+
2055
+ const digitsOnly = new RegExp('^[-+]?[0-9]+$');
2056
+ const floatsOnly = new RegExp(/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/);
2057
+ const isExpression = (value, useRecursion) => {
2058
+ if (typeof value === 'string') return /\$(?:S?JS)?(?:\{|\()/g.test(value);
2059
+ if (useRecursion) {
2060
+ if (Array.isArray(value)) {
2061
+ for (const item of value) {
2062
+ if (isExpression(item, useRecursion)) return true;
2063
+ }
2064
+ }
2065
+ if (typeof value === 'object') {
2066
+ for (const key in value) {
2067
+ if (isExpression(value[key], useRecursion)) return true;
2068
+ }
2069
+ }
2070
+ }
2071
+ return false;
2072
+ // return typeof value === 'string' ? /\$(?:S?JS)?\(/g.test(value) : false;
2073
+ };
2074
+
2075
+ const isDateType = propertyType => {
2076
+ return propertyType === PropertyType.DATE || propertyType === PropertyType.DATE_TIME || propertyType === PropertyType.TIME;
2077
+ };
2078
+ const numberFormat = new Intl.NumberFormat('ru-RU', {
2079
+ style: 'decimal'
2080
+ });
2081
+
2082
+ const isPropertyValueEmpty = value => {
2083
+ if (value || value === 0 || value === false) {
2084
+ return false;
2085
+ }
2086
+ return true;
2087
+ };
2088
+ const formatPropertyValue = (propertyType, value, params) => {
2089
+ if (value === null || value === undefined) {
2090
+ return null;
2091
+ }
2092
+ if (isExpression(value)) return value;
2093
+ let parsedValue = value;
2094
+ // console.log(value);
2095
+ switch (propertyType) {
2096
+ case PropertyType.BOOLEAN:
2097
+ if (value) {
2098
+ parsedValue = true;
2099
+ } else if (!value && value !== null) {
2100
+ parsedValue = false;
2101
+ } else {
2102
+ parsedValue = null;
2103
+ }
2104
+ break;
2105
+ case PropertyType.INTEGER:
2106
+ case PropertyType.BIG_INTEGER:
2107
+ case PropertyType.BIG_DECIMAL:
2108
+ case PropertyType.FLOAT:
2109
+ case PropertyType.LONG:
2110
+ case PropertyType.DOUBLE:
2111
+ parsedValue = Number(value);
2112
+ break;
2113
+ case PropertyType.DATE:
2114
+ case PropertyType.DATE_TIME:
2115
+ case PropertyType.TIME:
2116
+ {
2117
+ if (value) {
2118
+ try {
2119
+ const formatString = params.formatText.replace(/[Z,z,x]+/g, 'XX');
2120
+ parsedValue = format(parse(value, formatString, new Date()), formatString);
2121
+ } catch (e) {
2122
+ console.error(e);
2123
+ }
2124
+ }
2125
+ break;
2126
+ }
2127
+ case PropertyType.JSON:
2128
+ try {
2129
+ if (typeof value !== 'string') {
2130
+ parsedValue = JSON.stringify(value);
2131
+ }
2132
+ parsedValue = JSON.parse(parsedValue);
2133
+ } catch (e) {
2134
+ console.log(e);
2135
+ parsedValue = null;
2136
+ }
2137
+ break;
2138
+ case PropertyType.ANY:
2139
+ try {
2140
+ if (typeof value === 'string') {
2141
+ parsedValue = JSON.parse(parsedValue);
2142
+ } else {
2143
+ parsedValue = value;
2144
+ }
2145
+ // parsedValue = JSON.parse(parsedValue as string);
2146
+ } catch (e) {
2147
+ // console.log(e);
2148
+ parsedValue = value;
1718
2149
  }
1719
2150
  break;
1720
2151
  case PropertyType.ENTITY:
@@ -2212,8 +2643,8 @@ const ControlSwitch = _a => {
2212
2643
  });
2213
2644
  };
2214
2645
 
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;
2646
+ 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";
2647
+ var DateIcon = img$6;
2217
2648
 
2218
2649
  const DateIconComponent$1 = () => {
2219
2650
  return jsx("img", {
@@ -2466,36 +2897,41 @@ const ControlTime = ({
2466
2897
  }));
2467
2898
  };
2468
2899
 
2469
- const ControlArrayInput = ({
2470
- name,
2471
- control,
2472
- label,
2473
- required,
2474
- defaultValue: _defaultValue = null
2475
- }) => {
2476
- var _a, _b;
2900
+ const ControlArrayInput = _a => {
2901
+ var _b, _c, _d;
2902
+ var {
2903
+ name,
2904
+ control,
2905
+ label,
2906
+ required,
2907
+ defaultValue = null,
2908
+ onChange: customOnChange,
2909
+ textFieldLabel
2910
+ } = _a,
2911
+ textFieldProps = __rest(_a, ["name", "control", "label", "required", "defaultValue", "onChange", "textFieldLabel"]);
2477
2912
  const [localValue, setLoacalValue] = useState('');
2478
2913
  const [error, setError] = useState(null);
2479
- const _c = useController({
2914
+ const _e = useController({
2480
2915
  control,
2481
2916
  name,
2482
- defaultValue: _defaultValue,
2917
+ defaultValue,
2483
2918
  rules: {
2484
2919
  required: required && DEFAULT_REQUIRED_ERROR_TEXT
2485
2920
  }
2486
2921
  }),
2487
- _d = _c.field,
2922
+ _f = _e.field,
2488
2923
  {
2489
- onChange,
2924
+ onChange: innerOnChange,
2490
2925
  value: values
2491
- } = _d,
2492
- fieldData = __rest(_d, ["onChange", "value"]),
2926
+ } = _f,
2927
+ fieldData = __rest(_f, ["onChange", "value"]),
2493
2928
  {
2494
2929
  // fieldState: { error },
2495
2930
  formState: {
2496
2931
  errors
2497
2932
  }
2498
- } = _c;
2933
+ } = _e;
2934
+ const onChange = useMemo(() => customOnChange ? customOnChange : innerOnChange, [customOnChange, innerOnChange]);
2499
2935
  const handleInputChange = useCallback(e => {
2500
2936
  const {
2501
2937
  value
@@ -2524,17 +2960,10 @@ const ControlArrayInput = ({
2524
2960
  }
2525
2961
  }, [handleAdd]);
2526
2962
  return jsxs(Fragment, {
2527
- children: [jsx(Typography, Object.assign({
2528
- variant: "subtitle1"
2963
+ children: [jsx(FormLabel, Object.assign({
2964
+ required: required
2529
2965
  }, {
2530
- children: required ? jsxs(Fragment, {
2531
- children: [label, ' ', jsx(Box, Object.assign({
2532
- component: "span",
2533
- color: "#D6331F"
2534
- }, {
2535
- children: "*"
2536
- }))]
2537
- }) : label
2966
+ children: label
2538
2967
  })), jsx(Box, Object.assign({
2539
2968
  display: "flex",
2540
2969
  flexWrap: "wrap"
@@ -2553,15 +2982,15 @@ const ControlArrayInput = ({
2553
2982
  }, control.register(name), {
2554
2983
  onChange: onChange,
2555
2984
  value: values
2556
- }, fieldData)), jsx(TextField, {
2985
+ }, fieldData)), jsx(TextField, Object.assign({
2557
2986
  fullWidth: true,
2558
2987
  variant: "outlined",
2559
2988
  size: "small",
2560
- label: `Add ${label}`,
2989
+ label: textFieldLabel || textFieldLabel === '' ? textFieldLabel : `Add ${label}`,
2561
2990
  value: localValue,
2562
2991
  onChange: handleInputChange,
2563
- error: !!((_a = errors[name]) === null || _a === void 0 ? void 0 : _a.message),
2564
- helperText: (_b = errors[name]) === null || _b === void 0 ? void 0 : _b.message,
2992
+ error: !!((_b = errors[name]) === null || _b === void 0 ? void 0 : _b.message),
2993
+ helperText: (_c = errors[name]) === null || _c === void 0 ? void 0 : _c.message,
2565
2994
  FormHelperTextProps: {
2566
2995
  variant: 'standard'
2567
2996
  },
@@ -2578,8 +3007,9 @@ const ControlArrayInput = ({
2578
3007
  })
2579
3008
  })
2580
3009
  }))
2581
- }
2582
- }), error && jsx(FormHelperText, Object.assign({
3010
+ },
3011
+ inputProps: Object.assign({}, (_d = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.inputProps) !== null && _d !== void 0 ? _d : {})
3012
+ }, textFieldProps)), error && jsx(FormHelperText, Object.assign({
2583
3013
  error: true
2584
3014
  }, {
2585
3015
  children: error
@@ -2780,8 +3210,8 @@ const ControlPeriodInput = ({
2780
3210
  });
2781
3211
  };
2782
3212
 
2783
- 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";
2784
- var FlagKz = img$2;
3213
+ 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";
3214
+ var FlagKz = img$5;
2785
3215
 
2786
3216
  const ControlPhoneInput = _a => {
2787
3217
  var {
@@ -2860,6 +3290,13 @@ const TablePagination = () => {
2860
3290
  const pageSize = useGridSelector(apiRef, gridPageSizeSelector);
2861
3291
  const onPageChange = value => apiRef.current.setPage(value);
2862
3292
  const onRowsPerPageChange = event => apiRef.current.setPageSize(parseInt(event.target.value, 10));
3293
+ const labelDisplayedRows = ({
3294
+ from,
3295
+ to,
3296
+ count
3297
+ }) => {
3298
+ return `${from}–${to} из ${count !== -1 ? count : `более ${to}`}`;
3299
+ };
2863
3300
  return jsxs(Box, Object.assign({
2864
3301
  px: 2,
2865
3302
  display: "flex",
@@ -2873,6 +3310,8 @@ const TablePagination = () => {
2873
3310
  rowsPerPageOptions: [10, 20, 50, 100],
2874
3311
  onPageChange: (event, value) => onPageChange(value),
2875
3312
  onRowsPerPageChange: onRowsPerPageChange,
3313
+ labelRowsPerPage: "\u0421\u0442\u0440\u043E\u043A \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435",
3314
+ labelDisplayedRows: labelDisplayedRows,
2876
3315
  ActionsComponent: undefined
2877
3316
  }), jsx(Pagination, {
2878
3317
  count: pageCount,
@@ -3003,24 +3442,54 @@ const usePagination = initialPageSize => {
3003
3442
  };
3004
3443
  var usePagination$1 = usePagination;
3005
3444
 
3006
- const styles = {
3445
+ const StyledDataGrid = styled(DataGrid)(({
3446
+ theme
3447
+ }) => ({
3448
+ borderRadius: theme.spacing(3),
3007
3449
  width: '100%',
3008
- '& .MuiDataGrid-virtualScrollerContent': {
3009
- height: 'auto !important',
3010
- minHeight: '56px !important'
3450
+ color: theme.palette.mode === 'light' ? 'rgba(0,0,0,.85)' : 'rgba(255,255,255,0.85)',
3451
+ '& .MuiDataGrid-columnsContainer': {
3452
+ borderRadius: theme.spacing(3),
3453
+ border: '1px solid rgba(38, 40, 66, 0.08)'
3011
3454
  },
3012
- '& .MuiDataGrid-virtualScrollerRenderZone': {
3013
- position: 'static'
3455
+ '& .MuiDataGrid-columnHeaders': {
3456
+ backgroundColor: '#F7F8FC',
3457
+ borderTopLeftRadius: theme.spacing(3),
3458
+ borderTopRightRadius: theme.spacing(3)
3459
+ },
3460
+ '& .MuiDataGrid-columnHeader, .MuiDataGrid-cell': {
3461
+ maxHeight: '40px!important',
3462
+ padding: theme.spacing(2.75, 2),
3463
+ color: '#6D6E85',
3464
+ '&.Sorted': {
3465
+ color: '#262842'
3466
+ },
3467
+ '&:first-of-type': {
3468
+ paddingLeft: theme.spacing(4)
3469
+ },
3470
+ borderRight: 0,
3471
+ borderLeft: 0
3472
+ },
3473
+ '& .MuiDataGrid-columnsContainer, .MuiDataGrid-cell': {
3474
+ maxHeight: '40px!important',
3475
+ padding: theme.spacing(1, 2),
3476
+ '&:first-of-type': {
3477
+ paddingLeft: theme.spacing(4)
3478
+ }
3014
3479
  },
3015
- '& .MuiDataGrid-renderingZone': {
3016
- maxHeight: 'none !important'
3480
+ '& .MuiDataGrid-row': {
3481
+ '&:hover': {
3482
+ backgroundColor: '#F7F8FC!important'
3483
+ }
3017
3484
  },
3018
3485
  '& .MuiDataGrid-cell': {
3019
- maxHeight: 'none !important',
3020
- lineHeight: 'unset !important',
3021
- // whiteSpace: 'normal !important',
3486
+ color: theme.palette.mode === 'light' ? 'rgba(0,0,0,.85)' : 'rgba(255,255,255,0.65)',
3487
+ '&:focus': {
3488
+ border: 0
3489
+ },
3022
3490
  textOverflow: 'ellipsis',
3023
3491
  wordBreak: 'break-all',
3492
+ overflow: 'hidden',
3024
3493
  '& .MuiDataGrid-actionsCell': {
3025
3494
  width: '100%',
3026
3495
  gridGap: '4px',
@@ -3030,29 +3499,68 @@ const styles = {
3030
3499
  }
3031
3500
  }
3032
3501
  },
3033
- '& .MuiDataGrid-row': {
3034
- maxHeight: 'none !important'
3502
+ '& .MuiPaginationItem-root': {
3503
+ borderRadius: 0
3504
+ },
3505
+ '& .MuiDataGrid-virtualScrollerRenderZone': {
3506
+ position: 'static'
3507
+ },
3508
+ '& .MuiDataGrid-cell:focus-within, & .MuiDataGrid-cell:focus': {
3509
+ outline: 'none !important'
3510
+ },
3511
+ '& .MuiDataGrid-columnHeader:focus-within, & .MuiDataGrid-columnHeader:focus': {
3512
+ outline: 'none !important'
3513
+ },
3514
+ '& .MuiTablePagination-actions': {
3515
+ display: 'none !important'
3516
+ },
3517
+ '& .MuiDataGrid-iconButtonContainer': {
3518
+ '& img': {
3519
+ visibility: 'visible !important',
3520
+ opacity: '0.5!important'
3521
+ }
3035
3522
  },
3036
3523
  '& .Sorted': {
3037
3524
  '& .MuiDataGrid-iconButtonContainer': {
3038
- visibility: 'visible',
3039
- width: 'auto',
3040
- '& svg': {
3041
- opacity: '1 !important'
3042
- }
3043
- },
3044
- '&.--desc': {
3045
- '& svg': {
3046
- transform: 'rotate(180deg)'
3525
+ '& img': {
3526
+ visibility: 'visible !important',
3527
+ opacity: '1!important'
3047
3528
  }
3048
3529
  }
3049
3530
  }
3050
- };
3531
+ }));
3532
+
3533
+ 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";
3534
+ var SortIcon = img$4;
3535
+
3536
+ 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";
3537
+ var SortAscIcon = img$3;
3538
+
3539
+ 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";
3540
+ var SortDescIcon = img$2;
3051
3541
 
3052
3542
  /**
3053
3543
  * Main data display component. MUI DataGrid used
3054
3544
  * @category Common UI components
3055
3545
  */
3546
+ const SortIconComponent$1 = () => {
3547
+ return jsx("img", {
3548
+ src: SortIcon,
3549
+ alt: ""
3550
+ });
3551
+ };
3552
+ const SortAscIconComponent$1 = () => {
3553
+ return jsx("img", {
3554
+ src: SortAscIcon,
3555
+ alt: ""
3556
+ });
3557
+ };
3558
+ const SortDescIconComponent$1 = () => {
3559
+ return jsx("img", {
3560
+ src: SortDescIcon,
3561
+ alt: ""
3562
+ });
3563
+ };
3056
3564
  const Table = ({
3057
3565
  columns,
3058
3566
  rows,
@@ -3086,11 +3594,24 @@ const Table = ({
3086
3594
  pageSize: _mode === 'server' ? size : _pagination ? pageSize : rowCount,
3087
3595
  onPageSizeChange: _mode === 'server' ? onSizeChange : handlePageSizeChange,
3088
3596
  components: {
3089
- Pagination: TablePagination$1
3597
+ BaseTooltip: Tooltip,
3598
+ Pagination: TablePagination$1,
3599
+ ColumnUnsortedIcon: _a => {
3600
+ __rest(_a, ["sortingOrder"]);
3601
+ return jsx(SortIconComponent$1, {});
3602
+ },
3603
+ ColumnSortedDescendingIcon: _a => {
3604
+ __rest(_a, ["sortingOrder"]);
3605
+ return jsx(SortDescIconComponent$1, {});
3606
+ },
3607
+ ColumnSortedAscendingIcon: _a => {
3608
+ __rest(_a, ["sortingOrder"]);
3609
+ return jsx(SortAscIconComponent$1, {});
3610
+ }
3090
3611
  }
3091
3612
  };
3092
3613
  if (_mode === 'server') {
3093
- tableProps['sortModel'] = [];
3614
+ // tableProps['sortModel'] = [];
3094
3615
  tableProps['onColumnHeaderClick'] = onColumnHeaderClick;
3095
3616
  tableProps['page'] = page;
3096
3617
  tableProps['onPageChange'] = onPageChange;
@@ -3099,9 +3620,10 @@ const Table = ({
3099
3620
  return jsx(Box, Object.assign({
3100
3621
  mt: disableMargin ? 0 : 2
3101
3622
  }, {
3102
- children: jsx(DataGrid, Object.assign({
3103
- sx: styles,
3623
+ children: jsx(StyledDataGrid, Object.assign({
3104
3624
  autoHeight: true,
3625
+ headerHeight: 40,
3626
+ rowHeight: 40,
3105
3627
  hideFooterPagination: !_pagination,
3106
3628
  hideFooter: !_pagination,
3107
3629
  disableSelectionOnClick: true,
@@ -3109,6 +3631,7 @@ const Table = ({
3109
3631
  showCellRightBorder: true,
3110
3632
  loading: loading,
3111
3633
  rows: rows,
3634
+ disableColumnMenu: true,
3112
3635
  columns: getSortedColumns(columns),
3113
3636
  rowCount: rowCount,
3114
3637
  rowsPerPageOptions: [10, 20, 50, 100],
@@ -3208,7 +3731,7 @@ const useTableSorting = () => {
3208
3731
  const sortParams = useMemo(() => searchParams.getAll('sort').map(param => param.split(',')), [searchParams]);
3209
3732
  const onSortChanged = useCallback(sortKey => {
3210
3733
  setSearchParams(params => {
3211
- console.log(sortKey, params.get('page'));
3734
+ // console.log(sortKey, params.get('page'));
3212
3735
  params.delete('sort');
3213
3736
  let keyFound = false;
3214
3737
  sortParams.forEach(([key, value]) => {
@@ -3239,6 +3762,33 @@ const useTableSorting = () => {
3239
3762
  };
3240
3763
  var useTableSorting$1 = useTableSorting;
3241
3764
 
3765
+ const TableSortLabel = styled(MuiTableSortLabel)(({
3766
+ active
3767
+ }) => ({
3768
+ '.MuiSvgIcon-root': {
3769
+ opacity: active ? 1 : 0.5,
3770
+ marginTop: '4%'
3771
+ }
3772
+ }));
3773
+
3774
+ const SortIconComponent = () => {
3775
+ return jsx("img", {
3776
+ src: SortIcon,
3777
+ alt: ""
3778
+ });
3779
+ };
3780
+ const SortAscIconComponent = () => {
3781
+ return jsx("img", {
3782
+ src: SortAscIcon,
3783
+ alt: ""
3784
+ });
3785
+ };
3786
+ const SortDescIconComponent = () => {
3787
+ return jsx("img", {
3788
+ src: SortDescIcon,
3789
+ alt: ""
3790
+ });
3791
+ };
3242
3792
  function TableInner({
3243
3793
  columns = [],
3244
3794
  rows = [],
@@ -3248,7 +3798,8 @@ function TableInner({
3248
3798
  loading = false,
3249
3799
  onRowClick,
3250
3800
  emptyDataText,
3251
- verticalAlign = 'middle'
3801
+ verticalAlign = 'middle',
3802
+ labelRowsPerPage
3252
3803
  }, ref) {
3253
3804
  const {
3254
3805
  page,
@@ -3260,99 +3811,127 @@ function TableInner({
3260
3811
  onSortChanged,
3261
3812
  getColumnSorting
3262
3813
  } = useTableSorting$1();
3263
- return jsxs(TableContainer, Object.assign({
3814
+ const labelDisplayedRows = ({
3815
+ from,
3816
+ to,
3817
+ count
3818
+ }) => {
3819
+ return `${from}–${to} из ${count !== -1 ? count : `более ${to}`}`;
3820
+ };
3821
+ return jsx(Box, Object.assign({
3264
3822
  sx: {
3265
- position: 'relative',
3266
- overflow: 'visible'
3823
+ overflow: 'auto'
3267
3824
  }
3268
3825
  }, {
3269
- children: [jsx(Backdrop, Object.assign({
3270
- open: loading,
3826
+ children: jsxs(TableContainer, Object.assign({
3271
3827
  sx: {
3272
- position: 'absolute',
3273
- top: 0,
3274
- left: 0
3828
+ width: '100%',
3829
+ display: 'table',
3830
+ tableLayout: 'fixed'
3275
3831
  }
3276
3832
  }, {
3277
- children: jsx(Loader, {})
3278
- })), jsxs(MuiTable, Object.assign({
3279
- ref: ref
3280
- }, {
3281
- children: [jsx(TableHead, {
3282
- children: jsx(TableRow, {
3283
- children: columns.map((column, index) => {
3284
- const sortDirection = column.sortKey ? getColumnSorting(column.sortKey) : false;
3285
- return jsx(TableCell, Object.assign({
3833
+ children: [jsx(Backdrop, Object.assign({
3834
+ open: loading,
3835
+ sx: {
3836
+ position: 'absolute',
3837
+ top: 0,
3838
+ left: 0
3839
+ }
3840
+ }, {
3841
+ children: jsx(Loader, {})
3842
+ })), jsxs(MuiTable, Object.assign({
3843
+ ref: ref
3844
+ }, {
3845
+ children: [jsx(TableHead, {
3846
+ children: jsx(TableRow, {
3847
+ children: columns.map((column, index) => {
3848
+ const sortDirection = column.sortKey ? getColumnSorting(column.sortKey) : false;
3849
+ return jsx(TableCell, Object.assign({
3850
+ align: column.align ? column.align : 'left',
3851
+ sortDirection: sortDirection,
3852
+ sx: {
3853
+ width: column.width ? `${column.width}%` : 'unset'
3854
+ }
3855
+ }, {
3856
+ children: jsx(TableSortLabel, Object.assign({
3857
+ active: !!sortDirection,
3858
+ hideSortIcon: !column.sortKey,
3859
+ direction: sortDirection || 'asc',
3860
+ IconComponent: sortDirection === 'asc' ? SortAscIconComponent : sortDirection === 'desc' ? SortDescIconComponent : SortIconComponent,
3861
+ onClick: () => column.sortKey ? onSortChanged(column.sortKey) : {}
3862
+ }, {
3863
+ children: column.label
3864
+ }))
3865
+ }), index);
3866
+ })
3867
+ })
3868
+ }), jsx(TableBody, {
3869
+ children: rows.length ? rows.map((row, index) => jsx(TableRow, Object.assign({
3870
+ hover: true,
3871
+ onClick: onRowClick ? () => onRowClick(row) : row.onClick,
3872
+ sx: {
3873
+ verticalAlign
3874
+ }
3875
+ }, {
3876
+ children: columns.map((column, idx) => jsx(TableCell, Object.assign({
3286
3877
  align: column.align ? column.align : 'left',
3287
- sortDirection: sortDirection,
3288
3878
  sx: {
3289
- width: column.width ? `${column.width}%` : 'unset'
3879
+ maxWidth: column.width ? `${column.width}%` : 'unset'
3290
3880
  }
3291
3881
  }, {
3292
- children: jsx(TableSortLabel, Object.assign({
3293
- active: !!sortDirection,
3294
- hideSortIcon: !column.sortKey,
3295
- direction: sortDirection || 'asc',
3296
- onClick: () => column.sortKey ? onSortChanged(column.sortKey) : {}
3882
+ children: jsx(Box, Object.assign({
3883
+ sx: {
3884
+ maxWidth: '90%',
3885
+ overflow: 'hidden',
3886
+ whiteSpace: 'nowrap',
3887
+ textOverflow: 'ellipsis'
3888
+ }
3297
3889
  }, {
3298
- children: column.label
3890
+ children: jsx(Box, {
3891
+ children: column.renderCell ? column.renderCell(row, index) : row[column.id]
3892
+ })
3299
3893
  }))
3300
- }), index);
3301
- })
3302
- })
3303
- }), jsx(TableBody, {
3304
- children: rows.length ? rows.map((row, index) => jsx(TableRow, Object.assign({
3305
- hover: true,
3306
- onClick: onRowClick ? () => onRowClick(row) : row.onClick,
3307
- sx: {
3308
- verticalAlign
3309
- }
3310
- }, {
3311
- children: columns.map((column, idx) => jsx(TableCell, Object.assign({
3312
- align: column.align ? column.align : 'left',
3894
+ }), idx))
3895
+ }), index)) : jsx(TableRow, Object.assign({
3313
3896
  sx: {
3314
- width: column.width ? `${column.width}%` : 'unset'
3897
+ verticalAlign
3315
3898
  }
3316
3899
  }, {
3317
- children: column.renderCell ? column.renderCell(row, index) : row[column.id]
3318
- }), idx))
3319
- }), index)) : jsx(TableRow, Object.assign({
3320
- sx: {
3321
- verticalAlign
3322
- }
3323
- }, {
3324
- children: jsx(TableCell, Object.assign({
3325
- align: "center",
3326
- colSpan: columns.length
3327
- }, {
3328
- children: emptyDataText !== null && emptyDataText !== void 0 ? emptyDataText : 'Нет данных'
3900
+ children: jsx(TableCell, Object.assign({
3901
+ align: "center",
3902
+ colSpan: columns.length
3903
+ }, {
3904
+ children: emptyDataText !== null && emptyDataText !== void 0 ? emptyDataText : 'Нет данных'
3905
+ }))
3329
3906
  }))
3330
- }))
3331
- }), pagination || children ? jsx(TableFooter, {
3332
- children: jsxs(TableRow, {
3333
- children: [children && jsx(TableCell, Object.assign({
3334
- colSpan: columns.length,
3335
- sx: {
3336
- background: '#F0F0F7',
3337
- px: 4,
3338
- py: 3
3339
- }
3340
- }, {
3341
- children: children
3342
- })), pagination && !!rows.length ? jsx(MuiTablePagination, {
3343
- rowsPerPageOptions: [5, 10, 25],
3344
- count: totalCount,
3345
- rowsPerPage: +size,
3346
- page: +page,
3347
- sx: {
3348
- borderBottom: 'none'
3349
- },
3350
- onPageChange: (_, page) => onPageChange(page),
3351
- onRowsPerPageChange: event => onSizeChange(+event.target.value)
3352
- }) : null]
3353
- })
3354
- }) : null]
3355
- }))]
3907
+ }), pagination || children ? jsx(TableFooter, {
3908
+ children: jsxs(TableRow, {
3909
+ children: [children && jsx(TableCell, Object.assign({
3910
+ colSpan: columns.length,
3911
+ sx: {
3912
+ background: '#F0F0F7',
3913
+ px: 4,
3914
+ py: 3
3915
+ }
3916
+ }, {
3917
+ children: children
3918
+ })), pagination && !!rows.length ? jsx(MuiTablePagination, {
3919
+ rowsPerPageOptions: [5, 10, 25],
3920
+ count: totalCount,
3921
+ rowsPerPage: +size,
3922
+ page: +page,
3923
+ sx: {
3924
+ borderBottom: 'none'
3925
+ },
3926
+ labelRowsPerPage: labelRowsPerPage,
3927
+ labelDisplayedRows: labelRowsPerPage ? labelDisplayedRows : undefined,
3928
+ onPageChange: (_, page) => onPageChange(page),
3929
+ onRowsPerPageChange: event => onSizeChange(+event.target.value)
3930
+ }) : null]
3931
+ })
3932
+ }) : null]
3933
+ }))]
3934
+ }))
3356
3935
  }));
3357
3936
  }
3358
3937
  const SimpleTable = /*#__PURE__*/forwardRef(TableInner);
@@ -6492,869 +7071,475 @@ const MultiplePropertyFiller = ({
6492
7071
  })) : null, fillOption === 'expression' && (propertyType === PropertyType.JSON || propertyType === PropertyType.ENTITY || propertyType === PropertyType.ANY ? jsx(ControlAceEditor, {
6493
7072
  name: name,
6494
7073
  control: control,
6495
- label: valueLabel,
6496
- parseValue: true,
6497
- hideErrorMessage: true,
6498
- useCleanValue: true,
6499
- mode: propertyType === PropertyType.ANY ? 'text' : 'json'
6500
- }) : jsx(ControlInput, {
6501
- required: true,
6502
- hideErrorMessage: true,
6503
- control: control,
6504
- name: name,
6505
- label: valueLabel
6506
- })), fillOption === 'json_valid' && jsx(ControlAceEditor, {
6507
- name: name,
6508
- control: control,
6509
- label: valueLabel,
6510
- parseValue: true,
6511
- validateJson: true,
6512
- hideErrorMessage: true
6513
- })
6514
- // <JsonEditor validate name={name} ref={ref} useParsedValue />
6515
- , fillOption === 'widget' && jsx(MultiplePropertyWidget$1, {
6516
- property: property,
6517
- name: name,
6518
- useExpression: useExpression,
6519
- required: required,
6520
- label: label,
6521
- entityReferenceDefinitionSources: entityReferenceDefinitionSources,
6522
- entityReferenceValueComponent: entityReferenceValueComponent,
6523
- fileReferenceValueComponent: fileReferenceValueComponent
6524
- }), error && jsx(FormHelperText, Object.assign({
6525
- error: true
6526
- }, {
6527
- children: error.message
6528
- }))]
6529
- });
6530
- };
6531
-
6532
- const DefinitionFiller = ({
6533
- properties,
6534
- dataFieldName,
6535
- useExpression: _useExpression = false,
6536
- title,
6537
- entityReferenceDefinitionSources,
6538
- entityReferenceValueComponent,
6539
- fileReferenceValueComponent
6540
- }) => {
6541
- const stepperData = useMemo(() => {
6542
- if (properties) {
6543
- return properties.map(property => {
6544
- var _a;
6545
- const propertyType = typeof property.propertyType === 'string' ? property.propertyType : (_a = property['propertyType']) === null || _a === void 0 ? void 0 : _a['value'];
6546
- return {
6547
- label: jsxs(Box, Object.assign({
6548
- display: "flex",
6549
- flexDirection: "column"
6550
- }, {
6551
- children: [jsxs("b", {
6552
- children: [property.name, property.isRequired ? '*' : '']
6553
- }), jsxs("span", {
6554
- children: [property.key, " | ", property.isMultiple ? 'multiple' : 'single', " |", ' ', propertyType]
6555
- })]
6556
- })),
6557
- content: property.isMultiple ? jsx(MultiplePropertyFiller, {
6558
- property: property,
6559
- name: `${dataFieldName}.${property.key}`,
6560
- useExpression: _useExpression,
6561
- label: property.name,
6562
- required: property.isRequired,
6563
- entityReferenceValueComponent: entityReferenceValueComponent,
6564
- fileReferenceValueComponent: fileReferenceValueComponent,
6565
- entityReferenceDefinitionSources: entityReferenceDefinitionSources
6566
- }) : jsx(PropertyFiller, {
6567
- property: property,
6568
- name: `${dataFieldName}.${property.key}`,
6569
- useExpression: _useExpression,
6570
- label: property.name,
6571
- required: property.isRequired,
6572
- entityReferenceDefinitionSources: entityReferenceDefinitionSources,
6573
- entityReferenceValueComponent: entityReferenceValueComponent,
6574
- fileReferenceValueComponent: fileReferenceValueComponent
6575
- })
6576
- };
6577
- });
6578
- }
6579
- return [];
6580
- }, [properties, dataFieldName, _useExpression, entityReferenceValueComponent, entityReferenceDefinitionSources, fileReferenceValueComponent]);
6581
- return jsx(LocalizationProvider, Object.assign({
6582
- dateAdapter: AdapterDateFns
6583
- }, {
6584
- children: jsxs(Grid, Object.assign({
6585
- container: true,
6586
- direction: "column",
6587
- spacing: 2
6588
- }, {
6589
- children: [title && jsx(Grid, Object.assign({
6590
- xs: 12
6591
- }, {
6592
- children: jsx("div", Object.assign({
6593
- style: {
6594
- fontWeight: '600'
6595
- }
6596
- }, {
6597
- children: title
6598
- }))
6599
- })), jsx(StepperView, {
6600
- data: stepperData
6601
- })]
6602
- }))
6603
- }));
6604
- };
6605
-
6606
- const FileDefinitionValueView = ({
6607
- property,
6608
- data
6609
- }) => {
6610
- const {
6611
- name
6612
- } = property;
6613
- const downloadFile = useCallback((contentBase64, fileName) => {
6614
- const linkSource = contentBase64;
6615
- const downloadLink = document.createElement('a');
6616
- document.body.appendChild(downloadLink);
6617
- downloadLink.href = linkSource;
6618
- downloadLink.target = '_self';
6619
- downloadLink.download = fileName;
6620
- downloadLink.click();
6621
- }, []);
6622
- return jsx(Button, Object.assign({
6623
- component: "label",
6624
- variant: "contained",
6625
- size: "large",
6626
- color: "primary",
6627
- onClick: () => downloadFile(data, name)
6628
- }, {
6629
- children: "Download File"
6630
- }));
6631
- };
6632
- var FileDefinitionValueView$1 = FileDefinitionValueView;
6633
-
6634
- const PropertyValueComponent = ({
6635
- property,
6636
- data,
6637
- properties
6638
- }) => {
6639
- const defaultRender = value => jsx(Box, Object.assign({
6640
- style: {
6641
- backgroundColor: '#fff',
6642
- border: '1px solid #ccc',
6643
- borderRadius: '4px',
6644
- padding: '4px',
6645
- overflow: 'hidden',
6646
- whiteSpace: 'nowrap',
6647
- textOverflow: 'ellipsis'
6648
- }
6649
- }, {
6650
- children: value === null ? 'null' : value.toString()
6651
- }));
6652
- switch (property.propertyType) {
6653
- case PropertyType.JSON:
6654
- return jsx(JsonView, {
6655
- value: data
6656
- });
6657
- case PropertyType.ENTITY:
6658
- return jsx(DefinitionValueView, {
6659
- properties: properties,
6660
- data: data
6661
- });
6662
- case PropertyType.ANY:
6663
- // TODO need to prefetch data and show as is
6664
- return typeof data === 'object' ? jsx(JsonView, {
6665
- value: data
6666
- }) : defaultRender(data);
6667
- case PropertyType.FILE_REFERENCE:
6668
- return data === null ? defaultRender(data) : jsx(Button, Object.assign({
6669
- component: Link,
6670
- color: "primary",
6671
- variant: "contained",
6672
- target: "_blank",
6673
- to: data,
6674
- sx: {
6675
- marginTop: 4
6676
- }
6677
- }, {
6678
- children: "Download via link"
6679
- }));
6680
- case PropertyType.FILE:
6681
- return data === null ? defaultRender(data) : jsx(FileDefinitionValueView$1, {
6682
- data: data,
6683
- property: property
6684
- });
6685
- default:
6686
- return defaultRender(data);
6687
- }
6688
- };
6689
- const PropertyDataView = ({
6690
- property,
6691
- data,
6692
- hasBackground: _hasBackground = false
6693
- }) => {
6694
- const properties = useMemo(() => {
6695
- if (property.propertyType === PropertyType.ENTITY) {
6696
- if (Array.isArray(property.properties)) {
6697
- return property.properties;
6698
- }
6699
- return propertiesObjectToArray(property.properties);
6700
- }
6701
- return [];
6702
- }, [property]);
6703
- return jsx(Box, Object.assign({
6704
- style: {
6705
- backgroundColor: _hasBackground ? '#f1f1f1' : 'none'
6706
- }
6707
- }, {
6708
- children: jsx(PropertyValueComponent, {
6709
- property: property,
6710
- data: data,
6711
- properties: properties
7074
+ label: valueLabel,
7075
+ parseValue: true,
7076
+ hideErrorMessage: true,
7077
+ useCleanValue: true,
7078
+ mode: propertyType === PropertyType.ANY ? 'text' : 'json'
7079
+ }) : jsx(ControlInput, {
7080
+ required: true,
7081
+ hideErrorMessage: true,
7082
+ control: control,
7083
+ name: name,
7084
+ label: valueLabel
7085
+ })), fillOption === 'json_valid' && jsx(ControlAceEditor, {
7086
+ name: name,
7087
+ control: control,
7088
+ label: valueLabel,
7089
+ parseValue: true,
7090
+ validateJson: true,
7091
+ hideErrorMessage: true
6712
7092
  })
6713
- }));
7093
+ // <JsonEditor validate name={name} ref={ref} useParsedValue />
7094
+ , fillOption === 'widget' && jsx(MultiplePropertyWidget$1, {
7095
+ property: property,
7096
+ name: name,
7097
+ useExpression: useExpression,
7098
+ required: required,
7099
+ label: label,
7100
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
7101
+ entityReferenceValueComponent: entityReferenceValueComponent,
7102
+ fileReferenceValueComponent: fileReferenceValueComponent
7103
+ }), error && jsx(FormHelperText, Object.assign({
7104
+ error: true
7105
+ }, {
7106
+ children: error.message
7107
+ }))]
7108
+ });
6714
7109
  };
6715
- var PropertyDataView$1 = PropertyDataView;
6716
7110
 
6717
- const DefinitionValueView = ({
7111
+ const DefinitionFiller = ({
6718
7112
  properties,
6719
- data
7113
+ dataFieldName,
7114
+ useExpression: _useExpression = false,
7115
+ title,
7116
+ entityReferenceDefinitionSources,
7117
+ entityReferenceValueComponent,
7118
+ fileReferenceValueComponent
6720
7119
  }) => {
6721
7120
  const stepperData = useMemo(() => {
6722
- if (properties && data) {
7121
+ if (properties) {
6723
7122
  return properties.map(property => {
6724
- const {
6725
- key,
6726
- name,
6727
- isMultiple,
6728
- propertyType
6729
- } = property;
6730
- const value = data[property.key] ? data[property.key] : null;
7123
+ var _a;
7124
+ const propertyType = typeof property.propertyType === 'string' ? property.propertyType : (_a = property['propertyType']) === null || _a === void 0 ? void 0 : _a['value'];
6731
7125
  return {
6732
7126
  label: jsxs(Box, Object.assign({
6733
7127
  display: "flex",
6734
7128
  flexDirection: "column"
6735
7129
  }, {
6736
- children: [jsx("b", {
6737
- children: name
7130
+ children: [jsxs("b", {
7131
+ children: [property.name, property.isRequired ? '*' : '']
6738
7132
  }), jsxs("span", {
6739
- children: [key, " | ", isMultiple ? 'multiple' : 'single', " | ", propertyType]
7133
+ children: [property.key, " | ", property.isMultiple ? 'multiple' : 'single', " |", ' ', propertyType]
6740
7134
  })]
6741
7135
  })),
6742
- content: isMultiple && Array.isArray(value) && property.propertyType !== PropertyType.ANY ? jsx(Fragment, {
6743
- children: value.map((itemValue, index) => jsx(Box, Object.assign({
6744
- mb: 2
6745
- }, {
6746
- children: jsx(PropertyDataView$1, {
6747
- property: property,
6748
- data: itemValue,
6749
- hasBackground: true
6750
- })
6751
- }), index))
6752
- }) : jsx(PropertyDataView$1, {
7136
+ content: property.isMultiple ? jsx(MultiplePropertyFiller, {
6753
7137
  property: property,
6754
- data: value
7138
+ name: `${dataFieldName}.${property.key}`,
7139
+ useExpression: _useExpression,
7140
+ label: property.name,
7141
+ required: property.isRequired,
7142
+ entityReferenceValueComponent: entityReferenceValueComponent,
7143
+ fileReferenceValueComponent: fileReferenceValueComponent,
7144
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources
7145
+ }) : jsx(PropertyFiller, {
7146
+ property: property,
7147
+ name: `${dataFieldName}.${property.key}`,
7148
+ useExpression: _useExpression,
7149
+ label: property.name,
7150
+ required: property.isRequired,
7151
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
7152
+ entityReferenceValueComponent: entityReferenceValueComponent,
7153
+ fileReferenceValueComponent: fileReferenceValueComponent
6755
7154
  })
6756
7155
  };
6757
7156
  });
6758
7157
  }
6759
7158
  return [];
6760
- }, [properties, data]);
6761
- return jsx(Grid, Object.assign({
6762
- container: true,
6763
- direction: "column",
6764
- spacing: 2
6765
- }, {
6766
- children: jsx(StepperView, {
6767
- data: stepperData
6768
- })
6769
- }));
6770
- };
6771
-
6772
- const StyledBox = styled(Box)(({
6773
- theme
6774
- }) => ({
6775
- backgroundColor: '#eee',
6776
- fontSize: '14px',
6777
- padding: '0 8px',
6778
- borderRadius: '10px',
6779
- width: 'fit-content',
6780
- '&.success': {
6781
- backgroundColor: '#a9dfa9'
6782
- },
6783
- '&.error': {
6784
- backgroundColor: '#ff7e7e'
6785
- },
6786
- '&.warning': {
6787
- backgroundColor: theme.palette.warning.main
6788
- }
6789
- }));
6790
- const Status = ({
6791
- text,
6792
- status: _status = 'default'
6793
- }) => {
6794
- return jsx(StyledBox, Object.assign({
6795
- className: classnames('root', {
6796
- [_status]: true
6797
- })
6798
- }, {
6799
- children: text
6800
- }));
6801
- };
6802
-
6803
- const PropertyStep = ({
6804
- properties,
6805
- parentKey: _parentKey = '',
6806
- activePath: _activePath = '',
6807
- prefix: _prefix = '',
6808
- onClick
6809
- }) => {
6810
- const handleClick = path => {
6811
- if (_prefix) {
6812
- onClick(`${_prefix}.${path}`);
6813
- } else {
6814
- onClick(path);
6815
- }
6816
- };
6817
- return jsx(Stepper, Object.assign({
6818
- orientation: "vertical",
6819
- onClick: event => event.stopPropagation()
6820
- }, {
6821
- children: properties && properties.map(property => {
6822
- var _a;
6823
- const fullPropertyPath = _parentKey ? `${_parentKey}.${property.key}` : property.key;
6824
- const propertyType = (_a = property.propertyType['value']) !== null && _a !== void 0 ? _a : property.propertyType;
6825
- return jsxs(Step, Object.assign({
6826
- expanded: true,
6827
- onClick: () => handleClick(fullPropertyPath)
6828
- }, {
6829
- children: [jsx(StepLabel, Object.assign({
6830
- StepIconProps: {
6831
- icon: '',
6832
- completed: false,
6833
- active: _activePath === fullPropertyPath
6834
- }
6835
- }, {
6836
- children: jsxs(Box, Object.assign({
6837
- sx: {
6838
- propertyStepLabel: {
6839
- '&:hover': {
6840
- fontWeight: '600',
6841
- cursor: 'pointer'
6842
- }
6843
- }
6844
- }
6845
- }, {
6846
- children: [property.name, " - ", property.key, " - ", propertyType]
6847
- }))
6848
- })), jsx(StepContent, {
6849
- children: jsx("div", {
6850
- children: propertyType === PropertyType.ENTITY && jsx(PropertyStep, {
6851
- onClick: onClick,
6852
- activePath: _activePath,
6853
- properties: property.properties,
6854
- parentKey: fullPropertyPath
6855
- }, property.key)
6856
- })
6857
- })]
6858
- }), property.key);
6859
- })
6860
- }));
6861
- };
6862
- var PropertyStep$1 = PropertyStep;
6863
-
6864
- const JsonPathPicker = ({
6865
- open: _open = false,
6866
- onClose,
6867
- onPaste,
6868
- properties
6869
- }) => {
6870
- const [selectedPropertyPath, setSelectedPropertyPath] = useState('');
6871
- const onCopy = () => {
6872
- navigator.clipboard.writeText(`$(${selectedPropertyPath})`);
6873
- toast.success('Copied!');
6874
- };
6875
- const handlePaste = () => {
6876
- onPaste(`$(${selectedPropertyPath})`);
6877
- toast.success('Pasted!');
6878
- };
6879
- return jsxs(Dialog, Object.assign({
6880
- open: _open,
6881
- onClose: onClose,
6882
- fullWidth: true,
6883
- maxWidth: "md"
6884
- }, {
6885
- children: [jsx(DialogTitle, {
6886
- children: "JSON path picker"
6887
- }), jsxs(DialogContent, {
6888
- children: [(properties === null || properties === void 0 ? void 0 : properties.length) ? properties.map((propEl, index) => jsxs("div", {
6889
- children: [jsx(Typography, Object.assign({
6890
- variant: "h6"
6891
- }, {
6892
- children: propEl.title
6893
- })), jsx(PropertyStep$1, {
6894
- properties: propEl.properties,
6895
- prefix: propEl.pathPrefix,
6896
- onClick: setSelectedPropertyPath,
6897
- activePath: selectedPropertyPath
6898
- })]
6899
- }, index)) : jsx(Typography, {
6900
- children: "Please, add properties"
6901
- }), selectedPropertyPath && jsxs(Typography, Object.assign({
6902
- variant: "h6",
6903
- gutterBottom: true
6904
- }, {
6905
- children: ["Selected path : $(", selectedPropertyPath, ")"]
6906
- }))]
6907
- }), jsxs(DialogActions, {
6908
- children: [jsx(Button, Object.assign({
6909
- variant: "contained",
6910
- color: "primary",
6911
- onClick: onCopy
6912
- }, {
6913
- children: "Copy"
6914
- })), jsx(Button, Object.assign({
6915
- variant: "contained",
6916
- color: "primary",
6917
- onClick: handlePaste
6918
- }, {
6919
- children: "Paste"
6920
- })), jsx(Button, Object.assign({
6921
- variant: "contained",
6922
- color: "secondary",
6923
- onClick: onClose
7159
+ }, [properties, dataFieldName, _useExpression, entityReferenceValueComponent, entityReferenceDefinitionSources, fileReferenceValueComponent]);
7160
+ return jsx(LocalizationProvider, Object.assign({
7161
+ dateAdapter: AdapterDateFns
7162
+ }, {
7163
+ children: jsxs(Grid, Object.assign({
7164
+ container: true,
7165
+ direction: "column",
7166
+ spacing: 2
7167
+ }, {
7168
+ children: [title && jsx(Grid, Object.assign({
7169
+ xs: 12
6924
7170
  }, {
6925
- children: "Close"
6926
- }))]
6927
- })]
7171
+ children: jsx("div", Object.assign({
7172
+ style: {
7173
+ fontWeight: '600'
7174
+ }
7175
+ }, {
7176
+ children: title
7177
+ }))
7178
+ })), jsx(StepperView, {
7179
+ data: stepperData
7180
+ })]
7181
+ }))
6928
7182
  }));
6929
7183
  };
6930
7184
 
6931
- const SidebarContext = /*#__PURE__*/createContext({
6932
- collapsed: false,
6933
- toggleCollapse: () => {
6934
- console.log('collapse toggle');
6935
- }
6936
- });
6937
- const useSidebarContext = () => useContext(SidebarContext);
6938
- const SidebarContextProvider = ({
6939
- children
7185
+ const FileDefinitionValueView = ({
7186
+ property,
7187
+ data
6940
7188
  }) => {
6941
- const [collapsed, setCollapsed] = useState(localStorage.getItem('sidebar_collapsed') === 'true');
6942
- const toggleCollapse = useCallback(() => {
6943
- setCollapsed(!collapsed);
6944
- localStorage.setItem('sidebar_collapsed', `${!collapsed}`);
6945
- window.dispatchEvent(new CustomEvent('sidebar_collapsed', {
6946
- detail: {
6947
- collapsed: !collapsed
6948
- }
6949
- }));
6950
- }, [collapsed]);
6951
- const toggleRootElementLink = useCallback((name, isCollapsed) => {
6952
- localStorage.setItem(`${name.toLowerCase()}_collapsed`, `${!isCollapsed}`);
7189
+ const {
7190
+ name
7191
+ } = property;
7192
+ const downloadFile = useCallback((contentBase64, fileName) => {
7193
+ const linkSource = contentBase64;
7194
+ const downloadLink = document.createElement('a');
7195
+ document.body.appendChild(downloadLink);
7196
+ downloadLink.href = linkSource;
7197
+ downloadLink.target = '_self';
7198
+ downloadLink.download = fileName;
7199
+ downloadLink.click();
6953
7200
  }, []);
6954
- return jsx(SidebarContext.Provider, Object.assign({
6955
- value: {
6956
- collapsed,
6957
- toggleCollapse,
6958
- toggleRootElementLink
6959
- }
7201
+ return jsx(Button, Object.assign({
7202
+ component: "label",
7203
+ variant: "contained",
7204
+ size: "large",
7205
+ color: "primary",
7206
+ onClick: () => downloadFile(data, name)
6960
7207
  }, {
6961
- children: children
7208
+ children: "Download File"
6962
7209
  }));
6963
7210
  };
7211
+ var FileDefinitionValueView$1 = FileDefinitionValueView;
6964
7212
 
6965
- const baseThemeOptions = {
6966
- spacing: 4,
6967
- palette: {
6968
- primary: {
6969
- main: '#E0613A',
6970
- dark: '#d9512e',
6971
- light: '#E0613A'
6972
- },
6973
- secondary: {
6974
- main: '#007994',
6975
- dark: '#262842',
6976
- light: '#cbe8ee'
6977
- },
6978
- text: {
6979
- disabled: '#A9A9B8'
6980
- },
6981
- success: {
6982
- main: '#2DB77B',
6983
- light: '#DBFCEE'
6984
- },
6985
- grey: {
6986
- 700: '#101F2B'
6987
- }
6988
- },
6989
- typography: {
6990
- fontSize: 14,
6991
- allVariants: {
6992
- fontFamily: ['Euclid', '-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'].join(',')
6993
- },
6994
- h1: {
6995
- fontWeight: 400
6996
- },
6997
- h3: {
6998
- fontWeight: 500
6999
- },
7000
- h4: {
7001
- fontWeight: 500
7213
+ const PropertyValueComponent = ({
7214
+ property,
7215
+ data,
7216
+ properties
7217
+ }) => {
7218
+ const defaultRender = value => jsx(Box, Object.assign({
7219
+ style: {
7220
+ backgroundColor: '#fff',
7221
+ border: '1px solid #ccc',
7222
+ borderRadius: '4px',
7223
+ padding: '4px',
7224
+ overflow: 'hidden',
7225
+ whiteSpace: 'nowrap',
7226
+ textOverflow: 'ellipsis'
7002
7227
  }
7003
- }
7004
- };
7005
- var baseTheme = createTheme(baseThemeOptions);
7006
-
7007
- const inputThemeOptions = {
7008
- components: {
7009
- MuiButton: {
7010
- styleOverrides: {
7011
- root: {
7012
- lineHeight: 1.429
7013
- }
7014
- }
7015
- },
7016
- MuiInputBase: {
7017
- styleOverrides: {
7018
- root: {
7019
- borderRadius: baseTheme.spacing(3),
7020
- minWidth: baseTheme.spacing(25),
7021
- background: baseTheme.palette.background.default
7022
- // height: 40
7023
- },
7024
-
7025
- // sizeSmall: {
7026
- // padding: baseTheme.spacing(1, 0, 1, 4),
7027
- // },
7028
- input: {
7029
- minWidth: baseTheme.spacing(25)
7030
- // padding: 0,
7031
- // height: '32px',
7032
- }
7033
- }
7034
- },
7035
-
7036
- MuiSelect: {
7037
- styleOverrides: {
7038
- nativeInput: {
7039
- padding: 0,
7040
- height: '32px'
7041
- }
7042
- }
7043
- },
7044
- MuiTextField: {
7045
- styleOverrides: {
7046
- root: {
7047
- minWidth: baseTheme.spacing(25)
7048
- }
7049
- }
7050
- },
7051
- MuiInputLabel: {
7052
- styleOverrides: {
7053
- root: {
7054
- position: 'relative',
7055
- overflow: 'initial',
7056
- transform: 'none',
7057
- marginBottom: baseTheme.spacing(1),
7058
- fontWeight: 500,
7059
- fontSize: '14px',
7060
- lineHeight: '20px',
7061
- pointerEvents: 'auto'
7062
- }
7063
- }
7064
- },
7065
- MuiOutlinedInput: {
7066
- styleOverrides: {
7067
- root: {
7068
- borderRadius: baseTheme.spacing(3),
7069
- minWidth: baseTheme.spacing(25)
7070
- },
7071
- notchedOutline: {
7072
- top: 0,
7073
- '& legend': {
7074
- display: 'none',
7075
- transition: 'none'
7076
- }
7077
- }
7078
- }
7079
- },
7080
- MuiAutocomplete: {
7081
- styleOverrides: {
7082
- paper: {
7083
- marginTop: 8,
7084
- borderRadius: 12,
7085
- boxShadow: '0px 8px 16px rgba(0, 0, 0, 0.04)'
7086
- },
7087
- listbox: {
7088
- '::-webkit-scrollbar': {
7089
- width: '6px',
7090
- backgroundColor: 'white'
7091
- },
7092
- '::-webkit-scrollbar-thumb': {
7093
- borderRadius: '10px',
7094
- backgroundColor: 'rgba(38, 40, 66, 0.24)'
7095
- }
7096
- }
7097
- }
7098
- },
7099
- MuiMenu: {
7100
- styleOverrides: {
7101
- list: {
7102
- paddingTop: 0,
7103
- paddingBottom: 0,
7104
- background: 'white',
7105
- '& li.Mui-selected': {
7106
- background: 'rgba(38, 40, 66, 0.08) !important'
7107
- }
7108
- }
7109
- }
7110
- },
7111
- MuiPopover: {
7112
- styleOverrides: {
7113
- paper: {
7114
- marginTop: 8,
7115
- borderRadius: 12,
7116
- boxShadow: '0px 8px 16px rgba(0, 0, 0, 0.04)'
7117
- }
7118
- }
7119
- },
7120
- MuiFormLabel: {
7121
- styleOverrides: {
7122
- root: {
7123
- fontSize: 14,
7124
- fontWeight: 500
7125
- },
7126
- asterisk: {
7127
- color: '#D6331F',
7128
- '&$error': {
7129
- color: '#D6331F'
7130
- }
7228
+ }, {
7229
+ children: value === null ? 'null' : value.toString()
7230
+ }));
7231
+ switch (property.propertyType) {
7232
+ case PropertyType.JSON:
7233
+ return jsx(JsonView, {
7234
+ value: data
7235
+ });
7236
+ case PropertyType.ENTITY:
7237
+ return jsx(DefinitionValueView, {
7238
+ properties: properties,
7239
+ data: data
7240
+ });
7241
+ case PropertyType.ANY:
7242
+ // TODO need to prefetch data and show as is
7243
+ return typeof data === 'object' ? jsx(JsonView, {
7244
+ value: data
7245
+ }) : defaultRender(data);
7246
+ case PropertyType.FILE_REFERENCE:
7247
+ return data === null ? defaultRender(data) : jsx(Button, Object.assign({
7248
+ component: Link,
7249
+ color: "primary",
7250
+ variant: "contained",
7251
+ target: "_blank",
7252
+ to: data,
7253
+ sx: {
7254
+ marginTop: 4
7131
7255
  }
7256
+ }, {
7257
+ children: "Download via link"
7258
+ }));
7259
+ case PropertyType.FILE:
7260
+ return data === null ? defaultRender(data) : jsx(FileDefinitionValueView$1, {
7261
+ data: data,
7262
+ property: property
7263
+ });
7264
+ default:
7265
+ return defaultRender(data);
7266
+ }
7267
+ };
7268
+ const PropertyDataView = ({
7269
+ property,
7270
+ data,
7271
+ hasBackground: _hasBackground = false
7272
+ }) => {
7273
+ const properties = useMemo(() => {
7274
+ if (property.propertyType === PropertyType.ENTITY) {
7275
+ if (Array.isArray(property.properties)) {
7276
+ return property.properties;
7132
7277
  }
7278
+ return propertiesObjectToArray(property.properties);
7133
7279
  }
7134
- }
7280
+ return [];
7281
+ }, [property]);
7282
+ return jsx(Box, Object.assign({
7283
+ style: {
7284
+ backgroundColor: _hasBackground ? '#f1f1f1' : 'none'
7285
+ }
7286
+ }, {
7287
+ children: jsx(PropertyValueComponent, {
7288
+ property: property,
7289
+ data: data,
7290
+ properties: properties
7291
+ })
7292
+ }));
7135
7293
  };
7136
- var inputThemeOptions$1 = inputThemeOptions;
7294
+ var PropertyDataView$1 = PropertyDataView;
7137
7295
 
7138
- const tableThemeOptions = {
7139
- components: {
7140
- MuiTableContainer: {
7141
- styleOverrides: {
7142
- root: {
7143
- borderRadius: baseTheme.spacing(3),
7144
- border: '1px solid rgba(38, 40, 66, 0.08)'
7145
- }
7146
- }
7147
- },
7148
- MuiTableHead: {
7149
- styleOverrides: {
7150
- root: {
7151
- backgroundColor: '#F7F8FC'
7152
- }
7153
- }
7154
- },
7155
- MuiTableCell: {
7156
- styleOverrides: {
7157
- root: {
7158
- minHeight: 48,
7159
- padding: baseTheme.spacing(1, 2),
7160
- '&:first-of-type': {
7161
- paddingLeft: baseTheme.spacing(4)
7162
- }
7163
- },
7164
- head: {
7165
- maxHeight: '40px',
7166
- padding: baseTheme.spacing(2.75, 2),
7167
- color: '#6D6E85'
7168
- },
7169
- body: {
7170
- wordBreak: 'break-all'
7171
- }
7172
- }
7173
- },
7174
- MuiTableSortLabel: {
7175
- styleOverrides: {
7176
- root: {
7177
- maxHeight: '24px',
7178
- lineHeight: 1
7179
- }
7180
- }
7296
+ const DefinitionValueView = ({
7297
+ properties,
7298
+ data
7299
+ }) => {
7300
+ const stepperData = useMemo(() => {
7301
+ if (properties && data) {
7302
+ return properties.map(property => {
7303
+ const {
7304
+ key,
7305
+ name,
7306
+ isMultiple,
7307
+ propertyType
7308
+ } = property;
7309
+ const value = data[property.key] ? data[property.key] : null;
7310
+ return {
7311
+ label: jsxs(Box, Object.assign({
7312
+ display: "flex",
7313
+ flexDirection: "column"
7314
+ }, {
7315
+ children: [jsx("b", {
7316
+ children: name
7317
+ }), jsxs("span", {
7318
+ children: [key, " | ", isMultiple ? 'multiple' : 'single', " | ", propertyType]
7319
+ })]
7320
+ })),
7321
+ content: isMultiple && Array.isArray(value) && property.propertyType !== PropertyType.ANY ? jsx(Fragment, {
7322
+ children: value.map((itemValue, index) => jsx(Box, Object.assign({
7323
+ mb: 2
7324
+ }, {
7325
+ children: jsx(PropertyDataView$1, {
7326
+ property: property,
7327
+ data: itemValue,
7328
+ hasBackground: true
7329
+ })
7330
+ }), index))
7331
+ }) : jsx(PropertyDataView$1, {
7332
+ property: property,
7333
+ data: value
7334
+ })
7335
+ };
7336
+ });
7181
7337
  }
7338
+ return [];
7339
+ }, [properties, data]);
7340
+ return jsx(Grid, Object.assign({
7341
+ container: true,
7342
+ direction: "column",
7343
+ spacing: 2
7344
+ }, {
7345
+ children: jsx(StepperView, {
7346
+ data: stepperData
7347
+ })
7348
+ }));
7349
+ };
7350
+
7351
+ const StyledBox = styled(Box)(({
7352
+ theme
7353
+ }) => ({
7354
+ backgroundColor: '#eee',
7355
+ fontSize: '14px',
7356
+ padding: '0 8px',
7357
+ borderRadius: '10px',
7358
+ width: 'fit-content',
7359
+ '&.success': {
7360
+ backgroundColor: '#a9dfa9'
7361
+ },
7362
+ '&.error': {
7363
+ backgroundColor: '#ff7e7e'
7364
+ },
7365
+ '&.warning': {
7366
+ backgroundColor: theme.palette.warning.main
7182
7367
  }
7368
+ }));
7369
+ const Status = ({
7370
+ text,
7371
+ status: _status = 'default'
7372
+ }) => {
7373
+ return jsx(StyledBox, Object.assign({
7374
+ className: classnames('root', {
7375
+ [_status]: true
7376
+ })
7377
+ }, {
7378
+ children: text
7379
+ }));
7183
7380
  };
7184
- var tableThemeOptions$1 = tableThemeOptions;
7185
7381
 
7186
- const stepperThemeOptions = {
7187
- components: {
7188
- MuiStepIcon: {
7189
- styleOverrides: {
7190
- root: {
7191
- fontSize: '20px',
7192
- color: baseTheme.palette.text.disabled,
7193
- '&.Mui-active, &.Mui-completed': {
7194
- color: baseTheme.palette.secondary.main
7195
- }
7196
- }
7197
- }
7382
+ const PropertyStep = ({
7383
+ properties,
7384
+ parentKey: _parentKey = '',
7385
+ activePath: _activePath = '',
7386
+ prefix: _prefix = '',
7387
+ onClick
7388
+ }) => {
7389
+ const handleClick = path => {
7390
+ if (_prefix) {
7391
+ onClick(`${_prefix}.${path}`);
7392
+ } else {
7393
+ onClick(path);
7198
7394
  }
7199
- }
7395
+ };
7396
+ return jsx(Stepper, Object.assign({
7397
+ orientation: "vertical",
7398
+ onClick: event => event.stopPropagation()
7399
+ }, {
7400
+ children: properties && properties.map(property => {
7401
+ var _a;
7402
+ const fullPropertyPath = _parentKey ? `${_parentKey}.${property.key}` : property.key;
7403
+ const propertyType = (_a = property.propertyType['value']) !== null && _a !== void 0 ? _a : property.propertyType;
7404
+ return jsxs(Step, Object.assign({
7405
+ expanded: true,
7406
+ onClick: () => handleClick(fullPropertyPath)
7407
+ }, {
7408
+ children: [jsx(StepLabel, Object.assign({
7409
+ StepIconProps: {
7410
+ icon: '',
7411
+ completed: false,
7412
+ active: _activePath === fullPropertyPath
7413
+ }
7414
+ }, {
7415
+ children: jsxs(Box, Object.assign({
7416
+ sx: {
7417
+ propertyStepLabel: {
7418
+ '&:hover': {
7419
+ fontWeight: '600',
7420
+ cursor: 'pointer'
7421
+ }
7422
+ }
7423
+ }
7424
+ }, {
7425
+ children: [property.name, " - ", property.key, " - ", propertyType]
7426
+ }))
7427
+ })), jsx(StepContent, {
7428
+ children: jsx("div", {
7429
+ children: propertyType === PropertyType.ENTITY && jsx(PropertyStep, {
7430
+ onClick: onClick,
7431
+ activePath: _activePath,
7432
+ properties: property.properties,
7433
+ parentKey: fullPropertyPath
7434
+ }, property.key)
7435
+ })
7436
+ })]
7437
+ }), property.key);
7438
+ })
7439
+ }));
7200
7440
  };
7201
- var stepperThemeOptions$1 = stepperThemeOptions;
7441
+ var PropertyStep$1 = PropertyStep;
7202
7442
 
7203
- const typographyThemeOptions = {
7204
- components: {
7205
- MuiTypography: {
7206
- styleOverrides: {
7207
- h1: {
7208
- [baseTheme.breakpoints.up('lg')]: {
7209
- fontSize: '1.5rem'
7210
- }
7211
- },
7212
- h3: {
7213
- fontSize: '1.25rem',
7214
- [baseTheme.breakpoints.up('lg')]: {
7215
- fontSize: '1.125rem'
7216
- }
7217
- },
7218
- h4: {
7219
- fontSize: '1rem',
7220
- [baseTheme.breakpoints.up('lg')]: {
7221
- fontSize: '1rem'
7222
- }
7223
- },
7224
- subtitle2: {
7225
- color: '#6D6E85'
7226
- }
7227
- }
7228
- }
7229
- }
7443
+ const JsonPathPicker = ({
7444
+ open: _open = false,
7445
+ onClose,
7446
+ onPaste,
7447
+ properties
7448
+ }) => {
7449
+ const [selectedPropertyPath, setSelectedPropertyPath] = useState('');
7450
+ const onCopy = () => {
7451
+ navigator.clipboard.writeText(`$(${selectedPropertyPath})`);
7452
+ toast.success('Copied!');
7453
+ };
7454
+ const handlePaste = () => {
7455
+ onPaste(`$(${selectedPropertyPath})`);
7456
+ toast.success('Pasted!');
7457
+ };
7458
+ return jsxs(Dialog, Object.assign({
7459
+ open: _open,
7460
+ onClose: onClose,
7461
+ fullWidth: true,
7462
+ maxWidth: "md"
7463
+ }, {
7464
+ children: [jsx(DialogTitle, {
7465
+ children: "JSON path picker"
7466
+ }), jsxs(DialogContent, {
7467
+ children: [(properties === null || properties === void 0 ? void 0 : properties.length) ? properties.map((propEl, index) => jsxs("div", {
7468
+ children: [jsx(Typography, Object.assign({
7469
+ variant: "h6"
7470
+ }, {
7471
+ children: propEl.title
7472
+ })), jsx(PropertyStep$1, {
7473
+ properties: propEl.properties,
7474
+ prefix: propEl.pathPrefix,
7475
+ onClick: setSelectedPropertyPath,
7476
+ activePath: selectedPropertyPath
7477
+ })]
7478
+ }, index)) : jsx(Typography, {
7479
+ children: "Please, add properties"
7480
+ }), selectedPropertyPath && jsxs(Typography, Object.assign({
7481
+ variant: "h6",
7482
+ gutterBottom: true
7483
+ }, {
7484
+ children: ["Selected path : $(", selectedPropertyPath, ")"]
7485
+ }))]
7486
+ }), jsxs(DialogActions, {
7487
+ children: [jsx(Button, Object.assign({
7488
+ variant: "contained",
7489
+ color: "primary",
7490
+ onClick: onCopy
7491
+ }, {
7492
+ children: "Copy"
7493
+ })), jsx(Button, Object.assign({
7494
+ variant: "contained",
7495
+ color: "primary",
7496
+ onClick: handlePaste
7497
+ }, {
7498
+ children: "Paste"
7499
+ })), jsx(Button, Object.assign({
7500
+ variant: "contained",
7501
+ color: "secondary",
7502
+ onClick: onClose
7503
+ }, {
7504
+ children: "Close"
7505
+ }))]
7506
+ })]
7507
+ }));
7230
7508
  };
7231
- var typographyThemeOptions$1 = typographyThemeOptions;
7232
7509
 
7233
- const arsenalTheme = () => {
7234
- if (document) {
7235
- const url = "https://dev-qa-arsenal-frontend-fonts-bucket.s3.eu-north-1.amazonaws.com/fonts.css";
7236
- const fontsLink = document.querySelectorAll(`link[href="${url}"]`);
7237
- if (!fontsLink.length) {
7238
- const link = document.createElement('link');
7239
- link.href = url;
7240
- link.rel = 'stylesheet';
7241
- document.head.appendChild(link);
7242
- }
7510
+ const SidebarContext = /*#__PURE__*/createContext({
7511
+ collapsed: false,
7512
+ toggleCollapse: () => {
7513
+ console.log('collapse toggle');
7243
7514
  }
7244
- return responsiveFontSizes(createTheme(baseTheme, {
7245
- components: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, inputThemeOptions$1.components), tableThemeOptions$1.components), stepperThemeOptions$1.components), typographyThemeOptions$1.components), {
7246
- MuiToolbar: {
7247
- styleOverrides: {
7248
- root: {
7249
- [baseTheme.breakpoints.up('sm')]: {
7250
- minHeight: '56px'
7251
- }
7252
- }
7253
- }
7254
- },
7255
- // MuiBackdrop: {
7256
- // styleOverrides: {
7257
- // root: {
7258
- // backgroundColor: 'rgba(0, 0, 0, 0.2)',
7259
- // },
7260
- // },
7261
- // },
7262
- MuiAppBar: {
7263
- styleOverrides: {
7264
- root: {
7265
- boxShadow: 'none',
7266
- backgroundColor: '#007F9B'
7267
- }
7268
- }
7269
- },
7270
- MuiButton: {
7271
- styleOverrides: {
7272
- root: {
7273
- borderRadius: baseTheme.spacing(2.5),
7274
- padding: baseTheme.spacing(2.5, 4),
7275
- lineHeight: '20px',
7276
- fontSize: '1rem',
7277
- textTransform: 'none'
7278
- },
7279
- outlined: {
7280
- color: '#262842',
7281
- backgroundColor: '#FFFFFF !important',
7282
- border: '1px solid rgba(38, 40, 66, 0.12)'
7283
- },
7284
- text: {
7285
- color: baseTheme.palette.secondary.dark
7286
- }
7287
- }
7288
- },
7289
- MuiDialog: {
7290
- styleOverrides: {
7291
- root: {
7292
- '& .MuiModal-backdrop': {
7293
- background: 'rgba(28, 55, 77, 0.5)',
7294
- backdropFilter: 'blur(2px)'
7295
- }
7296
- },
7297
- paper: {
7298
- borderRadius: baseTheme.spacing(3)
7299
- },
7300
- paperWidthXs: {
7301
- maxWidth: 500
7302
- }
7303
- }
7304
- },
7305
- // MuiPaper: {
7306
- // styleOverrides: {
7307
- // root: {
7308
- // borderRadius: baseTheme.spacing(3),
7309
- // },
7310
- // },
7311
- // },
7312
- MuiDialogContent: {
7313
- styleOverrides: {
7314
- root: {
7315
- color: '#6D6E85'
7316
- }
7317
- }
7318
- },
7319
- MuiDialogActions: {
7320
- styleOverrides: {
7321
- root: {
7322
- background: '#F7F8FC',
7323
- borderTop: '1px solid rgba(38, 40, 66, 0.08)',
7324
- padding: baseTheme.spacing(3, 6)
7325
- }
7326
- }
7327
- },
7328
- MuiTabs: {
7329
- styleOverrides: {
7330
- root: {
7331
- minHeight: '38px'
7332
- },
7333
- indicator: {
7334
- backgroundColor: baseTheme.palette.secondary.main
7335
- }
7336
- }
7337
- },
7338
- MuiTab: {
7339
- styleOverrides: {
7340
- root: {
7341
- fontSize: 14,
7342
- fontWeight: 500,
7343
- textTransform: 'none',
7344
- padding: '10px 12px',
7345
- lineHeight: '1.125rem',
7346
- minHeight: '38px',
7347
- color: '#8B8C9E',
7348
- '&.Mui-selected': {
7349
- color: baseTheme.palette.secondary.main
7350
- }
7351
- }
7352
- }
7515
+ });
7516
+ const useSidebarContext = () => useContext(SidebarContext);
7517
+ const SidebarContextProvider = ({
7518
+ children
7519
+ }) => {
7520
+ const [collapsed, setCollapsed] = useState(localStorage.getItem('sidebar_collapsed') === 'true');
7521
+ const toggleCollapse = useCallback(() => {
7522
+ setCollapsed(!collapsed);
7523
+ localStorage.setItem('sidebar_collapsed', `${!collapsed}`);
7524
+ window.dispatchEvent(new CustomEvent('sidebar_collapsed', {
7525
+ detail: {
7526
+ collapsed: !collapsed
7353
7527
  }
7354
- })
7528
+ }));
7529
+ }, [collapsed]);
7530
+ const toggleRootElementLink = useCallback((name, isCollapsed) => {
7531
+ localStorage.setItem(`${name.toLowerCase()}_collapsed`, `${!isCollapsed}`);
7532
+ }, []);
7533
+ return jsx(SidebarContext.Provider, Object.assign({
7534
+ value: {
7535
+ collapsed,
7536
+ toggleCollapse,
7537
+ toggleRootElementLink
7538
+ }
7539
+ }, {
7540
+ children: children
7355
7541
  }));
7356
7542
  };
7357
- const theme = arsenalTheme();
7358
7543
 
7359
7544
  const drawerWidth = 248;
7360
7545
  const Container = styled('div')({
@@ -8040,4 +8225,33 @@ const Breadcrumbs = ({
8040
8225
  }));
8041
8226
  };
8042
8227
 
8043
- 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 };
8228
+ const OverflowTip = ({
8229
+ children
8230
+ }) => {
8231
+ const [isOverflowed, setIsOverflow] = useState(false);
8232
+ const handleRect = useCallback(node => {
8233
+ setIsOverflow((node === null || node === void 0 ? void 0 : node.scrollWidth) > (node === null || node === void 0 ? void 0 : node.clientWidth));
8234
+ const change = () => {
8235
+ setIsOverflow((node === null || node === void 0 ? void 0 : node.scrollWidth) > (node === null || node === void 0 ? void 0 : node.clientWidth));
8236
+ };
8237
+ window.addEventListener('resize', change);
8238
+ }, []);
8239
+ return jsx(Tooltip, Object.assign({
8240
+ title: children,
8241
+ arrow: true,
8242
+ disableHoverListener: !isOverflowed
8243
+ }, {
8244
+ children: jsx("div", Object.assign({
8245
+ ref: handleRect,
8246
+ style: {
8247
+ whiteSpace: 'nowrap',
8248
+ overflow: 'hidden',
8249
+ textOverflow: 'ellipsis'
8250
+ }
8251
+ }, {
8252
+ children: children
8253
+ }))
8254
+ }));
8255
+ };
8256
+
8257
+ 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 };