@dartech/arsenal-ui 1.4.43 → 1.4.44
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +1336 -1121
- package/package.json +1 -1
- package/src/interfaces/ui.d.ts +1 -1
- package/src/lib/OverflowTooltip/OverflowTooltip.d.ts +4 -0
- package/src/lib/OverflowTooltip/index.d.ts +1 -0
- package/src/lib/Property/UpsertProperty/PropertyValueField/BooleanValueField.d.ts +0 -1
- package/src/lib/Property/UpsertProperty/PropertyValueField/DateTimeValueField.d.ts +0 -1
- package/src/lib/Property/UpsertProperty/PropertyValueField/DateValueField.d.ts +0 -1
- package/src/lib/Property/UpsertProperty/PropertyValueField/JsonValueField.d.ts +0 -1
- package/src/lib/Property/UpsertProperty/PropertyValueField/TimeValueField.d.ts +0 -1
- package/src/lib/Property/ViewProperty/PropertyItem.d.ts +0 -1
- package/src/lib/Table/DataGrid/DataGrid.styled.d.ts +4 -0
- package/src/lib/Table/DataGrid/Table.d.ts +2 -5
- package/src/lib/Table/SimpleTable/SimpleTable.d.ts +2 -1
- package/src/lib/Table/SimpleTable/Table.styled.d.ts +30 -0
- package/src/lib/index.d.ts +1 -0
- package/src/theme/inputThemeOptions.d.ts +11 -0
- package/src/theme/tableThemeOptions.d.ts +12 -0
- package/src/utils/ui-utils.d.ts +2 -1
- package/src/lib/Table/DataGrid/styles.d.ts +0 -44
package/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
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,
|
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$
|
790
|
-
var PopupIcon = img$
|
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
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
}
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
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
|
-
|
1635
|
-
|
1636
|
-
|
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
|
-
|
1648
|
-
style: 'decimal'
|
1649
|
-
});
|
1556
|
+
var baseTheme = createTheme(baseThemeOptions);
|
1650
1557
|
|
1651
|
-
const
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
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
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
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
|
-
|
1697
|
-
|
1698
|
-
|
1699
|
-
|
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
|
-
|
1707
|
-
|
1708
|
-
|
1709
|
-
|
1710
|
-
|
1711
|
-
} else {
|
1712
|
-
parsedValue = value;
|
1594
|
+
},
|
1595
|
+
MuiTextField: {
|
1596
|
+
styleOverrides: {
|
1597
|
+
root: {
|
1598
|
+
minWidth: baseTheme.spacing(25)
|
1713
1599
|
}
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
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$
|
2216
|
-
var DateIcon = img$
|
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", {
|
@@ -2779,8 +3210,8 @@ const ControlPeriodInput = ({
|
|
2779
3210
|
});
|
2780
3211
|
};
|
2781
3212
|
|
2782
|
-
var img$
|
2783
|
-
var FlagKz = img$
|
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;
|
2784
3215
|
|
2785
3216
|
const ControlPhoneInput = _a => {
|
2786
3217
|
var {
|
@@ -2859,6 +3290,13 @@ const TablePagination = () => {
|
|
2859
3290
|
const pageSize = useGridSelector(apiRef, gridPageSizeSelector);
|
2860
3291
|
const onPageChange = value => apiRef.current.setPage(value);
|
2861
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
|
+
};
|
2862
3300
|
return jsxs(Box, Object.assign({
|
2863
3301
|
px: 2,
|
2864
3302
|
display: "flex",
|
@@ -2872,6 +3310,8 @@ const TablePagination = () => {
|
|
2872
3310
|
rowsPerPageOptions: [10, 20, 50, 100],
|
2873
3311
|
onPageChange: (event, value) => onPageChange(value),
|
2874
3312
|
onRowsPerPageChange: onRowsPerPageChange,
|
3313
|
+
labelRowsPerPage: "\u0421\u0442\u0440\u043E\u043A \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435",
|
3314
|
+
labelDisplayedRows: labelDisplayedRows,
|
2875
3315
|
ActionsComponent: undefined
|
2876
3316
|
}), jsx(Pagination, {
|
2877
3317
|
count: pageCount,
|
@@ -3002,24 +3442,54 @@ const usePagination = initialPageSize => {
|
|
3002
3442
|
};
|
3003
3443
|
var usePagination$1 = usePagination;
|
3004
3444
|
|
3005
|
-
const
|
3445
|
+
const StyledDataGrid = styled(DataGrid)(({
|
3446
|
+
theme
|
3447
|
+
}) => ({
|
3448
|
+
borderRadius: theme.spacing(3),
|
3006
3449
|
width: '100%',
|
3007
|
-
|
3008
|
-
|
3009
|
-
|
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)'
|
3010
3454
|
},
|
3011
|
-
'& .MuiDataGrid-
|
3012
|
-
|
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
|
+
}
|
3013
3479
|
},
|
3014
|
-
'& .MuiDataGrid-
|
3015
|
-
|
3480
|
+
'& .MuiDataGrid-row': {
|
3481
|
+
'&:hover': {
|
3482
|
+
backgroundColor: '#F7F8FC!important'
|
3483
|
+
}
|
3016
3484
|
},
|
3017
3485
|
'& .MuiDataGrid-cell': {
|
3018
|
-
|
3019
|
-
|
3020
|
-
|
3486
|
+
color: theme.palette.mode === 'light' ? 'rgba(0,0,0,.85)' : 'rgba(255,255,255,0.65)',
|
3487
|
+
'&:focus': {
|
3488
|
+
border: 0
|
3489
|
+
},
|
3021
3490
|
textOverflow: 'ellipsis',
|
3022
3491
|
wordBreak: 'break-all',
|
3492
|
+
overflow: 'hidden',
|
3023
3493
|
'& .MuiDataGrid-actionsCell': {
|
3024
3494
|
width: '100%',
|
3025
3495
|
gridGap: '4px',
|
@@ -3029,29 +3499,68 @@ const styles = {
|
|
3029
3499
|
}
|
3030
3500
|
}
|
3031
3501
|
},
|
3032
|
-
'& .
|
3033
|
-
|
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
|
+
}
|
3034
3522
|
},
|
3035
3523
|
'& .Sorted': {
|
3036
3524
|
'& .MuiDataGrid-iconButtonContainer': {
|
3037
|
-
|
3038
|
-
|
3039
|
-
|
3040
|
-
opacity: '1 !important'
|
3041
|
-
}
|
3042
|
-
},
|
3043
|
-
'&.--desc': {
|
3044
|
-
'& svg': {
|
3045
|
-
transform: 'rotate(180deg)'
|
3525
|
+
'& img': {
|
3526
|
+
visibility: 'visible !important',
|
3527
|
+
opacity: '1!important'
|
3046
3528
|
}
|
3047
3529
|
}
|
3048
3530
|
}
|
3049
|
-
};
|
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;
|
3050
3541
|
|
3051
3542
|
/**
|
3052
3543
|
* Main data display component. MUI DataGrid used
|
3053
3544
|
* @category Common UI components
|
3054
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
|
+
};
|
3055
3564
|
const Table = ({
|
3056
3565
|
columns,
|
3057
3566
|
rows,
|
@@ -3085,11 +3594,24 @@ const Table = ({
|
|
3085
3594
|
pageSize: _mode === 'server' ? size : _pagination ? pageSize : rowCount,
|
3086
3595
|
onPageSizeChange: _mode === 'server' ? onSizeChange : handlePageSizeChange,
|
3087
3596
|
components: {
|
3088
|
-
|
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
|
+
}
|
3089
3611
|
}
|
3090
3612
|
};
|
3091
3613
|
if (_mode === 'server') {
|
3092
|
-
tableProps['sortModel'] = [];
|
3614
|
+
// tableProps['sortModel'] = [];
|
3093
3615
|
tableProps['onColumnHeaderClick'] = onColumnHeaderClick;
|
3094
3616
|
tableProps['page'] = page;
|
3095
3617
|
tableProps['onPageChange'] = onPageChange;
|
@@ -3098,9 +3620,10 @@ const Table = ({
|
|
3098
3620
|
return jsx(Box, Object.assign({
|
3099
3621
|
mt: disableMargin ? 0 : 2
|
3100
3622
|
}, {
|
3101
|
-
children: jsx(
|
3102
|
-
sx: styles,
|
3623
|
+
children: jsx(StyledDataGrid, Object.assign({
|
3103
3624
|
autoHeight: true,
|
3625
|
+
headerHeight: 40,
|
3626
|
+
rowHeight: 40,
|
3104
3627
|
hideFooterPagination: !_pagination,
|
3105
3628
|
hideFooter: !_pagination,
|
3106
3629
|
disableSelectionOnClick: true,
|
@@ -3108,6 +3631,7 @@ const Table = ({
|
|
3108
3631
|
showCellRightBorder: true,
|
3109
3632
|
loading: loading,
|
3110
3633
|
rows: rows,
|
3634
|
+
disableColumnMenu: true,
|
3111
3635
|
columns: getSortedColumns(columns),
|
3112
3636
|
rowCount: rowCount,
|
3113
3637
|
rowsPerPageOptions: [10, 20, 50, 100],
|
@@ -3207,7 +3731,7 @@ const useTableSorting = () => {
|
|
3207
3731
|
const sortParams = useMemo(() => searchParams.getAll('sort').map(param => param.split(',')), [searchParams]);
|
3208
3732
|
const onSortChanged = useCallback(sortKey => {
|
3209
3733
|
setSearchParams(params => {
|
3210
|
-
console.log(sortKey, params.get('page'));
|
3734
|
+
// console.log(sortKey, params.get('page'));
|
3211
3735
|
params.delete('sort');
|
3212
3736
|
let keyFound = false;
|
3213
3737
|
sortParams.forEach(([key, value]) => {
|
@@ -3238,6 +3762,33 @@ const useTableSorting = () => {
|
|
3238
3762
|
};
|
3239
3763
|
var useTableSorting$1 = useTableSorting;
|
3240
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
|
+
};
|
3241
3792
|
function TableInner({
|
3242
3793
|
columns = [],
|
3243
3794
|
rows = [],
|
@@ -3247,7 +3798,8 @@ function TableInner({
|
|
3247
3798
|
loading = false,
|
3248
3799
|
onRowClick,
|
3249
3800
|
emptyDataText,
|
3250
|
-
verticalAlign = 'middle'
|
3801
|
+
verticalAlign = 'middle',
|
3802
|
+
labelRowsPerPage
|
3251
3803
|
}, ref) {
|
3252
3804
|
const {
|
3253
3805
|
page,
|
@@ -3259,99 +3811,127 @@ function TableInner({
|
|
3259
3811
|
onSortChanged,
|
3260
3812
|
getColumnSorting
|
3261
3813
|
} = useTableSorting$1();
|
3262
|
-
|
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({
|
3263
3822
|
sx: {
|
3264
|
-
|
3265
|
-
overflow: 'visible'
|
3823
|
+
overflow: 'auto'
|
3266
3824
|
}
|
3267
3825
|
}, {
|
3268
|
-
children:
|
3269
|
-
open: loading,
|
3826
|
+
children: jsxs(TableContainer, Object.assign({
|
3270
3827
|
sx: {
|
3271
|
-
|
3272
|
-
|
3273
|
-
|
3828
|
+
width: '100%',
|
3829
|
+
display: 'table',
|
3830
|
+
tableLayout: 'fixed'
|
3274
3831
|
}
|
3275
3832
|
}, {
|
3276
|
-
children: jsx(
|
3277
|
-
|
3278
|
-
|
3279
|
-
|
3280
|
-
|
3281
|
-
|
3282
|
-
|
3283
|
-
|
3284
|
-
|
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({
|
3285
3877
|
align: column.align ? column.align : 'left',
|
3286
|
-
sortDirection: sortDirection,
|
3287
3878
|
sx: {
|
3288
|
-
|
3879
|
+
maxWidth: column.width ? `${column.width}%` : 'unset'
|
3289
3880
|
}
|
3290
3881
|
}, {
|
3291
|
-
children: jsx(
|
3292
|
-
|
3293
|
-
|
3294
|
-
|
3295
|
-
|
3882
|
+
children: jsx(Box, Object.assign({
|
3883
|
+
sx: {
|
3884
|
+
maxWidth: '90%',
|
3885
|
+
overflow: 'hidden',
|
3886
|
+
whiteSpace: 'nowrap',
|
3887
|
+
textOverflow: 'ellipsis'
|
3888
|
+
}
|
3296
3889
|
}, {
|
3297
|
-
children:
|
3890
|
+
children: jsx(Box, {
|
3891
|
+
children: column.renderCell ? column.renderCell(row, index) : row[column.id]
|
3892
|
+
})
|
3298
3893
|
}))
|
3299
|
-
}),
|
3300
|
-
})
|
3301
|
-
})
|
3302
|
-
}), jsx(TableBody, {
|
3303
|
-
children: rows.length ? rows.map((row, index) => jsx(TableRow, Object.assign({
|
3304
|
-
hover: true,
|
3305
|
-
onClick: onRowClick ? () => onRowClick(row) : row.onClick,
|
3306
|
-
sx: {
|
3307
|
-
verticalAlign
|
3308
|
-
}
|
3309
|
-
}, {
|
3310
|
-
children: columns.map((column, idx) => jsx(TableCell, Object.assign({
|
3311
|
-
align: column.align ? column.align : 'left',
|
3894
|
+
}), idx))
|
3895
|
+
}), index)) : jsx(TableRow, Object.assign({
|
3312
3896
|
sx: {
|
3313
|
-
|
3897
|
+
verticalAlign
|
3314
3898
|
}
|
3315
3899
|
}, {
|
3316
|
-
children:
|
3317
|
-
|
3318
|
-
|
3319
|
-
|
3320
|
-
|
3321
|
-
|
3322
|
-
}, {
|
3323
|
-
children: jsx(TableCell, Object.assign({
|
3324
|
-
align: "center",
|
3325
|
-
colSpan: columns.length
|
3326
|
-
}, {
|
3327
|
-
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
|
+
}))
|
3328
3906
|
}))
|
3329
|
-
})
|
3330
|
-
|
3331
|
-
|
3332
|
-
|
3333
|
-
|
3334
|
-
|
3335
|
-
|
3336
|
-
|
3337
|
-
|
3338
|
-
}
|
3339
|
-
|
3340
|
-
|
3341
|
-
|
3342
|
-
|
3343
|
-
|
3344
|
-
|
3345
|
-
|
3346
|
-
|
3347
|
-
|
3348
|
-
|
3349
|
-
|
3350
|
-
|
3351
|
-
|
3352
|
-
|
3353
|
-
|
3354
|
-
|
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
|
+
}))
|
3355
3935
|
}));
|
3356
3936
|
}
|
3357
3937
|
const SimpleTable = /*#__PURE__*/forwardRef(TableInner);
|
@@ -6491,869 +7071,475 @@ const MultiplePropertyFiller = ({
|
|
6491
7071
|
})) : null, fillOption === 'expression' && (propertyType === PropertyType.JSON || propertyType === PropertyType.ENTITY || propertyType === PropertyType.ANY ? jsx(ControlAceEditor, {
|
6492
7072
|
name: name,
|
6493
7073
|
control: control,
|
6494
|
-
label: valueLabel,
|
6495
|
-
parseValue: true,
|
6496
|
-
hideErrorMessage: true,
|
6497
|
-
useCleanValue: true,
|
6498
|
-
mode: propertyType === PropertyType.ANY ? 'text' : 'json'
|
6499
|
-
}) : jsx(ControlInput, {
|
6500
|
-
required: true,
|
6501
|
-
hideErrorMessage: true,
|
6502
|
-
control: control,
|
6503
|
-
name: name,
|
6504
|
-
label: valueLabel
|
6505
|
-
})), fillOption === 'json_valid' && jsx(ControlAceEditor, {
|
6506
|
-
name: name,
|
6507
|
-
control: control,
|
6508
|
-
label: valueLabel,
|
6509
|
-
parseValue: true,
|
6510
|
-
validateJson: true,
|
6511
|
-
hideErrorMessage: true
|
6512
|
-
})
|
6513
|
-
// <JsonEditor validate name={name} ref={ref} useParsedValue />
|
6514
|
-
, fillOption === 'widget' && jsx(MultiplePropertyWidget$1, {
|
6515
|
-
property: property,
|
6516
|
-
name: name,
|
6517
|
-
useExpression: useExpression,
|
6518
|
-
required: required,
|
6519
|
-
label: label,
|
6520
|
-
entityReferenceDefinitionSources: entityReferenceDefinitionSources,
|
6521
|
-
entityReferenceValueComponent: entityReferenceValueComponent,
|
6522
|
-
fileReferenceValueComponent: fileReferenceValueComponent
|
6523
|
-
}), error && jsx(FormHelperText, Object.assign({
|
6524
|
-
error: true
|
6525
|
-
}, {
|
6526
|
-
children: error.message
|
6527
|
-
}))]
|
6528
|
-
});
|
6529
|
-
};
|
6530
|
-
|
6531
|
-
const DefinitionFiller = ({
|
6532
|
-
properties,
|
6533
|
-
dataFieldName,
|
6534
|
-
useExpression: _useExpression = false,
|
6535
|
-
title,
|
6536
|
-
entityReferenceDefinitionSources,
|
6537
|
-
entityReferenceValueComponent,
|
6538
|
-
fileReferenceValueComponent
|
6539
|
-
}) => {
|
6540
|
-
const stepperData = useMemo(() => {
|
6541
|
-
if (properties) {
|
6542
|
-
return properties.map(property => {
|
6543
|
-
var _a;
|
6544
|
-
const propertyType = typeof property.propertyType === 'string' ? property.propertyType : (_a = property['propertyType']) === null || _a === void 0 ? void 0 : _a['value'];
|
6545
|
-
return {
|
6546
|
-
label: jsxs(Box, Object.assign({
|
6547
|
-
display: "flex",
|
6548
|
-
flexDirection: "column"
|
6549
|
-
}, {
|
6550
|
-
children: [jsxs("b", {
|
6551
|
-
children: [property.name, property.isRequired ? '*' : '']
|
6552
|
-
}), jsxs("span", {
|
6553
|
-
children: [property.key, " | ", property.isMultiple ? 'multiple' : 'single', " |", ' ', propertyType]
|
6554
|
-
})]
|
6555
|
-
})),
|
6556
|
-
content: property.isMultiple ? jsx(MultiplePropertyFiller, {
|
6557
|
-
property: property,
|
6558
|
-
name: `${dataFieldName}.${property.key}`,
|
6559
|
-
useExpression: _useExpression,
|
6560
|
-
label: property.name,
|
6561
|
-
required: property.isRequired,
|
6562
|
-
entityReferenceValueComponent: entityReferenceValueComponent,
|
6563
|
-
fileReferenceValueComponent: fileReferenceValueComponent,
|
6564
|
-
entityReferenceDefinitionSources: entityReferenceDefinitionSources
|
6565
|
-
}) : jsx(PropertyFiller, {
|
6566
|
-
property: property,
|
6567
|
-
name: `${dataFieldName}.${property.key}`,
|
6568
|
-
useExpression: _useExpression,
|
6569
|
-
label: property.name,
|
6570
|
-
required: property.isRequired,
|
6571
|
-
entityReferenceDefinitionSources: entityReferenceDefinitionSources,
|
6572
|
-
entityReferenceValueComponent: entityReferenceValueComponent,
|
6573
|
-
fileReferenceValueComponent: fileReferenceValueComponent
|
6574
|
-
})
|
6575
|
-
};
|
6576
|
-
});
|
6577
|
-
}
|
6578
|
-
return [];
|
6579
|
-
}, [properties, dataFieldName, _useExpression, entityReferenceValueComponent, entityReferenceDefinitionSources, fileReferenceValueComponent]);
|
6580
|
-
return jsx(LocalizationProvider, Object.assign({
|
6581
|
-
dateAdapter: AdapterDateFns
|
6582
|
-
}, {
|
6583
|
-
children: jsxs(Grid, Object.assign({
|
6584
|
-
container: true,
|
6585
|
-
direction: "column",
|
6586
|
-
spacing: 2
|
6587
|
-
}, {
|
6588
|
-
children: [title && jsx(Grid, Object.assign({
|
6589
|
-
xs: 12
|
6590
|
-
}, {
|
6591
|
-
children: jsx("div", Object.assign({
|
6592
|
-
style: {
|
6593
|
-
fontWeight: '600'
|
6594
|
-
}
|
6595
|
-
}, {
|
6596
|
-
children: title
|
6597
|
-
}))
|
6598
|
-
})), jsx(StepperView, {
|
6599
|
-
data: stepperData
|
6600
|
-
})]
|
6601
|
-
}))
|
6602
|
-
}));
|
6603
|
-
};
|
6604
|
-
|
6605
|
-
const FileDefinitionValueView = ({
|
6606
|
-
property,
|
6607
|
-
data
|
6608
|
-
}) => {
|
6609
|
-
const {
|
6610
|
-
name
|
6611
|
-
} = property;
|
6612
|
-
const downloadFile = useCallback((contentBase64, fileName) => {
|
6613
|
-
const linkSource = contentBase64;
|
6614
|
-
const downloadLink = document.createElement('a');
|
6615
|
-
document.body.appendChild(downloadLink);
|
6616
|
-
downloadLink.href = linkSource;
|
6617
|
-
downloadLink.target = '_self';
|
6618
|
-
downloadLink.download = fileName;
|
6619
|
-
downloadLink.click();
|
6620
|
-
}, []);
|
6621
|
-
return jsx(Button, Object.assign({
|
6622
|
-
component: "label",
|
6623
|
-
variant: "contained",
|
6624
|
-
size: "large",
|
6625
|
-
color: "primary",
|
6626
|
-
onClick: () => downloadFile(data, name)
|
6627
|
-
}, {
|
6628
|
-
children: "Download File"
|
6629
|
-
}));
|
6630
|
-
};
|
6631
|
-
var FileDefinitionValueView$1 = FileDefinitionValueView;
|
6632
|
-
|
6633
|
-
const PropertyValueComponent = ({
|
6634
|
-
property,
|
6635
|
-
data,
|
6636
|
-
properties
|
6637
|
-
}) => {
|
6638
|
-
const defaultRender = value => jsx(Box, Object.assign({
|
6639
|
-
style: {
|
6640
|
-
backgroundColor: '#fff',
|
6641
|
-
border: '1px solid #ccc',
|
6642
|
-
borderRadius: '4px',
|
6643
|
-
padding: '4px',
|
6644
|
-
overflow: 'hidden',
|
6645
|
-
whiteSpace: 'nowrap',
|
6646
|
-
textOverflow: 'ellipsis'
|
6647
|
-
}
|
6648
|
-
}, {
|
6649
|
-
children: value === null ? 'null' : value.toString()
|
6650
|
-
}));
|
6651
|
-
switch (property.propertyType) {
|
6652
|
-
case PropertyType.JSON:
|
6653
|
-
return jsx(JsonView, {
|
6654
|
-
value: data
|
6655
|
-
});
|
6656
|
-
case PropertyType.ENTITY:
|
6657
|
-
return jsx(DefinitionValueView, {
|
6658
|
-
properties: properties,
|
6659
|
-
data: data
|
6660
|
-
});
|
6661
|
-
case PropertyType.ANY:
|
6662
|
-
// TODO need to prefetch data and show as is
|
6663
|
-
return typeof data === 'object' ? jsx(JsonView, {
|
6664
|
-
value: data
|
6665
|
-
}) : defaultRender(data);
|
6666
|
-
case PropertyType.FILE_REFERENCE:
|
6667
|
-
return data === null ? defaultRender(data) : jsx(Button, Object.assign({
|
6668
|
-
component: Link,
|
6669
|
-
color: "primary",
|
6670
|
-
variant: "contained",
|
6671
|
-
target: "_blank",
|
6672
|
-
to: data,
|
6673
|
-
sx: {
|
6674
|
-
marginTop: 4
|
6675
|
-
}
|
6676
|
-
}, {
|
6677
|
-
children: "Download via link"
|
6678
|
-
}));
|
6679
|
-
case PropertyType.FILE:
|
6680
|
-
return data === null ? defaultRender(data) : jsx(FileDefinitionValueView$1, {
|
6681
|
-
data: data,
|
6682
|
-
property: property
|
6683
|
-
});
|
6684
|
-
default:
|
6685
|
-
return defaultRender(data);
|
6686
|
-
}
|
6687
|
-
};
|
6688
|
-
const PropertyDataView = ({
|
6689
|
-
property,
|
6690
|
-
data,
|
6691
|
-
hasBackground: _hasBackground = false
|
6692
|
-
}) => {
|
6693
|
-
const properties = useMemo(() => {
|
6694
|
-
if (property.propertyType === PropertyType.ENTITY) {
|
6695
|
-
if (Array.isArray(property.properties)) {
|
6696
|
-
return property.properties;
|
6697
|
-
}
|
6698
|
-
return propertiesObjectToArray(property.properties);
|
6699
|
-
}
|
6700
|
-
return [];
|
6701
|
-
}, [property]);
|
6702
|
-
return jsx(Box, Object.assign({
|
6703
|
-
style: {
|
6704
|
-
backgroundColor: _hasBackground ? '#f1f1f1' : 'none'
|
6705
|
-
}
|
6706
|
-
}, {
|
6707
|
-
children: jsx(PropertyValueComponent, {
|
6708
|
-
property: property,
|
6709
|
-
data: data,
|
6710
|
-
properties: properties
|
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
|
6711
7092
|
})
|
6712
|
-
|
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
|
+
});
|
6713
7109
|
};
|
6714
|
-
var PropertyDataView$1 = PropertyDataView;
|
6715
7110
|
|
6716
|
-
const
|
7111
|
+
const DefinitionFiller = ({
|
6717
7112
|
properties,
|
6718
|
-
|
7113
|
+
dataFieldName,
|
7114
|
+
useExpression: _useExpression = false,
|
7115
|
+
title,
|
7116
|
+
entityReferenceDefinitionSources,
|
7117
|
+
entityReferenceValueComponent,
|
7118
|
+
fileReferenceValueComponent
|
6719
7119
|
}) => {
|
6720
7120
|
const stepperData = useMemo(() => {
|
6721
|
-
if (properties
|
7121
|
+
if (properties) {
|
6722
7122
|
return properties.map(property => {
|
6723
|
-
|
6724
|
-
|
6725
|
-
name,
|
6726
|
-
isMultiple,
|
6727
|
-
propertyType
|
6728
|
-
} = property;
|
6729
|
-
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'];
|
6730
7125
|
return {
|
6731
7126
|
label: jsxs(Box, Object.assign({
|
6732
7127
|
display: "flex",
|
6733
7128
|
flexDirection: "column"
|
6734
7129
|
}, {
|
6735
|
-
children: [
|
6736
|
-
children: name
|
7130
|
+
children: [jsxs("b", {
|
7131
|
+
children: [property.name, property.isRequired ? '*' : '']
|
6737
7132
|
}), jsxs("span", {
|
6738
|
-
children: [key, " | ", isMultiple ? 'multiple' : 'single', " |
|
7133
|
+
children: [property.key, " | ", property.isMultiple ? 'multiple' : 'single', " |", ' ', propertyType]
|
6739
7134
|
})]
|
6740
7135
|
})),
|
6741
|
-
content:
|
6742
|
-
children: value.map((itemValue, index) => jsx(Box, Object.assign({
|
6743
|
-
mb: 2
|
6744
|
-
}, {
|
6745
|
-
children: jsx(PropertyDataView$1, {
|
6746
|
-
property: property,
|
6747
|
-
data: itemValue,
|
6748
|
-
hasBackground: true
|
6749
|
-
})
|
6750
|
-
}), index))
|
6751
|
-
}) : jsx(PropertyDataView$1, {
|
7136
|
+
content: property.isMultiple ? jsx(MultiplePropertyFiller, {
|
6752
7137
|
property: property,
|
6753
|
-
|
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
|
6754
7154
|
})
|
6755
7155
|
};
|
6756
7156
|
});
|
6757
7157
|
}
|
6758
7158
|
return [];
|
6759
|
-
}, [properties,
|
6760
|
-
return jsx(
|
6761
|
-
|
6762
|
-
|
6763
|
-
|
6764
|
-
|
6765
|
-
|
6766
|
-
|
6767
|
-
}
|
6768
|
-
|
6769
|
-
|
6770
|
-
|
6771
|
-
const StyledBox = styled(Box)(({
|
6772
|
-
theme
|
6773
|
-
}) => ({
|
6774
|
-
backgroundColor: '#eee',
|
6775
|
-
fontSize: '14px',
|
6776
|
-
padding: '0 8px',
|
6777
|
-
borderRadius: '10px',
|
6778
|
-
width: 'fit-content',
|
6779
|
-
'&.success': {
|
6780
|
-
backgroundColor: '#a9dfa9'
|
6781
|
-
},
|
6782
|
-
'&.error': {
|
6783
|
-
backgroundColor: '#ff7e7e'
|
6784
|
-
},
|
6785
|
-
'&.warning': {
|
6786
|
-
backgroundColor: theme.palette.warning.main
|
6787
|
-
}
|
6788
|
-
}));
|
6789
|
-
const Status = ({
|
6790
|
-
text,
|
6791
|
-
status: _status = 'default'
|
6792
|
-
}) => {
|
6793
|
-
return jsx(StyledBox, Object.assign({
|
6794
|
-
className: classnames('root', {
|
6795
|
-
[_status]: true
|
6796
|
-
})
|
6797
|
-
}, {
|
6798
|
-
children: text
|
6799
|
-
}));
|
6800
|
-
};
|
6801
|
-
|
6802
|
-
const PropertyStep = ({
|
6803
|
-
properties,
|
6804
|
-
parentKey: _parentKey = '',
|
6805
|
-
activePath: _activePath = '',
|
6806
|
-
prefix: _prefix = '',
|
6807
|
-
onClick
|
6808
|
-
}) => {
|
6809
|
-
const handleClick = path => {
|
6810
|
-
if (_prefix) {
|
6811
|
-
onClick(`${_prefix}.${path}`);
|
6812
|
-
} else {
|
6813
|
-
onClick(path);
|
6814
|
-
}
|
6815
|
-
};
|
6816
|
-
return jsx(Stepper, Object.assign({
|
6817
|
-
orientation: "vertical",
|
6818
|
-
onClick: event => event.stopPropagation()
|
6819
|
-
}, {
|
6820
|
-
children: properties && properties.map(property => {
|
6821
|
-
var _a;
|
6822
|
-
const fullPropertyPath = _parentKey ? `${_parentKey}.${property.key}` : property.key;
|
6823
|
-
const propertyType = (_a = property.propertyType['value']) !== null && _a !== void 0 ? _a : property.propertyType;
|
6824
|
-
return jsxs(Step, Object.assign({
|
6825
|
-
expanded: true,
|
6826
|
-
onClick: () => handleClick(fullPropertyPath)
|
6827
|
-
}, {
|
6828
|
-
children: [jsx(StepLabel, Object.assign({
|
6829
|
-
StepIconProps: {
|
6830
|
-
icon: '',
|
6831
|
-
completed: false,
|
6832
|
-
active: _activePath === fullPropertyPath
|
6833
|
-
}
|
6834
|
-
}, {
|
6835
|
-
children: jsxs(Box, Object.assign({
|
6836
|
-
sx: {
|
6837
|
-
propertyStepLabel: {
|
6838
|
-
'&:hover': {
|
6839
|
-
fontWeight: '600',
|
6840
|
-
cursor: 'pointer'
|
6841
|
-
}
|
6842
|
-
}
|
6843
|
-
}
|
6844
|
-
}, {
|
6845
|
-
children: [property.name, " - ", property.key, " - ", propertyType]
|
6846
|
-
}))
|
6847
|
-
})), jsx(StepContent, {
|
6848
|
-
children: jsx("div", {
|
6849
|
-
children: propertyType === PropertyType.ENTITY && jsx(PropertyStep, {
|
6850
|
-
onClick: onClick,
|
6851
|
-
activePath: _activePath,
|
6852
|
-
properties: property.properties,
|
6853
|
-
parentKey: fullPropertyPath
|
6854
|
-
}, property.key)
|
6855
|
-
})
|
6856
|
-
})]
|
6857
|
-
}), property.key);
|
6858
|
-
})
|
6859
|
-
}));
|
6860
|
-
};
|
6861
|
-
var PropertyStep$1 = PropertyStep;
|
6862
|
-
|
6863
|
-
const JsonPathPicker = ({
|
6864
|
-
open: _open = false,
|
6865
|
-
onClose,
|
6866
|
-
onPaste,
|
6867
|
-
properties
|
6868
|
-
}) => {
|
6869
|
-
const [selectedPropertyPath, setSelectedPropertyPath] = useState('');
|
6870
|
-
const onCopy = () => {
|
6871
|
-
navigator.clipboard.writeText(`$(${selectedPropertyPath})`);
|
6872
|
-
toast.success('Copied!');
|
6873
|
-
};
|
6874
|
-
const handlePaste = () => {
|
6875
|
-
onPaste(`$(${selectedPropertyPath})`);
|
6876
|
-
toast.success('Pasted!');
|
6877
|
-
};
|
6878
|
-
return jsxs(Dialog, Object.assign({
|
6879
|
-
open: _open,
|
6880
|
-
onClose: onClose,
|
6881
|
-
fullWidth: true,
|
6882
|
-
maxWidth: "md"
|
6883
|
-
}, {
|
6884
|
-
children: [jsx(DialogTitle, {
|
6885
|
-
children: "JSON path picker"
|
6886
|
-
}), jsxs(DialogContent, {
|
6887
|
-
children: [(properties === null || properties === void 0 ? void 0 : properties.length) ? properties.map((propEl, index) => jsxs("div", {
|
6888
|
-
children: [jsx(Typography, Object.assign({
|
6889
|
-
variant: "h6"
|
6890
|
-
}, {
|
6891
|
-
children: propEl.title
|
6892
|
-
})), jsx(PropertyStep$1, {
|
6893
|
-
properties: propEl.properties,
|
6894
|
-
prefix: propEl.pathPrefix,
|
6895
|
-
onClick: setSelectedPropertyPath,
|
6896
|
-
activePath: selectedPropertyPath
|
6897
|
-
})]
|
6898
|
-
}, index)) : jsx(Typography, {
|
6899
|
-
children: "Please, add properties"
|
6900
|
-
}), selectedPropertyPath && jsxs(Typography, Object.assign({
|
6901
|
-
variant: "h6",
|
6902
|
-
gutterBottom: true
|
6903
|
-
}, {
|
6904
|
-
children: ["Selected path : $(", selectedPropertyPath, ")"]
|
6905
|
-
}))]
|
6906
|
-
}), jsxs(DialogActions, {
|
6907
|
-
children: [jsx(Button, Object.assign({
|
6908
|
-
variant: "contained",
|
6909
|
-
color: "primary",
|
6910
|
-
onClick: onCopy
|
6911
|
-
}, {
|
6912
|
-
children: "Copy"
|
6913
|
-
})), jsx(Button, Object.assign({
|
6914
|
-
variant: "contained",
|
6915
|
-
color: "primary",
|
6916
|
-
onClick: handlePaste
|
6917
|
-
}, {
|
6918
|
-
children: "Paste"
|
6919
|
-
})), jsx(Button, Object.assign({
|
6920
|
-
variant: "contained",
|
6921
|
-
color: "secondary",
|
6922
|
-
onClick: onClose
|
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
|
6923
7170
|
}, {
|
6924
|
-
children: "
|
6925
|
-
|
6926
|
-
|
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
|
+
}))
|
6927
7182
|
}));
|
6928
7183
|
};
|
6929
7184
|
|
6930
|
-
const
|
6931
|
-
|
6932
|
-
|
6933
|
-
console.log('collapse toggle');
|
6934
|
-
}
|
6935
|
-
});
|
6936
|
-
const useSidebarContext = () => useContext(SidebarContext);
|
6937
|
-
const SidebarContextProvider = ({
|
6938
|
-
children
|
7185
|
+
const FileDefinitionValueView = ({
|
7186
|
+
property,
|
7187
|
+
data
|
6939
7188
|
}) => {
|
6940
|
-
const
|
6941
|
-
|
6942
|
-
|
6943
|
-
|
6944
|
-
|
6945
|
-
|
6946
|
-
|
6947
|
-
|
6948
|
-
|
6949
|
-
|
6950
|
-
|
6951
|
-
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();
|
6952
7200
|
}, []);
|
6953
|
-
return jsx(
|
6954
|
-
|
6955
|
-
|
6956
|
-
|
6957
|
-
|
6958
|
-
|
7201
|
+
return jsx(Button, Object.assign({
|
7202
|
+
component: "label",
|
7203
|
+
variant: "contained",
|
7204
|
+
size: "large",
|
7205
|
+
color: "primary",
|
7206
|
+
onClick: () => downloadFile(data, name)
|
6959
7207
|
}, {
|
6960
|
-
children:
|
7208
|
+
children: "Download File"
|
6961
7209
|
}));
|
6962
7210
|
};
|
7211
|
+
var FileDefinitionValueView$1 = FileDefinitionValueView;
|
6963
7212
|
|
6964
|
-
const
|
6965
|
-
|
6966
|
-
|
6967
|
-
|
6968
|
-
|
6969
|
-
|
6970
|
-
|
6971
|
-
|
6972
|
-
|
6973
|
-
|
6974
|
-
|
6975
|
-
|
6976
|
-
|
6977
|
-
|
6978
|
-
disabled: '#A9A9B8'
|
6979
|
-
},
|
6980
|
-
success: {
|
6981
|
-
main: '#2DB77B',
|
6982
|
-
light: '#DBFCEE'
|
6983
|
-
},
|
6984
|
-
grey: {
|
6985
|
-
700: '#101F2B'
|
6986
|
-
}
|
6987
|
-
},
|
6988
|
-
typography: {
|
6989
|
-
fontSize: 14,
|
6990
|
-
allVariants: {
|
6991
|
-
fontFamily: ['Euclid', '-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'].join(',')
|
6992
|
-
},
|
6993
|
-
h1: {
|
6994
|
-
fontWeight: 400
|
6995
|
-
},
|
6996
|
-
h3: {
|
6997
|
-
fontWeight: 500
|
6998
|
-
},
|
6999
|
-
h4: {
|
7000
|
-
fontWeight: 500
|
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'
|
7001
7227
|
}
|
7002
|
-
}
|
7003
|
-
|
7004
|
-
|
7005
|
-
|
7006
|
-
|
7007
|
-
|
7008
|
-
|
7009
|
-
|
7010
|
-
|
7011
|
-
|
7012
|
-
|
7013
|
-
|
7014
|
-
|
7015
|
-
|
7016
|
-
|
7017
|
-
|
7018
|
-
|
7019
|
-
|
7020
|
-
|
7021
|
-
|
7022
|
-
|
7023
|
-
|
7024
|
-
|
7025
|
-
|
7026
|
-
|
7027
|
-
|
7028
|
-
|
7029
|
-
// padding: 0,
|
7030
|
-
// height: '32px',
|
7031
|
-
}
|
7032
|
-
}
|
7033
|
-
},
|
7034
|
-
|
7035
|
-
MuiSelect: {
|
7036
|
-
styleOverrides: {
|
7037
|
-
nativeInput: {
|
7038
|
-
padding: 0,
|
7039
|
-
height: '32px'
|
7040
|
-
}
|
7041
|
-
}
|
7042
|
-
},
|
7043
|
-
MuiTextField: {
|
7044
|
-
styleOverrides: {
|
7045
|
-
root: {
|
7046
|
-
minWidth: baseTheme.spacing(25)
|
7047
|
-
}
|
7048
|
-
}
|
7049
|
-
},
|
7050
|
-
MuiInputLabel: {
|
7051
|
-
styleOverrides: {
|
7052
|
-
root: {
|
7053
|
-
position: 'relative',
|
7054
|
-
overflow: 'initial',
|
7055
|
-
transform: 'none',
|
7056
|
-
marginBottom: baseTheme.spacing(1),
|
7057
|
-
fontWeight: 500,
|
7058
|
-
fontSize: '14px',
|
7059
|
-
lineHeight: '20px',
|
7060
|
-
pointerEvents: 'auto'
|
7061
|
-
}
|
7062
|
-
}
|
7063
|
-
},
|
7064
|
-
MuiOutlinedInput: {
|
7065
|
-
styleOverrides: {
|
7066
|
-
root: {
|
7067
|
-
borderRadius: baseTheme.spacing(3),
|
7068
|
-
minWidth: baseTheme.spacing(25)
|
7069
|
-
},
|
7070
|
-
notchedOutline: {
|
7071
|
-
top: 0,
|
7072
|
-
'& legend': {
|
7073
|
-
display: 'none',
|
7074
|
-
transition: 'none'
|
7075
|
-
}
|
7076
|
-
}
|
7077
|
-
}
|
7078
|
-
},
|
7079
|
-
MuiAutocomplete: {
|
7080
|
-
styleOverrides: {
|
7081
|
-
paper: {
|
7082
|
-
marginTop: 8,
|
7083
|
-
borderRadius: 12,
|
7084
|
-
boxShadow: '0px 8px 16px rgba(0, 0, 0, 0.04)'
|
7085
|
-
},
|
7086
|
-
listbox: {
|
7087
|
-
'::-webkit-scrollbar': {
|
7088
|
-
width: '6px',
|
7089
|
-
backgroundColor: 'white'
|
7090
|
-
},
|
7091
|
-
'::-webkit-scrollbar-thumb': {
|
7092
|
-
borderRadius: '10px',
|
7093
|
-
backgroundColor: 'rgba(38, 40, 66, 0.24)'
|
7094
|
-
}
|
7095
|
-
}
|
7096
|
-
}
|
7097
|
-
},
|
7098
|
-
MuiMenu: {
|
7099
|
-
styleOverrides: {
|
7100
|
-
list: {
|
7101
|
-
paddingTop: 0,
|
7102
|
-
paddingBottom: 0,
|
7103
|
-
background: 'white',
|
7104
|
-
'& li.Mui-selected': {
|
7105
|
-
background: 'rgba(38, 40, 66, 0.08) !important'
|
7106
|
-
}
|
7107
|
-
}
|
7108
|
-
}
|
7109
|
-
},
|
7110
|
-
MuiPopover: {
|
7111
|
-
styleOverrides: {
|
7112
|
-
paper: {
|
7113
|
-
marginTop: 8,
|
7114
|
-
borderRadius: 12,
|
7115
|
-
boxShadow: '0px 8px 16px rgba(0, 0, 0, 0.04)'
|
7116
|
-
}
|
7117
|
-
}
|
7118
|
-
},
|
7119
|
-
MuiFormLabel: {
|
7120
|
-
styleOverrides: {
|
7121
|
-
root: {
|
7122
|
-
fontSize: 14,
|
7123
|
-
fontWeight: 500
|
7124
|
-
},
|
7125
|
-
asterisk: {
|
7126
|
-
color: '#D6331F',
|
7127
|
-
'&$error': {
|
7128
|
-
color: '#D6331F'
|
7129
|
-
}
|
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
|
7130
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;
|
7131
7277
|
}
|
7278
|
+
return propertiesObjectToArray(property.properties);
|
7132
7279
|
}
|
7133
|
-
|
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
|
+
}));
|
7134
7293
|
};
|
7135
|
-
var
|
7294
|
+
var PropertyDataView$1 = PropertyDataView;
|
7136
7295
|
|
7137
|
-
const
|
7138
|
-
|
7139
|
-
|
7140
|
-
|
7141
|
-
|
7142
|
-
|
7143
|
-
|
7144
|
-
|
7145
|
-
|
7146
|
-
|
7147
|
-
|
7148
|
-
|
7149
|
-
|
7150
|
-
|
7151
|
-
|
7152
|
-
|
7153
|
-
|
7154
|
-
|
7155
|
-
|
7156
|
-
|
7157
|
-
|
7158
|
-
|
7159
|
-
|
7160
|
-
|
7161
|
-
}
|
7162
|
-
|
7163
|
-
|
7164
|
-
|
7165
|
-
|
7166
|
-
|
7167
|
-
|
7168
|
-
|
7169
|
-
|
7170
|
-
|
7171
|
-
|
7172
|
-
|
7173
|
-
|
7174
|
-
|
7175
|
-
|
7176
|
-
|
7177
|
-
|
7178
|
-
}
|
7179
|
-
}
|
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
|
+
});
|
7180
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
|
7181
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
|
+
}));
|
7182
7380
|
};
|
7183
|
-
var tableThemeOptions$1 = tableThemeOptions;
|
7184
7381
|
|
7185
|
-
const
|
7186
|
-
|
7187
|
-
|
7188
|
-
|
7189
|
-
|
7190
|
-
|
7191
|
-
|
7192
|
-
|
7193
|
-
|
7194
|
-
|
7195
|
-
|
7196
|
-
|
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);
|
7197
7394
|
}
|
7198
|
-
}
|
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
|
+
}));
|
7199
7440
|
};
|
7200
|
-
var
|
7441
|
+
var PropertyStep$1 = PropertyStep;
|
7201
7442
|
|
7202
|
-
const
|
7203
|
-
|
7204
|
-
|
7205
|
-
|
7206
|
-
|
7207
|
-
|
7208
|
-
|
7209
|
-
|
7210
|
-
|
7211
|
-
|
7212
|
-
|
7213
|
-
|
7214
|
-
|
7215
|
-
|
7216
|
-
|
7217
|
-
|
7218
|
-
|
7219
|
-
|
7220
|
-
|
7221
|
-
|
7222
|
-
|
7223
|
-
|
7224
|
-
|
7225
|
-
|
7226
|
-
|
7227
|
-
|
7228
|
-
|
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
|
+
}));
|
7229
7508
|
};
|
7230
|
-
var typographyThemeOptions$1 = typographyThemeOptions;
|
7231
7509
|
|
7232
|
-
const
|
7233
|
-
|
7234
|
-
|
7235
|
-
|
7236
|
-
if (!fontsLink.length) {
|
7237
|
-
const link = document.createElement('link');
|
7238
|
-
link.href = url;
|
7239
|
-
link.rel = 'stylesheet';
|
7240
|
-
document.head.appendChild(link);
|
7241
|
-
}
|
7510
|
+
const SidebarContext = /*#__PURE__*/createContext({
|
7511
|
+
collapsed: false,
|
7512
|
+
toggleCollapse: () => {
|
7513
|
+
console.log('collapse toggle');
|
7242
7514
|
}
|
7243
|
-
|
7244
|
-
|
7245
|
-
|
7246
|
-
|
7247
|
-
|
7248
|
-
|
7249
|
-
|
7250
|
-
|
7251
|
-
|
7252
|
-
|
7253
|
-
|
7254
|
-
|
7255
|
-
// styleOverrides: {
|
7256
|
-
// root: {
|
7257
|
-
// backgroundColor: 'rgba(0, 0, 0, 0.2)',
|
7258
|
-
// },
|
7259
|
-
// },
|
7260
|
-
// },
|
7261
|
-
MuiAppBar: {
|
7262
|
-
styleOverrides: {
|
7263
|
-
root: {
|
7264
|
-
boxShadow: 'none',
|
7265
|
-
backgroundColor: '#007F9B'
|
7266
|
-
}
|
7267
|
-
}
|
7268
|
-
},
|
7269
|
-
MuiButton: {
|
7270
|
-
styleOverrides: {
|
7271
|
-
root: {
|
7272
|
-
borderRadius: baseTheme.spacing(2.5),
|
7273
|
-
padding: baseTheme.spacing(2.5, 4),
|
7274
|
-
lineHeight: '20px',
|
7275
|
-
fontSize: '1rem',
|
7276
|
-
textTransform: 'none'
|
7277
|
-
},
|
7278
|
-
outlined: {
|
7279
|
-
color: '#262842',
|
7280
|
-
backgroundColor: '#FFFFFF !important',
|
7281
|
-
border: '1px solid rgba(38, 40, 66, 0.12)'
|
7282
|
-
},
|
7283
|
-
text: {
|
7284
|
-
color: baseTheme.palette.secondary.dark
|
7285
|
-
}
|
7286
|
-
}
|
7287
|
-
},
|
7288
|
-
MuiDialog: {
|
7289
|
-
styleOverrides: {
|
7290
|
-
root: {
|
7291
|
-
'& .MuiModal-backdrop': {
|
7292
|
-
background: 'rgba(28, 55, 77, 0.5)',
|
7293
|
-
backdropFilter: 'blur(2px)'
|
7294
|
-
}
|
7295
|
-
},
|
7296
|
-
paper: {
|
7297
|
-
borderRadius: baseTheme.spacing(3)
|
7298
|
-
},
|
7299
|
-
paperWidthXs: {
|
7300
|
-
maxWidth: 500
|
7301
|
-
}
|
7302
|
-
}
|
7303
|
-
},
|
7304
|
-
// MuiPaper: {
|
7305
|
-
// styleOverrides: {
|
7306
|
-
// root: {
|
7307
|
-
// borderRadius: baseTheme.spacing(3),
|
7308
|
-
// },
|
7309
|
-
// },
|
7310
|
-
// },
|
7311
|
-
MuiDialogContent: {
|
7312
|
-
styleOverrides: {
|
7313
|
-
root: {
|
7314
|
-
color: '#6D6E85'
|
7315
|
-
}
|
7316
|
-
}
|
7317
|
-
},
|
7318
|
-
MuiDialogActions: {
|
7319
|
-
styleOverrides: {
|
7320
|
-
root: {
|
7321
|
-
background: '#F7F8FC',
|
7322
|
-
borderTop: '1px solid rgba(38, 40, 66, 0.08)',
|
7323
|
-
padding: baseTheme.spacing(3, 6)
|
7324
|
-
}
|
7325
|
-
}
|
7326
|
-
},
|
7327
|
-
MuiTabs: {
|
7328
|
-
styleOverrides: {
|
7329
|
-
root: {
|
7330
|
-
minHeight: '38px'
|
7331
|
-
},
|
7332
|
-
indicator: {
|
7333
|
-
backgroundColor: baseTheme.palette.secondary.main
|
7334
|
-
}
|
7335
|
-
}
|
7336
|
-
},
|
7337
|
-
MuiTab: {
|
7338
|
-
styleOverrides: {
|
7339
|
-
root: {
|
7340
|
-
fontSize: 14,
|
7341
|
-
fontWeight: 500,
|
7342
|
-
textTransform: 'none',
|
7343
|
-
padding: '10px 12px',
|
7344
|
-
lineHeight: '1.125rem',
|
7345
|
-
minHeight: '38px',
|
7346
|
-
color: '#8B8C9E',
|
7347
|
-
'&.Mui-selected': {
|
7348
|
-
color: baseTheme.palette.secondary.main
|
7349
|
-
}
|
7350
|
-
}
|
7351
|
-
}
|
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
|
7352
7527
|
}
|
7353
|
-
})
|
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
|
7354
7541
|
}));
|
7355
7542
|
};
|
7356
|
-
const theme = arsenalTheme();
|
7357
7543
|
|
7358
7544
|
const drawerWidth = 248;
|
7359
7545
|
const Container = styled('div')({
|
@@ -8039,4 +8225,33 @@ const Breadcrumbs = ({
|
|
8039
8225
|
}));
|
8040
8226
|
};
|
8041
8227
|
|
8042
|
-
|
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 };
|