@digital-ai/dot-components 2.5.0 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGE_LOG.md +26 -3
- package/README.md +15 -0
- package/index.esm.js +1602 -1502
- package/index.umd.js +1728 -1627
- package/lib/Typography.stories.d.ts +4 -0
- package/lib/components/accordion/Accordion.stories.d.ts +8 -0
- package/lib/components/action-toolbar/ActionToolbar.stories.d.ts +5 -0
- package/lib/components/alert-banner/AlertBanner.stories.d.ts +5 -0
- package/lib/components/app-switcher/AppSwitcher.d.ts +2 -1
- package/lib/components/app-switcher/utils/helpers.d.ts +15 -5
- package/lib/components/app-toolbar/AppToolbar.stories.d.ts +8 -0
- package/lib/components/auto-complete/AutoComplete.stories.d.ts +22 -0
- package/lib/components/avatar/Avatar.stories.d.ts +7 -0
- package/lib/components/avatar-group/AvatarGroup.stories.d.ts +5 -0
- package/lib/components/badge/Badge.stories.d.ts +8 -0
- package/lib/components/breadcrumbs/Breadcrumbs.stories.d.ts +5 -0
- package/lib/components/button/Button.stories.d.ts +11 -0
- package/lib/components/button/CopyButton.stories.d.ts +5 -0
- package/lib/components/button/IconButton.stories.d.ts +10 -0
- package/lib/components/button-toggle/ButtonToggle.stories.d.ts +11 -0
- package/lib/components/card/Card.stories.d.ts +6 -0
- package/lib/components/checkbox/Checkbox.stories.d.ts +9 -0
- package/lib/components/checkbox/CheckboxGroup.stories.d.ts +6 -0
- package/lib/components/chip/Chip.stories.d.ts +8 -0
- package/lib/components/confirmation-dialog/ConfirmationDialog.stories.d.ts +6 -0
- package/lib/components/css-grid/CssGrid.stories.d.ts +7 -0
- package/lib/components/dialog/Dialog.stories.d.ts +5 -0
- package/lib/components/divider/Divider.stories.d.ts +6 -0
- package/lib/components/draggable-list/DraggableList.stories.d.ts +10 -0
- package/lib/components/drawer/Drawer.stories.d.ts +9 -0
- package/lib/components/dynamic-form/DynamicForm.stories.d.ts +5 -0
- package/lib/components/dynamic-form/utils/helpers.d.ts +1 -1
- package/lib/components/empty-state/EmptyState.stories.d.ts +5 -0
- package/lib/components/file-upload/FileUpload.stories.d.ts +8 -0
- package/lib/components/form/Form.stories.d.ts +5 -0
- package/lib/components/form-group/FormGroup.stories.d.ts +5 -0
- package/lib/components/icon/Icon.stories.d.ts +5 -0
- package/lib/components/inline-edit/InlineEdit.stories.d.ts +15 -0
- package/lib/components/input-form-fields/InputSelect.stories.d.ts +10 -0
- package/lib/components/input-form-fields/InputText.stories.d.ts +14 -0
- package/lib/components/linear-progress/LinearProgress.stories.d.ts +13 -0
- package/lib/components/link/Link.d.ts +4 -2
- package/lib/components/link/Link.stories.d.ts +6 -0
- package/lib/components/list/List.stories.d.ts +6 -0
- package/lib/components/menu/Menu.stories.d.ts +9 -0
- package/lib/components/navigation-rail/NavigationRail.stories.d.ts +7 -0
- package/lib/components/pill/Pill.stories.d.ts +5 -0
- package/lib/components/popper/Popper.stories.d.ts +6 -0
- package/lib/components/progress/Progress.stories.d.ts +9 -0
- package/lib/components/progress-button/ProgressButton.stories.d.ts +5 -0
- package/lib/components/radio/RadioButton.stories.d.ts +5 -0
- package/lib/components/radio/RadioGroup.stories.d.ts +7 -0
- package/lib/components/sidebar/Sidebar.stories.d.ts +8 -0
- package/lib/components/skeleton/Skeleton.stories.d.ts +5 -0
- package/lib/components/snackbar/Snackbar.stories.d.ts +6 -0
- package/lib/components/split-button/SplitButton.stories.d.ts +9 -0
- package/lib/components/switch/Switch.stories.d.ts +12 -0
- package/lib/components/table/Table.stories.d.ts +10 -0
- package/lib/components/table/TablePagination.stories.d.ts +5 -0
- package/lib/components/tabs/Tabs.stories.d.ts +6 -0
- package/lib/components/tooltip/Tooltip.stories.d.ts +5 -0
- package/lib/components/truncate-with-tooltip/TruncateWithTooltip.stories.d.ts +8 -0
- package/lib/components/typography/Typography.stories.d.ts +7 -0
- package/package.json +3 -3
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
1
|
+
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { useState, useEffect, useRef, useMemo, useContext, createContext, forwardRef,
|
|
4
|
-
import { Tooltip, Icon, Typography, Accordion, AccordionSummary, AccordionDetails, AccordionActions, InputAdornment, InputLabel, TextField, Toolbar, Alert, Fade, Avatar, Button, darken,
|
|
3
|
+
import { useState, useEffect, useRef, useMemo, useContext, createContext, forwardRef, Fragment, useCallback, createElement } from 'react';
|
|
4
|
+
import { Tooltip, Icon, Typography, Accordion, AccordionSummary, AccordionDetails, AccordionActions, InputAdornment, InputLabel, TextField, Toolbar, Alert, Fade, Avatar, Button, darken, List, ListItem, CircularProgress, Popper, MenuList, MenuItem, Paper, ClickAwayListener, Drawer, IconButton, ListItemIcon, Collapse, ListSubheader, Divider, ListItemText, Link, Badge, useMediaQuery, Autocomplete, Chip, AvatarGroup, Breadcrumbs, ToggleButtonGroup, ToggleButton, Card, CardContent, CardHeader, FormControlLabel, Checkbox, FormControl, FormGroup, FormLabel, FormHelperText, Dialog, DialogContent, DialogActions, useTheme as useTheme$1, RadioGroup, Radio, Switch, Skeleton, Snackbar, ButtonGroup, TablePagination, TableContainer, TableCell, TableRow, TableBody, TableSortLabel, TableHead, Table, Tabs, Tab, LinearProgress } from '@mui/material';
|
|
5
5
|
import '@digital-ai/dot-icons';
|
|
6
6
|
import styled, { css, createGlobalStyle, ThemeProvider as ThemeProvider$1, keyframes } from 'styled-components';
|
|
7
7
|
import { createTheme, ThemeProvider, alpha, useTheme } from '@mui/material/styles';
|
|
@@ -1396,7 +1396,7 @@ let applications = [{
|
|
|
1396
1396
|
enabled: true,
|
|
1397
1397
|
created_date: '2022-11-30T23:28:01.662721+00:00',
|
|
1398
1398
|
modified_date: '2022-11-30T23:28:01.662721+00:00',
|
|
1399
|
-
name: 'Agility',
|
|
1399
|
+
name: 'Agility 1',
|
|
1400
1400
|
url: 'https://digital.ai/products/agility/',
|
|
1401
1401
|
description: '',
|
|
1402
1402
|
alternate_label: nullStr,
|
|
@@ -1411,7 +1411,7 @@ let applications = [{
|
|
|
1411
1411
|
enabled: true,
|
|
1412
1412
|
created_date: '2022-11-30T23:32:00.979159+00:00',
|
|
1413
1413
|
modified_date: '2022-11-30T23:32:00.979159+00:00',
|
|
1414
|
-
name: '
|
|
1414
|
+
name: 'Continuous Testing 1',
|
|
1415
1415
|
url: 'https://digital.ai/products/continuous-testing/',
|
|
1416
1416
|
description: '',
|
|
1417
1417
|
alternate_label: nullStr,
|
|
@@ -1426,7 +1426,7 @@ let applications = [{
|
|
|
1426
1426
|
enabled: true,
|
|
1427
1427
|
created_date: '2022-12-30T23:32:00.979159+00:00',
|
|
1428
1428
|
modified_date: '2022-12-30T23:32:00.979159+00:00',
|
|
1429
|
-
name: '
|
|
1429
|
+
name: 'Continuous Testing 2',
|
|
1430
1430
|
url: 'https://digital.ai/products/continuous-testing/',
|
|
1431
1431
|
description: '',
|
|
1432
1432
|
alternate_label: nullStr,
|
|
@@ -1772,617 +1772,473 @@ const DotButton = /*#__PURE__*/forwardRef(({
|
|
|
1772
1772
|
}), void 0);
|
|
1773
1773
|
});
|
|
1774
1774
|
|
|
1775
|
-
const rootClassName$X = 'dot-
|
|
1776
|
-
const
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1775
|
+
const rootClassName$X = 'dot-list';
|
|
1776
|
+
const listItemRootClass = 'dot-list-item';
|
|
1777
|
+
const nestedListClassName = 'dot-nested-list';
|
|
1778
|
+
const nestedDrawerClassName = 'dot-nested-drawer';
|
|
1779
|
+
const StyledList = styled(List).withConfig({
|
|
1780
|
+
displayName: "Liststyles__StyledList",
|
|
1781
|
+
componentId: "wxwqwr-0"
|
|
1782
|
+
})(["", ""], ({
|
|
1783
|
+
theme
|
|
1784
|
+
}) => css(["&.", "{background:", ";.dot-icon{color:", ";}&.", " .", "{padding-left:", ";}.MuiListSubheader-root{padding:0;.MuiTypography-root{padding:", ";}}}"], rootClassName$X, theme.palette.layer.n0, theme.palette.layer.n700, nestedListClassName, listItemRootClass, theme.spacing(4), theme.spacing(1)));
|
|
1780
1785
|
|
|
1781
|
-
const
|
|
1786
|
+
const getChevronIcon = (nestedListType, isOpened) => {
|
|
1787
|
+
if (nestedListType !== 'expandable') {
|
|
1788
|
+
return 'chevron-right';
|
|
1789
|
+
}
|
|
1790
|
+
if (isOpened) {
|
|
1791
|
+
return 'chevron-up';
|
|
1792
|
+
}
|
|
1793
|
+
return 'chevron-down';
|
|
1794
|
+
};
|
|
1795
|
+
|
|
1796
|
+
const flyoutListItemClassName = 'dot-flyout-list-item';
|
|
1797
|
+
const flyoutItemLinkClassName = 'dot-flyout-item-link';
|
|
1798
|
+
const listItemLinkClassName = 'dot-list-item-link';
|
|
1799
|
+
const StyledListItem = styled(ListItem).withConfig({
|
|
1800
|
+
displayName: "ListItemstyles__StyledListItem",
|
|
1801
|
+
componentId: "sc-1fawh8v-0"
|
|
1802
|
+
})(["", ""], ({
|
|
1803
|
+
theme
|
|
1804
|
+
}) => css(["&.", "{&.", "{padding:0;}p.MuiTypography-root{margin-bottom:0;}.", "{align-items:center;display:flex;flex-grow:2;}.", " .MuiIcon-root{margin-right:", ";}.dot-icon i:before{color:", ";}}"], listItemRootClass, flyoutListItemClassName, listItemLinkClassName, flyoutItemLinkClassName, theme.spacing(4), theme.palette.text.primary));
|
|
1805
|
+
|
|
1806
|
+
const rootClassName$W = 'dot-progress';
|
|
1807
|
+
const StyledCircularProgress = styled(CircularProgress).withConfig({
|
|
1808
|
+
displayName: "Progressstyles__StyledCircularProgress",
|
|
1809
|
+
componentId: "sc-1gs77rb-0"
|
|
1810
|
+
})(["&.", "{&.MuiCircularProgress-colorSecondary{color:#649a3d;}}"], rootClassName$W);
|
|
1811
|
+
|
|
1812
|
+
const DotProgress = ({
|
|
1782
1813
|
ariaLabel,
|
|
1814
|
+
color: _color = 'secondary',
|
|
1783
1815
|
className,
|
|
1784
|
-
color: _color = 'inherit',
|
|
1785
1816
|
'data-testid': dataTestId,
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
tooltip,
|
|
1792
|
-
size: _size = 'medium'
|
|
1817
|
+
size: _size = 40,
|
|
1818
|
+
thickness: _thickness = 3.6,
|
|
1819
|
+
tooltip: _tooltip = 'loading data',
|
|
1820
|
+
value,
|
|
1821
|
+
variant: _variant = 'indeterminate'
|
|
1793
1822
|
}) => {
|
|
1794
|
-
const
|
|
1795
|
-
const rootClasses = useStylesWithRootClass(rootClassName$X, rippleClassName, className);
|
|
1823
|
+
const rootClasses = useStylesWithRootClass(rootClassName$W, className);
|
|
1796
1824
|
return jsx(DotTooltip, Object.assign({
|
|
1797
|
-
|
|
1798
|
-
title: tooltip
|
|
1825
|
+
title: _tooltip
|
|
1799
1826
|
}, {
|
|
1800
|
-
children: jsx(
|
|
1827
|
+
children: jsx(StyledCircularProgress, {
|
|
1801
1828
|
"aria-label": ariaLabel,
|
|
1802
1829
|
classes: {
|
|
1803
1830
|
root: rootClasses
|
|
1804
1831
|
},
|
|
1805
1832
|
color: _color,
|
|
1806
1833
|
"data-testid": dataTestId,
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
},
|
|
1812
|
-
children: jsx(DotIcon, {
|
|
1813
|
-
"data-testid": "button-icon",
|
|
1814
|
-
fontSize: _iconSize,
|
|
1815
|
-
iconId: iconId
|
|
1816
|
-
}, void 0)
|
|
1817
|
-
}), void 0)
|
|
1834
|
+
size: _size,
|
|
1835
|
+
thickness: _thickness,
|
|
1836
|
+
value: value,
|
|
1837
|
+
variant: _variant
|
|
1838
|
+
}, void 0)
|
|
1818
1839
|
}), void 0);
|
|
1819
1840
|
};
|
|
1820
1841
|
|
|
1821
|
-
const
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
required
|
|
1828
|
-
}) => {
|
|
1829
|
-
return jsx(StyledInputLabel, Object.assign({
|
|
1830
|
-
"data-testid": dataTestId,
|
|
1831
|
-
classes: {
|
|
1832
|
-
root: labelClassName
|
|
1833
|
-
},
|
|
1834
|
-
disabled: _disabled,
|
|
1835
|
-
error: _error,
|
|
1836
|
-
htmlFor: id,
|
|
1837
|
-
required: required,
|
|
1838
|
-
shrink: false,
|
|
1839
|
-
variant: "outlined"
|
|
1840
|
-
}, {
|
|
1841
|
-
children: jsx(DotTypography, Object.assign({
|
|
1842
|
-
variant: "subtitle2"
|
|
1843
|
-
}, {
|
|
1844
|
-
children: label
|
|
1845
|
-
}), void 0)
|
|
1846
|
-
}), void 0);
|
|
1847
|
-
};
|
|
1842
|
+
const levelBottom = -1;
|
|
1843
|
+
const levelFirst = 1;
|
|
1844
|
+
const levelSecond = 10;
|
|
1845
|
+
const levelThird = 100;
|
|
1846
|
+
const levelFourth = 1000;
|
|
1847
|
+
const levelTop = 9999;
|
|
1848
1848
|
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1849
|
+
var variables = /*#__PURE__*/Object.freeze({
|
|
1850
|
+
__proto__: null,
|
|
1851
|
+
levelBottom: levelBottom,
|
|
1852
|
+
levelFirst: levelFirst,
|
|
1853
|
+
levelSecond: levelSecond,
|
|
1854
|
+
levelThird: levelThird,
|
|
1855
|
+
levelFourth: levelFourth,
|
|
1856
|
+
levelTop: levelTop
|
|
1857
|
+
});
|
|
1858
|
+
|
|
1859
|
+
const rootClassName$V = 'dot-popper';
|
|
1860
|
+
const StyledPopper$1 = styled(Popper).withConfig({
|
|
1861
|
+
displayName: "Popperstyles__StyledPopper",
|
|
1862
|
+
componentId: "sd1h8p-0"
|
|
1863
|
+
})(["", ""], ({
|
|
1864
|
+
theme
|
|
1865
|
+
}) => css(["&.", "{font-family:", ";font-size:", "px;}"], rootClassName$V, theme.typography.fontFamily, theme.typography.body1.fontSize));
|
|
1866
|
+
|
|
1867
|
+
const flyoutMenuClassName = 'dot-flyout-menu';
|
|
1868
|
+
const rootClassName$U = 'dot-menu';
|
|
1869
|
+
const getListMaxHeight = maxHeight => isString$1(maxHeight) ? maxHeight : `${maxHeight}px`;
|
|
1870
|
+
const StyledPopper = styled(Popper).withConfig({
|
|
1871
|
+
displayName: "Menustyles__StyledPopper",
|
|
1872
|
+
componentId: "sc-134fmqu-0"
|
|
1873
|
+
})(["", ""], ({
|
|
1874
|
+
theme
|
|
1875
|
+
}) => css(["&.", "{font-family:", ";font-size:", "px;z-index:", ";}&.", ",&.", "{&.loading .MuiPaper-root{align-items:center;display:flex;justify-content:center;min-height:200px;min-width:200px;}ul,.dot-action-item{.dot-action-item-text{white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;}}ul{box-sizing:content-box;min-width:112px;overflow:auto;", " .dot-li{min-height:auto;}}.dot-action-item{height:", ";border-top:1px solid ", ";line-height:inherit;button.dot-button{border-radius:", ";justify-content:flex-start;height:100%;margin:0;&:focus-visible{background-color:", ";}.MuiButton-label{gap:", ";.MuiButton-startIcon{margin-left:0;.dot-icon{flex-shrink:0;}}}}}}"], rootClassName$V, theme.typography.fontFamily, theme.typography.body1.fontSize, levelSecond, rootClassName$U, rootClassName$V, ({
|
|
1876
|
+
$maxHeight
|
|
1877
|
+
}) => $maxHeight !== undefined && `
|
|
1878
|
+
max-height: ${getListMaxHeight($maxHeight)};
|
|
1879
|
+
`, theme.spacing(7), theme.palette.grey[100], theme.spacing(0, 0, 0.5, 0.5), theme.palette.layer.n100, theme.spacing(3)));
|
|
1880
|
+
|
|
1881
|
+
const MENU_ITEM_HEIGHT_NORMAL = 48;
|
|
1882
|
+
const MENU_ITEM_HEIGHT_DENSE = 36;
|
|
1883
|
+
const DEFAULT_MAX_VISIBLE_ITEMS = 7;
|
|
1884
|
+
|
|
1885
|
+
const rootClassName$T = 'dot-ul';
|
|
1886
|
+
const listItemClassName$1 = 'dot-li';
|
|
1887
|
+
const listItemWithSubmenuClassName = 'dot-li-with-submenu';
|
|
1888
|
+
const StyledMenuList = styled(MenuList).withConfig({
|
|
1889
|
+
displayName: "MenuListstyles__StyledMenuList",
|
|
1890
|
+
componentId: "yqdwwg-0"
|
|
1891
|
+
})(["", ""], ({
|
|
1892
|
+
theme
|
|
1893
|
+
}) => css(["&.", "{.dot-li{font-size:", "px;justify-content:space-between;gap:", ";&:hover{background:", ";}&.Mui-selected,&.Mui-selected:hover{background:", ";}&.", "{padding-right:", ";}}}"], rootClassName$T, theme.typography.body1.fontSize, theme.spacing(3), hoverGray, lightSelectedGray, listItemWithSubmenuClassName, theme.spacing(0.5)));
|
|
1894
|
+
|
|
1895
|
+
const getDefaultItemHeight = isDense => isDense ? MENU_ITEM_HEIGHT_DENSE : MENU_ITEM_HEIGHT_NORMAL;
|
|
1896
|
+
const calculateItemHeight = (isDense, customItemHeight, menuItemHeight) => {
|
|
1897
|
+
// Custom item height must NOT be lower than MENU_ITEM_HEIGHT_DENSE value
|
|
1898
|
+
if (customItemHeight && customItemHeight >= MENU_ITEM_HEIGHT_DENSE) {
|
|
1899
|
+
return customItemHeight;
|
|
1900
|
+
}
|
|
1901
|
+
const itemHeightType = typeof menuItemHeight;
|
|
1902
|
+
if (itemHeightType === 'number' || itemHeightType === 'string') {
|
|
1903
|
+
return menuItemHeight;
|
|
1904
|
+
} else {
|
|
1905
|
+
return getDefaultItemHeight(isDense);
|
|
1906
|
+
}
|
|
1907
|
+
};
|
|
1908
|
+
const getNumberOfVisibleItems = (numberOfItems, maxVisibleItems) => {
|
|
1909
|
+
if (maxVisibleItems && maxVisibleItems > 0) {
|
|
1910
|
+
return maxVisibleItems <= numberOfItems ? maxVisibleItems : numberOfItems;
|
|
1911
|
+
}
|
|
1912
|
+
return DEFAULT_MAX_VISIBLE_ITEMS;
|
|
1913
|
+
};
|
|
1914
|
+
const calculateMaxHeight = ({
|
|
1915
|
+
isDense,
|
|
1916
|
+
maxVisibleItems,
|
|
1917
|
+
menuItems,
|
|
1918
|
+
menuItemHeight
|
|
1857
1919
|
}) => {
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
}
|
|
1862
|
-
|
|
1863
|
-
const
|
|
1864
|
-
|
|
1865
|
-
const
|
|
1866
|
-
const
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
}
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
children: styledAdornment
|
|
1876
|
-
}), void 0) : styledAdornment;
|
|
1920
|
+
// if menuItemHeight is "auto" set maxHeight as same
|
|
1921
|
+
if (typeof menuItemHeight === 'string') {
|
|
1922
|
+
return menuItemHeight;
|
|
1923
|
+
}
|
|
1924
|
+
// If 'menuItemHeight' is set it will take precedence here
|
|
1925
|
+
const itemHeight = menuItemHeight ? menuItemHeight : getDefaultItemHeight(isDense);
|
|
1926
|
+
let maxHeight = 0;
|
|
1927
|
+
const numberOfVisibleItems = getNumberOfVisibleItems(menuItems.length, maxVisibleItems);
|
|
1928
|
+
const visibleItems = menuItems.slice(0, numberOfVisibleItems);
|
|
1929
|
+
visibleItems.forEach(({
|
|
1930
|
+
height
|
|
1931
|
+
}) => {
|
|
1932
|
+
const customItemHeight = height ? height : itemHeight;
|
|
1933
|
+
// + 3 is for bottom margin of menuItem
|
|
1934
|
+
maxHeight += customItemHeight + 3;
|
|
1935
|
+
});
|
|
1936
|
+
return maxHeight;
|
|
1877
1937
|
};
|
|
1878
|
-
const
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1938
|
+
const checkForSubItems = menuItems => menuItems.some(menuItem => menuItem.items && menuItems.length > 0);
|
|
1939
|
+
const checkIfSubmenu = anchorElement => {
|
|
1940
|
+
if (!anchorElement) return false;
|
|
1941
|
+
return anchorElement.classList.contains(listItemWithSubmenuClassName);
|
|
1942
|
+
};
|
|
1943
|
+
const checkIfMenuItemSelected = (key, selectedKey, activeSubmenu) => {
|
|
1944
|
+
return selectedKey === key || activeSubmenu === key;
|
|
1945
|
+
};
|
|
1946
|
+
const checkForAutoFocus = (autoFocusItem, isFirstItem) => !!(autoFocusItem && isFirstItem);
|
|
1947
|
+
|
|
1948
|
+
/**
|
|
1949
|
+
* Since this component is used inside 'ClickAwayListener',
|
|
1950
|
+
* it needs to be contained within 'forwardRef' function
|
|
1951
|
+
*/
|
|
1952
|
+
const DotMenuList = /*#__PURE__*/forwardRef(({
|
|
1953
|
+
autoFocusItem,
|
|
1884
1954
|
className,
|
|
1885
|
-
defaultValue,
|
|
1886
1955
|
'data-testid': dataTestId,
|
|
1887
|
-
|
|
1888
|
-
error: _error = false,
|
|
1889
|
-
endAdornmentTooltip,
|
|
1890
|
-
fullWidth: _fullWidth = true,
|
|
1891
|
-
hasDebounce,
|
|
1892
|
-
helperText,
|
|
1893
|
-
endIcon,
|
|
1956
|
+
dense,
|
|
1894
1957
|
id,
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
startIcon,
|
|
1912
|
-
size: _size = 'small',
|
|
1913
|
-
success,
|
|
1914
|
-
type: _type = 'text',
|
|
1915
|
-
value,
|
|
1916
|
-
warning: _warning = false
|
|
1917
|
-
}) => {
|
|
1918
|
-
const hasError = _error && errorClassName;
|
|
1919
|
-
const hasWarning = !_error && _warning && warningClassName;
|
|
1920
|
-
const hasSuccess = !_error && !_warning && success && successClassName;
|
|
1921
|
-
const hasEndAdornmentIcon = endIcon || _error || hasWarning || hasSuccess;
|
|
1922
|
-
// This state is used only with debounce feature enabled
|
|
1923
|
-
const [inputTextState, setInputTextState] = useState(hasDebounce && getInitialState(value));
|
|
1924
|
-
const rootStyles = useStylesWithRootClass(rootClassName$10, hasError, hasWarning, hasSuccess, _readOnly ? 'read-only' : '');
|
|
1925
|
-
// Used to control text value from the consumer component
|
|
1926
|
-
// when debounce feature is enabled
|
|
1927
|
-
useEffect(() => {
|
|
1928
|
-
if (hasDebounce && value !== inputTextState.inputValue) {
|
|
1929
|
-
setInputTextState(getInitialState(value));
|
|
1930
|
-
}
|
|
1931
|
-
}, [value]);
|
|
1932
|
-
// Improve performance by avoiding callback execution
|
|
1933
|
-
// on each keystroke (if debounce feature is active)
|
|
1934
|
-
useEffect(() => {
|
|
1935
|
-
// Do not proceed if debounce feature is turned
|
|
1936
|
-
// off or there is no event defined
|
|
1937
|
-
if (!hasDebounce || !inputTextState || !inputTextState.changeEvent || !onChange) return;
|
|
1938
|
-
const handler = setTimeout(() => {
|
|
1939
|
-
onChange(inputTextState.changeEvent);
|
|
1940
|
-
}, DELAY_MS);
|
|
1941
|
-
return () => clearTimeout(handler);
|
|
1942
|
-
}, [inputTextState]);
|
|
1943
|
-
const handleChange = e => {
|
|
1944
|
-
// We need to have control over change event and input value separately
|
|
1945
|
-
// so that we can set initial state via 'value' prop (if needed)
|
|
1946
|
-
hasDebounce ? setInputTextState({
|
|
1947
|
-
changeEvent: e,
|
|
1948
|
-
inputValue: e.target.value
|
|
1949
|
-
}) : onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
1958
|
+
maxVisibleItems,
|
|
1959
|
+
menuItemHeight,
|
|
1960
|
+
menuItems,
|
|
1961
|
+
onItemSelect,
|
|
1962
|
+
onKeyDown,
|
|
1963
|
+
onSubMenuCreate,
|
|
1964
|
+
selectedKey
|
|
1965
|
+
}, ref) => {
|
|
1966
|
+
const rootClasses = useStylesWithRootClass(rootClassName$T, className);
|
|
1967
|
+
const [activeSubmenu, setActiveSubmenu] = useState(null);
|
|
1968
|
+
const [subItemAnchorEl, setSubItemAnchorEl] = useState(null);
|
|
1969
|
+
const openSubmenu = (target, itemKey) => {
|
|
1970
|
+
// Set new anchor for submenu and active submenu key
|
|
1971
|
+
// so that new submenu can be opened
|
|
1972
|
+
setSubItemAnchorEl(target);
|
|
1973
|
+
setActiveSubmenu(itemKey);
|
|
1950
1974
|
};
|
|
1951
|
-
const
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
if (!startIcon) return null;
|
|
1957
|
-
return jsx(StyledAdornment, Object.assign({
|
|
1958
|
-
className: `${adornmentIconClassName} start`,
|
|
1959
|
-
position: "start"
|
|
1960
|
-
}, {
|
|
1961
|
-
children: startIcon
|
|
1962
|
-
}), void 0);
|
|
1975
|
+
const closeActiveSubmenu = () => {
|
|
1976
|
+
// We want to clean active submenu state if it exists.
|
|
1977
|
+
// This will make previous submenu disappear when
|
|
1978
|
+
// hovering to item with no submenu items
|
|
1979
|
+
activeSubmenu && setActiveSubmenu(null);
|
|
1963
1980
|
};
|
|
1964
|
-
const
|
|
1965
|
-
|
|
1966
|
-
return jsx(EndAdornment, Object.assign({}, {
|
|
1967
|
-
endAdornmentTooltip,
|
|
1968
|
-
error: _error,
|
|
1969
|
-
dataTestId,
|
|
1970
|
-
endIcon,
|
|
1971
|
-
success,
|
|
1972
|
-
warning: _warning
|
|
1973
|
-
}), void 0);
|
|
1981
|
+
const getMouseEnterHandler = (itemKey, hasSubmenu) => event => {
|
|
1982
|
+
hasSubmenu ? openSubmenu(event.currentTarget, itemKey) : closeActiveSubmenu();
|
|
1974
1983
|
};
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1984
|
+
return jsx(StyledMenuList, Object.assign({
|
|
1985
|
+
classes: {
|
|
1986
|
+
root: rootClasses
|
|
1987
|
+
},
|
|
1988
|
+
"data-testid": dataTestId,
|
|
1989
|
+
dense: dense,
|
|
1990
|
+
id: id,
|
|
1991
|
+
onKeyDown: onKeyDown,
|
|
1992
|
+
style: {
|
|
1993
|
+
height: calculateMaxHeight({
|
|
1994
|
+
isDense: dense,
|
|
1995
|
+
maxVisibleItems,
|
|
1996
|
+
menuItems,
|
|
1997
|
+
menuItemHeight
|
|
1998
|
+
})
|
|
1999
|
+
}
|
|
1978
2000
|
}, {
|
|
1979
|
-
children:
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
}
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2001
|
+
children: menuItems.map((item, index) => {
|
|
2002
|
+
const {
|
|
2003
|
+
ariaLabel: itemAriaLabel,
|
|
2004
|
+
children,
|
|
2005
|
+
classes,
|
|
2006
|
+
disabled,
|
|
2007
|
+
divider,
|
|
2008
|
+
height,
|
|
2009
|
+
items: subItems,
|
|
2010
|
+
key
|
|
2011
|
+
} = item;
|
|
2012
|
+
const itemHeight = calculateItemHeight(dense, height, menuItemHeight);
|
|
2013
|
+
const isSelected = checkIfMenuItemSelected(key, selectedKey, activeSubmenu);
|
|
2014
|
+
const isFirstItem = index === 0;
|
|
2015
|
+
const hasSubmenu = !!subItems;
|
|
2016
|
+
const hasAutoFocus = checkForAutoFocus(autoFocusItem, isFirstItem);
|
|
2017
|
+
const menuItemClasses = useStylesWithRootClass(listItemClassName$1, hasSubmenu ? listItemWithSubmenuClassName : '', classes ? classes : '');
|
|
2018
|
+
const handleClick = event => {
|
|
2019
|
+
// Execute select callback only for items which does not have
|
|
2020
|
+
// submenu defined. If there is no menu or handler - prevent
|
|
2021
|
+
// further propagation of the current event so that click on
|
|
2022
|
+
// items with submenu does not close the menu
|
|
2023
|
+
!hasSubmenu && onItemSelect ? onItemSelect(event, key) : event.stopPropagation();
|
|
2024
|
+
};
|
|
2025
|
+
/**
|
|
2026
|
+
* If there is submenu, right arrow icon will be added
|
|
2027
|
+
* and sub-menu will be rendered
|
|
2028
|
+
*/
|
|
2029
|
+
return jsxs(MenuItem, Object.assign({
|
|
2030
|
+
autoFocus: hasAutoFocus,
|
|
2031
|
+
"aria-label": itemAriaLabel,
|
|
2032
|
+
className: menuItemClasses,
|
|
2033
|
+
disabled: disabled,
|
|
2034
|
+
disableRipple: hasSubmenu,
|
|
2035
|
+
divider: divider,
|
|
2036
|
+
onClick: handleClick,
|
|
2037
|
+
onMouseEnter: getMouseEnterHandler(key, hasSubmenu),
|
|
2038
|
+
ref: ref,
|
|
2039
|
+
style: {
|
|
2040
|
+
height: itemHeight
|
|
2041
|
+
},
|
|
2042
|
+
selected: isSelected
|
|
2043
|
+
}, {
|
|
2044
|
+
children: [children, hasSubmenu && jsx(DotIcon, {
|
|
2045
|
+
"data-testid": "dot-item-arrow-icon",
|
|
2046
|
+
iconId: "arrow-right"
|
|
2047
|
+
}, void 0), hasSubmenu && onSubMenuCreate({
|
|
2048
|
+
anchorElement: subItemAnchorEl,
|
|
2049
|
+
isOpened: isSelected,
|
|
2050
|
+
subMenuId: key,
|
|
2051
|
+
subMenuItems: subItems
|
|
2052
|
+
})]
|
|
2053
|
+
}), key);
|
|
2054
|
+
})
|
|
2029
2055
|
}), void 0);
|
|
2030
|
-
};
|
|
2031
|
-
|
|
2032
|
-
const rootClassName$W = 'dot-search-input';
|
|
2033
|
-
const StyledSearchInput = styled.span.withConfig({
|
|
2034
|
-
displayName: "SearchInputstyles__StyledSearchInput",
|
|
2035
|
-
componentId: "qlwzku-0"
|
|
2036
|
-
})(["", ""], () => css(["&.", "{}"], rootClassName$W));
|
|
2056
|
+
});
|
|
2037
2057
|
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2058
|
+
const DotMenu = ({
|
|
2059
|
+
anchorEl,
|
|
2060
|
+
ariaLabel,
|
|
2041
2061
|
className,
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2062
|
+
'data-testid': dataTestId,
|
|
2063
|
+
dense: _dense = true,
|
|
2064
|
+
disablePortal,
|
|
2065
|
+
id,
|
|
2066
|
+
loading: _loading = false,
|
|
2067
|
+
maxVisibleItems: _maxVisibleItems = DEFAULT_MAX_VISIBLE_ITEMS,
|
|
2068
|
+
menuItemHeight,
|
|
2069
|
+
menuItems: _menuItems = [],
|
|
2070
|
+
menuPlacement: _menuPlacement = 'bottom',
|
|
2071
|
+
onLeave,
|
|
2072
|
+
onSelect,
|
|
2073
|
+
open: _open = false,
|
|
2074
|
+
selectedKey
|
|
2075
|
+
}) => {
|
|
2076
|
+
const rootClasses = useStylesWithRootClass(rootClassName$U, className, _loading ? 'loading' : '');
|
|
2077
|
+
const isSubmenu = checkIfSubmenu(anchorEl);
|
|
2078
|
+
const hasSubItems = checkForSubItems(_menuItems);
|
|
2079
|
+
// Timeout object is customizable when Menu component is either submenu
|
|
2080
|
+
// (it is opened within parent menu) or it contains at least one item which
|
|
2081
|
+
// has sub-items. This is done because when multi-level menu is closing it
|
|
2082
|
+
// will first close the parent and only then child menus - which looks
|
|
2083
|
+
// a bit weird - so here I'm giving it exit value of 0 so that it looks like
|
|
2084
|
+
// they all close at the same time. For "normal" menus, timeout is unnecessary.
|
|
2085
|
+
const timeout = isSubmenu || hasSubItems ? {
|
|
2086
|
+
exit: 0,
|
|
2087
|
+
enter: 300
|
|
2088
|
+
} : undefined;
|
|
2089
|
+
const handleSelect = (event, itemKey) => {
|
|
2090
|
+
onLeave && onLeave(event);
|
|
2091
|
+
onSelect && onSelect(event, id, itemKey);
|
|
2092
|
+
};
|
|
2093
|
+
const handleListKeyDown = event => {
|
|
2094
|
+
if (onLeave && event.key === 'Tab') {
|
|
2095
|
+
event.preventDefault();
|
|
2096
|
+
onLeave(event);
|
|
2097
|
+
}
|
|
2098
|
+
};
|
|
2099
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2100
|
+
const handleClickAway = event => {
|
|
2101
|
+
if (onLeave && (!anchorEl || !anchorEl.contains(event.currentTarget))) {
|
|
2102
|
+
onLeave(event);
|
|
2103
|
+
}
|
|
2104
|
+
};
|
|
2105
|
+
return jsx(StyledPopper, Object.assign({
|
|
2106
|
+
anchorEl: anchorEl,
|
|
2107
|
+
"aria-label": ariaLabel,
|
|
2108
|
+
className: rootClasses,
|
|
2109
|
+
"data-testid": dataTestId,
|
|
2110
|
+
disablePortal: disablePortal,
|
|
2111
|
+
open: _open,
|
|
2112
|
+
placement: _menuPlacement,
|
|
2113
|
+
role: undefined,
|
|
2114
|
+
transition: true
|
|
2078
2115
|
}, {
|
|
2079
|
-
children:
|
|
2080
|
-
|
|
2081
|
-
|
|
2116
|
+
children: ({
|
|
2117
|
+
TransitionProps,
|
|
2118
|
+
placement
|
|
2119
|
+
}) => jsx(Fade, Object.assign({}, TransitionProps, {
|
|
2120
|
+
style: {
|
|
2121
|
+
transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom'
|
|
2122
|
+
},
|
|
2123
|
+
timeout: timeout
|
|
2082
2124
|
}, {
|
|
2083
|
-
children: jsx(
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2125
|
+
children: jsx(Paper, {
|
|
2126
|
+
children: jsx(ClickAwayListener, Object.assign({
|
|
2127
|
+
onClickAway: handleClickAway
|
|
2128
|
+
}, {
|
|
2129
|
+
children: _loading ? jsx(DotProgress, {
|
|
2130
|
+
"data-testid": "loading-indicator",
|
|
2131
|
+
tooltip: "Loading Data...",
|
|
2132
|
+
value: 20
|
|
2133
|
+
}, void 0) : jsx(DotMenuList, {
|
|
2134
|
+
autoFocusItem: _open,
|
|
2135
|
+
"data-testid": `${dataTestId}-menu`,
|
|
2136
|
+
dense: _dense,
|
|
2137
|
+
id: id,
|
|
2138
|
+
maxVisibleItems: _maxVisibleItems,
|
|
2139
|
+
menuItemHeight: menuItemHeight,
|
|
2140
|
+
menuItems: _menuItems,
|
|
2141
|
+
onItemSelect: handleSelect,
|
|
2142
|
+
onKeyDown: handleListKeyDown,
|
|
2143
|
+
onSubMenuCreate: ({
|
|
2144
|
+
anchorElement,
|
|
2145
|
+
isOpened,
|
|
2146
|
+
subMenuId,
|
|
2147
|
+
subMenuItems
|
|
2148
|
+
}) => jsx(DotMenu, {
|
|
2149
|
+
anchorEl: anchorElement,
|
|
2150
|
+
menuPlacement: "right-start",
|
|
2151
|
+
id: subMenuId,
|
|
2152
|
+
menuItems: subMenuItems,
|
|
2153
|
+
open: isOpened,
|
|
2154
|
+
onLeave: onLeave,
|
|
2155
|
+
onSelect: onSelect,
|
|
2156
|
+
selectedKey: selectedKey
|
|
2157
|
+
}, void 0),
|
|
2158
|
+
selectedKey: selectedKey
|
|
2159
|
+
}, void 0)
|
|
2160
|
+
}), void 0)
|
|
2095
2161
|
}, void 0)
|
|
2096
2162
|
}), void 0)
|
|
2097
2163
|
}), void 0);
|
|
2098
|
-
}
|
|
2164
|
+
};
|
|
2099
2165
|
|
|
2100
|
-
const
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2166
|
+
const CreateUUID = () => {
|
|
2167
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
2168
|
+
const r = Math.random() * 16 | 0,
|
|
2169
|
+
v = c === 'x' ? r : r & 0x3 | 0x8;
|
|
2170
|
+
return v.toString(16);
|
|
2171
|
+
});
|
|
2172
|
+
};
|
|
2173
|
+
|
|
2174
|
+
const rootClassName$S = 'dot-drawer';
|
|
2175
|
+
const StyledDrawer = styled(Drawer).withConfig({
|
|
2176
|
+
displayName: "Drawerstyles__StyledDrawer",
|
|
2177
|
+
componentId: "sc-1uiowy0-0"
|
|
2104
2178
|
})(["", ""], ({
|
|
2105
2179
|
theme
|
|
2106
|
-
}) => css(["&.", "{.
|
|
2180
|
+
}) => css(["&.", " .MuiBackdrop-root{background-color:", ";}.dot-drawer-paper{height:", ";padding:", ";width:", ";}"], rootClassName$S, alpha(theme.palette.grey[900], 0.7), ({
|
|
2181
|
+
height,
|
|
2182
|
+
anchor
|
|
2183
|
+
}) => anchor === 'left' || anchor === 'right' ? '100%' : height, theme.spacing(2), ({
|
|
2184
|
+
width,
|
|
2185
|
+
anchor
|
|
2186
|
+
}) => anchor === 'bottom' || anchor === 'top' ? 'auto' : width));
|
|
2107
2187
|
|
|
2108
|
-
const
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
}) => {
|
|
2115
|
-
const [showCopiedIcon, setShowCopiedIcon] = useState(false);
|
|
2116
|
-
const copyToClipboard = () => {
|
|
2117
|
-
// The check for navigator.clipboard.writeText is because this function is
|
|
2118
|
-
// only supported in secure contexts (https). This will always be the case in
|
|
2119
|
-
// production but not when running locally.
|
|
2120
|
-
if (!navigator.clipboard || !navigator.clipboard.writeText) {
|
|
2121
|
-
console.warn('Copy to clipboard is only supported in secure context (https)', value);
|
|
2122
|
-
} else {
|
|
2123
|
-
navigator.clipboard.writeText(value);
|
|
2124
|
-
}
|
|
2125
|
-
};
|
|
2126
|
-
const copy = () => {
|
|
2127
|
-
copyToClipboard();
|
|
2128
|
-
setShowCopiedIcon(true);
|
|
2129
|
-
setTimeout(function () {
|
|
2130
|
-
setShowCopiedIcon(false);
|
|
2131
|
-
}, 3000);
|
|
2132
|
-
return false;
|
|
2133
|
-
};
|
|
2134
|
-
return jsxs(StyledCopyButton, Object.assign({
|
|
2135
|
-
className: rootClassName$V,
|
|
2136
|
-
"data-testid": dataTestId
|
|
2137
|
-
}, {
|
|
2138
|
-
children: [!showCopiedIcon && jsx(DotIconButton, {
|
|
2139
|
-
ariaLabel: _ariaLabel,
|
|
2140
|
-
"data-testid": `${dataTestId}-button`,
|
|
2141
|
-
iconId: "duplicate",
|
|
2142
|
-
onClick: copy,
|
|
2143
|
-
size: "small",
|
|
2144
|
-
tooltip: _copyTooltip
|
|
2145
|
-
}, void 0), showCopiedIcon && jsx(DotIcon, {
|
|
2146
|
-
className: "copied-to-clipboard",
|
|
2147
|
-
"data-testid": `${dataTestId}-icon`,
|
|
2148
|
-
fontSize: "small",
|
|
2149
|
-
iconId: "check-solid",
|
|
2150
|
-
tooltip: _copiedTooltip
|
|
2151
|
-
}, void 0)]
|
|
2152
|
-
}), void 0);
|
|
2153
|
-
};
|
|
2188
|
+
const rootClassName$R = 'dot-drawer-header';
|
|
2189
|
+
const StyleDrawerHeader = styled.div.withConfig({
|
|
2190
|
+
displayName: "DrawerHeaderstyles__StyleDrawerHeader",
|
|
2191
|
+
componentId: "sc-2d2xd3-0"
|
|
2192
|
+
})(["", ""], ({
|
|
2193
|
+
theme
|
|
2194
|
+
}) => css(["&.", "{padding:", ";display:flex;align-items:center;.close-button{margin-left:auto;}}"], rootClassName$R, theme.spacing(0, 0, 2)));
|
|
2154
2195
|
|
|
2155
|
-
const rootClassName$
|
|
2156
|
-
const
|
|
2157
|
-
displayName: "
|
|
2158
|
-
componentId: "
|
|
2159
|
-
})(["", ""], () => css(["&.", "{
|
|
2196
|
+
const rootClassName$Q = 'dot-icon-btn';
|
|
2197
|
+
const StyledIconButton = styled(IconButton).withConfig({
|
|
2198
|
+
displayName: "IconButtonstyles__StyledIconButton",
|
|
2199
|
+
componentId: "eko0kb-0"
|
|
2200
|
+
})(["", ""], () => css(["&.", "{font-size:inherit;padding:10px;.dot-icon.MuiIcon-fontSizeSmall{padding:1px;}&.MuiIconButton-sizeSmall{padding:3px;}&.ripple-disabled{&:hover,&:active,&:focus{background:", ";}}"], rootClassName$Q, hoverGray));
|
|
2160
2201
|
|
|
2161
|
-
const
|
|
2202
|
+
const DotIconButton = ({
|
|
2162
2203
|
ariaLabel,
|
|
2163
|
-
children,
|
|
2164
2204
|
className,
|
|
2165
|
-
color: _color = '
|
|
2205
|
+
color: _color = 'inherit',
|
|
2166
2206
|
'data-testid': dataTestId,
|
|
2167
|
-
|
|
2207
|
+
disabled: _disabled = false,
|
|
2208
|
+
disableRipple: _disableRipple = false,
|
|
2209
|
+
iconId,
|
|
2210
|
+
iconSize: _iconSize = 'small',
|
|
2168
2211
|
onClick,
|
|
2169
|
-
onMouseEnter,
|
|
2170
|
-
rel: _rel = 'noreferrer',
|
|
2171
|
-
tabIndex: _tabIndex = 0,
|
|
2172
|
-
target,
|
|
2173
2212
|
tooltip,
|
|
2174
|
-
|
|
2213
|
+
size: _size = 'medium'
|
|
2175
2214
|
}) => {
|
|
2176
|
-
const
|
|
2177
|
-
const
|
|
2178
|
-
if (onClick && event.key === 'Enter') {
|
|
2179
|
-
event.preventDefault();
|
|
2180
|
-
onClick(event);
|
|
2181
|
-
}
|
|
2182
|
-
};
|
|
2215
|
+
const rippleClassName = _disableRipple ? 'ripple-disabled' : '';
|
|
2216
|
+
const rootClasses = useStylesWithRootClass(rootClassName$Q, rippleClassName, className);
|
|
2183
2217
|
return jsx(DotTooltip, Object.assign({
|
|
2218
|
+
"data-testid": "icon-button-tooltip",
|
|
2184
2219
|
title: tooltip
|
|
2185
2220
|
}, {
|
|
2186
|
-
children: jsx(
|
|
2221
|
+
children: jsx(StyledIconButton, Object.assign({
|
|
2187
2222
|
"aria-label": ariaLabel,
|
|
2188
2223
|
classes: {
|
|
2189
2224
|
root: rootClasses
|
|
2190
2225
|
},
|
|
2191
2226
|
color: _color,
|
|
2192
2227
|
"data-testid": dataTestId,
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
rel: _rel,
|
|
2198
|
-
tabIndex: _tabIndex,
|
|
2199
|
-
target: target,
|
|
2200
|
-
underline: underline
|
|
2228
|
+
disableRipple: _disableRipple,
|
|
2229
|
+
disabled: _disabled,
|
|
2230
|
+
onClick: event => onClick && onClick(event),
|
|
2231
|
+
size: _size
|
|
2201
2232
|
}, {
|
|
2202
|
-
children:
|
|
2233
|
+
children: jsx(DotIcon, {
|
|
2234
|
+
"data-testid": "button-icon",
|
|
2235
|
+
fontSize: _iconSize,
|
|
2236
|
+
iconId: iconId
|
|
2237
|
+
}, void 0)
|
|
2203
2238
|
}), void 0)
|
|
2204
2239
|
}), void 0);
|
|
2205
2240
|
};
|
|
2206
2241
|
|
|
2207
|
-
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='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M12.4332 16.3533V14.8333H11.5665V16.3533L10.7432 15.8933L9.85651 16.4033L11.9998 17.6366L14.1932 16.3733L13.3332 15.8766L12.4332 16.3533Z' fill='white'/%3e%3cpath d='M7.99328 10.1866L9.24661 10.9132L9.67995 10.1399L8.36995 9.4299L9.09328 9.01657V8.03323L7.11328 9.18323L7.11661 11.5532L7.99328 11.0566V10.1866Z' fill='white'/%3e%3cpath d='M14.6934 10.9133L15.9934 10.1733L15.99 11.0566L16.8867 11.5599V9.1766L14.81 7.98993L14.7767 8.9566L15.6167 9.45326L14.29 10.0799L14.6934 10.9133Z' fill='white'/%3e%3cpath d='M16.8801 12.5435L16.0001 12.0402V12.0935V13.7068L12.4167 11.6868V7.61015L13.9667 8.49015V7.51682L12.0001 6.35349L9.95006 7.52348V8.52348L11.4967 7.63015V11.6868L8.00006 13.8168V12.0202L7.12006 12.5235V14.8202L8.96672 15.8502L9.86672 15.3335L8.40006 14.5268L12.0001 12.4368L15.5567 14.5035L14.1301 15.3268L15.0567 15.8701L16.8701 14.8268L16.8801 12.5435Z' fill='white'/%3e%3c/svg%3e";
|
|
2208
|
-
|
|
2209
|
-
var img$5 = "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='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M14.1867 11.2667L12.1634 10.0833L10.1367 11.2667V13.62L12.1634 14.7867L14.1867 13.62V11.2667Z' fill='white'/%3e%3cpath d='M8.43666 12.0001L7.47333 11.1501V15.1667L10.41 16.8367V15.7034L8.43666 14.5401V12.0001Z' fill='white'/%3e%3cpath d='M15.8965 12V14.5833L13.9632 15.7033V16.9367L16.8532 15.1533V11.0967L15.8965 12Z' fill='white'/%3e%3cpath d='M12.1565 8.13333L14.7165 9.61333L15.4165 8.89L12.1565 7L8.87988 8.90667L9.57988 9.63333L12.1565 8.13333Z' fill='white'/%3e%3c/svg%3e";
|
|
2210
|
-
|
|
2211
|
-
var img$4 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%2333D389'/%3e%3cpath d='M17.0033 7.62322H16.4567C16.3925 7.62863 16.3324 7.65679 16.2871 7.70264C16.2419 7.74848 16.2146 7.80898 16.21 7.87322V9.14322C15.7432 8.43248 15.1064 7.84955 14.3572 7.44732C13.6081 7.04509 12.7703 6.8363 11.92 6.83989C11.0845 6.84475 10.2627 7.05243 9.52515 7.44508C8.78763 7.83772 8.15649 8.40359 7.68598 9.09405C7.21547 9.7845 6.91966 10.5789 6.82398 11.4089C6.72831 12.2389 6.83562 13.0798 7.13669 13.8592C7.43777 14.6386 7.92361 15.3332 8.55245 15.8834C9.18128 16.4335 9.93431 16.8227 10.7468 17.0176C11.5593 17.2124 12.4069 17.207 13.2169 17.0019C14.0269 16.7967 14.7749 16.398 15.3967 15.8399C15.4257 15.8182 15.4492 15.79 15.4654 15.7576C15.4816 15.7252 15.49 15.6894 15.49 15.6532C15.49 15.617 15.4816 15.5813 15.4654 15.5489C15.4492 15.5165 15.4257 15.4883 15.3967 15.4666L14.9833 15.0532C14.9369 15.0135 14.8778 14.9917 14.8167 14.9917C14.7556 14.9917 14.6965 15.0135 14.65 15.0532C13.9076 15.7352 12.9312 16.1052 11.9233 16.0866C11.1892 16.087 10.4684 15.8897 9.83687 15.5154C9.20531 15.141 8.68627 14.6034 8.33429 13.9591C7.98231 13.3148 7.81039 12.5876 7.83662 11.8539C7.86284 11.1202 8.08624 10.4071 8.48332 9.78959C8.8804 9.17207 9.4365 8.67292 10.0932 8.34461C10.7499 8.0163 11.4828 7.87095 12.2151 7.92384C12.9474 7.97674 13.6519 8.22592 14.2545 8.6452C14.8572 9.06448 15.3358 9.63837 15.64 10.3066H14.1467C14.0828 10.3112 14.0227 10.3387 13.9774 10.384C13.9321 10.4293 13.9046 10.4893 13.9 10.5532V11.0466C13.9046 11.1104 13.9321 11.1705 13.9774 11.2158C14.0227 11.2611 14.0828 11.2886 14.1467 11.2932H17C17.0639 11.2886 17.124 11.2611 17.1693 11.2158C17.2146 11.1705 17.242 11.1104 17.2467 11.0466V7.87322C17.2422 7.8095 17.2154 7.74942 17.1708 7.70364C17.1263 7.65787 17.0669 7.62938 17.0033 7.62322Z' fill='white'/%3e%3cpath d='M12.1232 9.39987C12.1667 9.39747 12.2077 9.37914 12.2384 9.34839C12.2692 9.31764 12.2875 9.27662 12.2899 9.2332C12.2899 9.2332 12.3399 8.8332 12.3399 8.69987C12.3399 8.56653 12.2499 8.4932 12.1666 8.48987C11.5045 8.45232 10.8457 8.60791 10.2703 8.93771C9.69497 9.26752 9.22779 9.75734 8.92557 10.3477C8.62335 10.938 8.4991 11.6034 8.56792 12.263C8.63675 12.9226 8.89568 13.548 9.31325 14.0632C9.83849 14.7239 10.5905 15.1658 11.4232 15.3032C11.5166 15.3032 11.5999 15.2632 11.6299 15.1365C11.6299 15.1365 11.6999 14.8032 11.7132 14.6832C11.7233 14.639 11.7157 14.5927 11.692 14.554C11.6684 14.5154 11.6305 14.4876 11.5866 14.4765C11.225 14.4227 10.8806 14.2869 10.5795 14.0795C10.2785 13.8721 10.029 13.5986 9.84992 13.2799C9.64046 12.9274 9.51393 12.5318 9.47992 12.1232C9.44986 11.7648 9.49697 11.4042 9.61806 11.0655C9.73915 10.7269 9.93142 10.4181 10.1819 10.1601C10.4324 9.90199 10.7353 9.70061 11.0702 9.56947C11.405 9.43834 11.7641 9.38051 12.1232 9.39987Z' fill='white'/%3e%3cpath d='M13.9433 13.1568C13.96 13.1389 13.9724 13.1175 13.9796 13.0942C13.9868 13.0708 13.9885 13.0461 13.9846 13.0219C13.9808 12.9978 13.9714 12.9749 13.9573 12.9549C13.9432 12.9349 13.9247 12.9185 13.9033 12.9068L13.6133 12.7001C13.5739 12.6762 13.5272 12.6674 13.4818 12.6754C13.4364 12.6833 13.3955 12.7075 13.3666 12.7434C13.2321 12.9033 13.0642 13.0318 12.8747 13.12C12.6853 13.2082 12.4789 13.2538 12.2699 13.2538C12.061 13.2538 11.8546 13.2082 11.6651 13.12C11.4757 13.0318 11.3078 12.9033 11.1733 12.7434C11.1277 12.6913 11.0864 12.6356 11.0499 12.5768C10.9268 12.3776 10.8582 12.1495 10.8512 11.9155C10.8442 11.6814 10.8989 11.4496 11.0099 11.2434C11.0314 11.2102 11.0389 11.1699 11.0308 11.1312C11.0227 11.0925 10.9996 11.0585 10.9666 11.0368L10.6333 10.7901C10.5891 10.7715 10.5396 10.7697 10.4942 10.7851C10.4487 10.8004 10.4105 10.8319 10.3866 10.8734C10.2376 11.1465 10.153 11.45 10.1391 11.7608C10.1253 12.0716 10.1825 12.3815 10.3066 12.6668C10.4127 12.938 10.5831 13.1794 10.8033 13.3701C11.1902 13.7461 11.7104 13.9534 12.2499 13.9468C12.5743 13.9565 12.8964 13.8902 13.1905 13.753C13.4845 13.6158 13.7424 13.4116 13.9433 13.1568Z' fill='white'/%3e%3c/svg%3e";
|
|
2212
|
-
|
|
2213
|
-
var img$3 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M17.6865 10.0334C17.3062 9.49067 16.7772 9.06934 16.1632 8.82008C15.6426 8.61932 15.0801 8.55138 14.5267 8.62237C13.9733 8.69337 13.4462 8.90108 12.9932 9.22674C12.4991 9.62868 12.0519 10.0849 11.6598 10.5867L11.4232 10.8534L13.0198 11.5434L13.1498 11.4067C13.4002 11.1158 13.6697 10.8419 13.9565 10.5867C14.1891 10.4177 14.4599 10.3085 14.7448 10.269C15.0297 10.2294 15.3199 10.2607 15.5898 10.3601C15.916 10.4798 16.1929 10.7051 16.3765 11.0001C16.5305 11.2108 16.6383 11.4516 16.6932 11.7067C16.7448 11.9619 16.7448 12.2249 16.6932 12.4801C16.6319 12.8145 16.4783 13.125 16.2498 13.3767C16.0471 13.5809 15.7972 13.7319 15.5221 13.8162C15.2471 13.9005 14.9554 13.9156 14.6732 13.8601C14.318 13.7558 13.9714 13.6243 13.6365 13.4667L13.4598 13.3967L12.3032 14.6934L12.6365 14.8367C13.196 15.1144 13.7809 15.3376 14.3832 15.5034C14.841 15.5831 15.3102 15.5706 15.7632 15.4667C16.4116 15.3301 17.0012 14.9945 17.4498 14.5067C17.907 14.0252 18.2099 13.4182 18.3198 12.7634C18.4116 12.2979 18.4116 11.8189 18.3198 11.3534C18.186 10.8803 17.9717 10.4338 17.6865 10.0334Z' fill='white'/%3e%3cpath d='M12.8401 13.0499L11.2468 12.3599L11.1168 12.4966C10.8669 12.7942 10.5962 13.0738 10.3068 13.3332C10.0741 13.5023 9.80337 13.6115 9.51849 13.651C9.2336 13.6905 8.94336 13.6593 8.67345 13.5599C8.35219 13.4397 8.07852 13.2187 7.89345 12.9299C7.74251 12.7191 7.63591 12.4798 7.58012 12.2266C7.51653 11.9342 7.52262 11.6311 7.5979 11.3415C7.67318 11.052 7.81553 10.7842 8.01345 10.5599C8.2156 10.3551 8.46564 10.2039 8.74095 10.1201C9.01626 10.0363 9.30813 10.0225 9.59012 10.0799C9.94807 10.1781 10.2971 10.3063 10.6335 10.4632L10.8101 10.5299L11.9668 9.23324L11.6735 9.11324C11.1141 8.8326 10.5278 8.60924 9.92345 8.44657C9.37154 8.32869 8.79848 8.35611 8.26035 8.52614C7.72222 8.69617 7.23744 9.00299 6.85345 9.41657C6.38782 9.89208 6.08347 10.5019 5.98345 11.1599C5.88532 11.6248 5.88532 12.105 5.98345 12.5699C6.08588 13.0347 6.28211 13.4736 6.56012 13.8599C6.92983 14.4125 7.46217 14.8365 8.08345 15.0732C8.69864 15.3134 9.37049 15.369 10.0168 15.2332C10.4725 15.1299 10.9023 14.9348 11.2801 14.6599C11.7741 14.258 12.2214 13.8018 12.6135 13.2999L12.8401 13.0499Z' fill='white'/%3e%3c/svg%3e";
|
|
2214
|
-
|
|
2215
|
-
var img$2 = "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='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23F7B731'/%3e%3cpath d='M17.0168 10.4836C16.8598 10.4819 16.704 10.5111 16.5583 10.5697C16.4126 10.6282 16.2799 10.715 16.1679 10.8249C16.0558 10.9348 15.9665 11.0658 15.9051 11.2103C15.8437 11.3548 15.8114 11.51 15.8101 11.667C15.8125 11.8887 15.8759 12.1056 15.9934 12.2936L15.3268 13.0036C15.1062 12.8766 14.8516 12.8214 14.5982 12.8459C14.3449 12.8704 14.1055 12.9733 13.9134 13.1403L13.2168 12.667C13.3204 12.3753 13.3514 12.0627 13.307 11.7564C13.2626 11.45 13.1441 11.1591 12.9619 10.9089C12.7796 10.6587 12.5391 10.4567 12.2611 10.3204C11.9832 10.1842 11.6762 10.1178 11.3668 10.127C10.9257 10.1237 10.4963 10.268 10.1468 10.537L9.2801 9.74364C9.38078 9.56935 9.43368 9.37158 9.43343 9.1703C9.43084 9.01345 9.39725 8.85866 9.33461 8.71484C9.27197 8.57101 9.18151 8.44099 9.06844 8.33225C8.95537 8.22352 8.82191 8.13821 8.67575 8.08124C8.52958 8.02427 8.3736 7.99677 8.21677 8.0003C7.89915 8.00103 7.59426 8.12525 7.36658 8.34671C7.13891 8.56817 7.00628 8.86949 6.99677 9.18697C6.99848 9.34467 7.03153 9.50046 7.09399 9.64528C7.15645 9.7901 7.24707 9.92106 7.36059 10.0305C7.4741 10.14 7.60825 10.2259 7.75524 10.283C7.90222 10.3402 8.0591 10.3676 8.21677 10.3636C8.43906 10.3609 8.65657 10.2987 8.84677 10.1836L9.71343 10.977C9.49991 11.2949 9.3884 11.6704 9.39376 12.0533C9.39912 12.4363 9.5211 12.8085 9.74343 13.1203L9.07677 13.8303C8.87595 13.7162 8.64759 13.6597 8.41677 13.667C8.18607 13.6729 7.96224 13.7467 7.77327 13.8791C7.5843 14.0116 7.43859 14.1968 7.35437 14.4117C7.27015 14.6265 7.25115 14.8615 7.29975 15.087C7.34836 15.3126 7.46241 15.5189 7.62763 15.68C7.79286 15.8411 8.00192 15.9499 8.22867 15.9928C8.45542 16.0357 8.68978 16.0108 8.90244 15.9212C9.11509 15.8315 9.2966 15.6812 9.42425 15.4889C9.5519 15.2967 9.62002 15.0711 9.6201 14.8403C9.61839 14.6452 9.57041 14.4533 9.4801 14.2803L10.1468 13.5703C10.5613 13.8772 11.0792 14.0102 11.5902 13.9411C12.1013 13.872 12.5653 13.6062 12.8834 13.2003L13.5501 13.637C13.5048 13.7597 13.4811 13.8894 13.4801 14.0203C13.4963 14.3289 13.6304 14.6196 13.8546 14.8323C14.0788 15.045 14.376 15.1636 14.6851 15.1636C14.9942 15.1636 15.2914 15.045 15.5156 14.8323C15.7398 14.6196 15.8739 14.3289 15.8901 14.0203C15.8923 13.8081 15.8333 13.5998 15.7201 13.4203L16.3868 12.7103C16.5613 12.81 16.7591 12.8617 16.9601 12.8603C17.1212 12.8706 17.2827 12.8481 17.4348 12.794C17.5869 12.74 17.7264 12.6555 17.8448 12.5458C17.9633 12.4361 18.0581 12.3035 18.1237 12.156C18.1893 12.0085 18.2241 11.8492 18.2261 11.6878C18.2282 11.5264 18.1974 11.3662 18.1356 11.2171C18.0737 11.068 17.9822 10.933 17.8666 10.8203C17.751 10.7077 17.6137 10.6198 17.463 10.5619C17.3123 10.504 17.1514 10.4774 16.9901 10.4836H17.0168ZM11.3501 13.2436C11.1161 13.2377 10.8891 13.163 10.6973 13.0287C10.5056 12.8944 10.3578 12.7065 10.2723 12.4886C10.1868 12.2707 10.1675 12.0325 10.2167 11.8036C10.266 11.5748 10.3816 11.3656 10.5492 11.2021C10.7167 11.0387 10.9288 10.9283 11.1588 10.8848C11.3887 10.8412 11.6264 10.8665 11.8422 10.9574C12.0579 11.0483 12.242 11.2007 12.3714 11.3957C12.5009 11.5907 12.57 11.8196 12.5701 12.0536C12.5657 12.3719 12.4357 12.6756 12.2085 12.8985C11.9812 13.1214 11.6751 13.2454 11.3568 13.2436H11.3501Z' fill='white'/%3e%3c/svg%3e";
|
|
2216
|
-
|
|
2217
|
-
var img$1 = "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='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23205AB7'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M16.0859 8.30868C16.4108 8.42839 16.6831 8.6593 16.8542 8.96074L16.8628 8.97583L16.8705 8.99134C17.0174 9.28464 17.0775 9.61353 17.0441 9.93936C17.0123 11.03 16.8132 12.1093 16.4535 13.1395L16.4528 13.1415C16.1368 14.0377 15.4456 15.1335 14.6589 16.0108C14.2622 16.4533 13.8228 16.8611 13.3705 17.1668C12.9284 17.4656 12.4155 17.7067 11.8835 17.7262L11.8597 17.7271L11.8358 17.7262C11.291 17.7072 10.7708 17.4701 10.3204 17.1682C9.86244 16.8612 9.42376 16.4516 9.03057 16.0079C8.24999 15.1271 7.57941 14.0321 7.26533 13.1415L7.2645 13.1391C6.90532 12.1083 6.70674 11.0285 6.67566 9.93751C6.64229 9.61177 6.70236 9.28297 6.84922 8.98974L6.85684 8.97453L6.86522 8.95974C7.03585 8.65846 7.30747 8.42744 7.63179 8.30728L11.3874 6.76891C11.4429 6.74689 11.4996 6.7281 11.5571 6.71254C11.7538 6.6514 11.9644 6.6514 12.161 6.71254C12.2186 6.7281 12.2753 6.74693 12.3307 6.76895L12.3374 6.77159L16.0859 8.30868ZM11.9735 7.35255C11.8994 7.32695 11.8188 7.32695 11.7447 7.35255C11.7069 7.36213 11.6698 7.37415 11.6335 7.38855L7.87245 8.92913C7.69157 8.99369 7.53996 9.12117 7.44531 9.28828C7.35196 9.47467 7.31578 9.6845 7.34132 9.89139C7.36791 10.9234 7.55437 11.9449 7.89404 12.9198C8.45396 14.5075 10.3737 17.008 11.8591 17.06C13.2749 17.008 15.2642 14.5075 15.8241 12.9198C16.1642 11.9455 16.3512 10.9245 16.3784 9.89299C16.404 9.6861 16.3678 9.47627 16.2745 9.28988C16.1794 9.12247 16.0272 8.99495 15.8457 8.93073L12.0847 7.38855C12.0484 7.37415 12.0113 7.36213 11.9735 7.35255Z' fill='white'/%3e%3cpath d='M11.8631 8.29559L8.22357 9.77059V10.8904L11.8631 9.33705L15.5025 10.8904V9.77059L11.8631 8.29559Z' fill='white'/%3e%3cpath d='M10.6184 15.718C10.7942 16.0092 11.3957 16.4678 11.8633 16.4774C12.3078 16.4678 12.9324 16.0092 13.108 15.718C13.2835 15.4268 10.4426 15.427 10.6184 15.718Z' fill='white'/%3e%3c/svg%3e";
|
|
2218
|
-
|
|
2219
|
-
var img = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='-8 -8 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M19.7521 0.348161H20.3976V2.23694H20.7722L20.7752 0.351063H21.4208V0.00290065L19.7521 0V0.348161Z' fill='%232B2B2B'/%3e %3cpath d='M22.31 0.00290065H21.7223V2.23114H22.0785L22.0816 0.438104H22.0877L22.718 2.23404H22.9799L23.6224 0.441005H23.6285L23.6255 2.23404H23.997L24 0.00290065H23.4093L22.8642 1.58994H22.8551L22.31 0.00290065Z' fill='%232B2B2B'/%3e %3cpath d='M16.4863 0C15.3048 0 14.5435 0.713733 14.5435 1.81915L14.5374 8.1557C13.3194 6.89362 11.4893 6.20309 9.34245 6.20019C4.36976 6.19729 0.00609663 10.3636 6.37628e-06 15.1219C-0.00608387 19.8453 4.35149 23.9942 9.32114 24C11.5258 24.0029 13.5904 22.9207 14.6836 21.853C14.8968 23.0135 15.6306 23.6489 16.7726 23.6489C17.7165 23.6489 18.4017 22.9584 18.4047 22.0068L18.4291 1.82495C18.4291 0.734042 17.6496 0.00290135 16.4863 0ZM9.28764 20.0803C6.42218 20.0774 4.08961 17.852 4.09266 15.1161C4.0957 12.383 6.43131 10.1605 9.29677 10.1634C12.1622 10.1663 14.4948 12.3917 14.4918 15.1277C14.4887 17.8607 12.1531 20.0832 9.28764 20.0803Z' fill='%232B2B2B'/%3e %3cpath d='M9.29431 11.7998C7.3363 11.7998 5.74979 13.3143 5.74979 15.1799C5.74979 17.0455 7.3363 18.56 9.29431 18.56C11.2523 18.56 12.8419 17.0455 12.8419 15.1799C12.8419 13.3143 11.2523 11.7998 9.29431 11.7998Z' fill='%23517934'/%3e%3c/svg%3e";
|
|
2220
|
-
|
|
2221
|
-
// Takes a appType name and returns its logo as a data url.
|
|
2222
|
-
// If appType does not exist the Digital.ai logo is returned.
|
|
2223
|
-
const getLogoForAppType = appType => {
|
|
2224
|
-
switch (appType) {
|
|
2225
|
-
case 'Release':
|
|
2226
|
-
{
|
|
2227
|
-
return img$6;
|
|
2228
|
-
}
|
|
2229
|
-
case 'Deploy':
|
|
2230
|
-
{
|
|
2231
|
-
return img$5;
|
|
2232
|
-
}
|
|
2233
|
-
case 'Agility':
|
|
2234
|
-
{
|
|
2235
|
-
return img$4;
|
|
2236
|
-
}
|
|
2237
|
-
case 'Continuous Testing':
|
|
2238
|
-
{
|
|
2239
|
-
return img$3;
|
|
2240
|
-
}
|
|
2241
|
-
case 'Intelligence':
|
|
2242
|
-
{
|
|
2243
|
-
return img$2;
|
|
2244
|
-
}
|
|
2245
|
-
case 'Application Protection':
|
|
2246
|
-
{
|
|
2247
|
-
return img$1;
|
|
2248
|
-
}
|
|
2249
|
-
default:
|
|
2250
|
-
{
|
|
2251
|
-
return img;
|
|
2252
|
-
}
|
|
2253
|
-
}
|
|
2254
|
-
};
|
|
2255
|
-
const daiAppsHeaderMenuItem = (count = 0) => ({
|
|
2256
|
-
children: jsxs(DotTypography, Object.assign({
|
|
2257
|
-
className: "dai-apps-title"
|
|
2258
|
-
}, {
|
|
2259
|
-
children: ["DIGITAL.AI APPLICATIONS", count > 0 ? ` (${count})` : '']
|
|
2260
|
-
}), "menu-item-dai-apps-title"),
|
|
2261
|
-
key: 'dai-apps-title',
|
|
2262
|
-
disabled: true,
|
|
2263
|
-
divider: true,
|
|
2264
|
-
height: 32
|
|
2265
|
-
});
|
|
2266
|
-
const createMenuItem = (url, title, subtitle = null) => jsxs("div", Object.assign({
|
|
2267
|
-
className: "app-menu-item"
|
|
2268
|
-
}, {
|
|
2269
|
-
children: [jsx(DotLink, Object.assign({
|
|
2270
|
-
href: url,
|
|
2271
|
-
color: "textPrimary",
|
|
2272
|
-
target: "_blank"
|
|
2273
|
-
}, {
|
|
2274
|
-
children: jsxs("div", Object.assign({
|
|
2275
|
-
className: "logo-title"
|
|
2276
|
-
}, {
|
|
2277
|
-
children: [jsx(DotIcon, {
|
|
2278
|
-
iconId: "open-new-tab"
|
|
2279
|
-
}, void 0), jsxs("div", Object.assign({
|
|
2280
|
-
className: "dot-app-switcher-app-title"
|
|
2281
|
-
}, {
|
|
2282
|
-
children: [jsx(DotTypography, Object.assign({
|
|
2283
|
-
variant: "body1"
|
|
2284
|
-
}, {
|
|
2285
|
-
children: title
|
|
2286
|
-
}), void 0), subtitle && jsx(DotTypography, Object.assign({
|
|
2287
|
-
variant: "body2"
|
|
2288
|
-
}, {
|
|
2289
|
-
children: subtitle
|
|
2290
|
-
}), void 0)]
|
|
2291
|
-
}), void 0)]
|
|
2292
|
-
}), void 0)
|
|
2293
|
-
}), void 0), jsx(DotCopyButton, {
|
|
2294
|
-
copyTooltip: "Copy application URL",
|
|
2295
|
-
value: url
|
|
2296
|
-
}, void 0)]
|
|
2297
|
-
}), `app-menu-item-${title}`);
|
|
2298
|
-
const createTopLevelMenuItem = (url, logo, title, openNewTab = true) => {
|
|
2299
|
-
// Creates an entry in the AppSwitcher at the same level as the AppTypeLabels, used for the Platform link and
|
|
2300
|
-
// Empty state current application link
|
|
2301
|
-
const target = openNewTab ? '_blank' : '_self';
|
|
2302
|
-
return jsxs(DotLink, Object.assign({
|
|
2303
|
-
href: url,
|
|
2304
|
-
color: "textPrimary",
|
|
2305
|
-
target: target
|
|
2306
|
-
}, {
|
|
2307
|
-
children: [jsxs("div", Object.assign({
|
|
2308
|
-
className: "logo-title"
|
|
2309
|
-
}, {
|
|
2310
|
-
children: [jsx(DotAvatar, {
|
|
2311
|
-
alt: "app image",
|
|
2312
|
-
imageSrc: logo,
|
|
2313
|
-
type: "image",
|
|
2314
|
-
variant: "circular"
|
|
2315
|
-
}, void 0), jsx("div", Object.assign({
|
|
2316
|
-
className: "dot-app-switcher-app-title"
|
|
2317
|
-
}, {
|
|
2318
|
-
children: jsx(DotTypography, Object.assign({
|
|
2319
|
-
variant: "body1"
|
|
2320
|
-
}, {
|
|
2321
|
-
children: title
|
|
2322
|
-
}), void 0)
|
|
2323
|
-
}), void 0)]
|
|
2324
|
-
}), void 0), openNewTab && jsx(DotIcon, {
|
|
2325
|
-
iconId: "open-new-tab"
|
|
2326
|
-
}, void 0)]
|
|
2327
|
-
}), `top-menu-item-${title}`);
|
|
2328
|
-
};
|
|
2329
|
-
const createAppTypeLabel = (appTypeName, logo, appProps) => {
|
|
2330
|
-
const logoProps = logo ? {
|
|
2331
|
-
imageSrc: logo
|
|
2332
|
-
} : {
|
|
2333
|
-
iconId: 'collection'
|
|
2334
|
-
};
|
|
2335
|
-
return jsxs("div", Object.assign({
|
|
2336
|
-
className: "logo-title"
|
|
2337
|
-
}, {
|
|
2338
|
-
children: [jsx(DotAvatar, Object.assign({}, logoProps, {
|
|
2339
|
-
alt: "app image",
|
|
2340
|
-
type: "image",
|
|
2341
|
-
variant: "circular"
|
|
2342
|
-
}), void 0), jsxs("div", Object.assign({
|
|
2343
|
-
className: "dot-app-switcher-app-title"
|
|
2344
|
-
}, {
|
|
2345
|
-
children: [jsx(DotTypography, Object.assign({
|
|
2346
|
-
variant: "body1"
|
|
2347
|
-
}, {
|
|
2348
|
-
children: appTypeName
|
|
2349
|
-
}), void 0), jsxs(DotTypography, Object.assign({
|
|
2350
|
-
variant: "body2"
|
|
2351
|
-
}, {
|
|
2352
|
-
children: ["Instance (", appProps.length, ")"]
|
|
2353
|
-
}), void 0)]
|
|
2354
|
-
}), void 0)]
|
|
2355
|
-
}), void 0);
|
|
2356
|
-
};
|
|
2357
|
-
const getInstanceStateText = application => {
|
|
2358
|
-
if (application.instance_state === 1) {
|
|
2359
|
-
return 'Production instance';
|
|
2360
|
-
}
|
|
2361
|
-
return 'Non-production instance';
|
|
2362
|
-
};
|
|
2363
|
-
|
|
2364
|
-
const rootClassName$T = 'dot-drawer';
|
|
2365
|
-
const StyledDrawer = styled(Drawer).withConfig({
|
|
2366
|
-
displayName: "Drawerstyles__StyledDrawer",
|
|
2367
|
-
componentId: "sc-1uiowy0-0"
|
|
2368
|
-
})(["", ""], ({
|
|
2369
|
-
theme
|
|
2370
|
-
}) => css(["&.", " .MuiBackdrop-root{background-color:", ";}.dot-drawer-paper{height:", ";padding:", ";width:", ";}"], rootClassName$T, alpha(theme.palette.grey[900], 0.7), ({
|
|
2371
|
-
height,
|
|
2372
|
-
anchor
|
|
2373
|
-
}) => anchor === 'left' || anchor === 'right' ? '100%' : height, theme.spacing(2), ({
|
|
2374
|
-
width,
|
|
2375
|
-
anchor
|
|
2376
|
-
}) => anchor === 'bottom' || anchor === 'top' ? 'auto' : width));
|
|
2377
|
-
|
|
2378
|
-
const rootClassName$S = 'dot-drawer-header';
|
|
2379
|
-
const StyleDrawerHeader = styled.div.withConfig({
|
|
2380
|
-
displayName: "DrawerHeaderstyles__StyleDrawerHeader",
|
|
2381
|
-
componentId: "sc-2d2xd3-0"
|
|
2382
|
-
})(["", ""], ({
|
|
2383
|
-
theme
|
|
2384
|
-
}) => css(["&.", "{padding:", ";display:flex;align-items:center;.close-button{margin-left:auto;}}"], rootClassName$S, theme.spacing(0, 0, 2)));
|
|
2385
|
-
|
|
2386
2242
|
const DotDrawerHeader = ({
|
|
2387
2243
|
ariaLabel,
|
|
2388
2244
|
children,
|
|
@@ -2391,7 +2247,7 @@ const DotDrawerHeader = ({
|
|
|
2391
2247
|
onClose,
|
|
2392
2248
|
variant
|
|
2393
2249
|
}) => {
|
|
2394
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
2250
|
+
const rootClasses = useStylesWithRootClass(rootClassName$R, className);
|
|
2395
2251
|
return jsxs(StyleDrawerHeader, Object.assign({
|
|
2396
2252
|
"aria-label": ariaLabel,
|
|
2397
2253
|
className: rootClasses,
|
|
@@ -2405,11 +2261,11 @@ const DotDrawerHeader = ({
|
|
|
2405
2261
|
}), void 0);
|
|
2406
2262
|
};
|
|
2407
2263
|
|
|
2408
|
-
const rootClassName$
|
|
2264
|
+
const rootClassName$P = 'dot-drawer-body';
|
|
2409
2265
|
const StyleDrawerBody = styled.div.withConfig({
|
|
2410
2266
|
displayName: "DrawerBodystyles__StyleDrawerBody",
|
|
2411
2267
|
componentId: "sc-1mpmjdk-0"
|
|
2412
|
-
})(["", ""], () => css(["&.", "{display:flex;.dot-drawer-close-button{align-self:self-start;padding:0;margin-left:auto;}}"], rootClassName$
|
|
2268
|
+
})(["", ""], () => css(["&.", "{display:flex;.dot-drawer-close-button{align-self:self-start;padding:0;margin-left:auto;}}"], rootClassName$P));
|
|
2413
2269
|
|
|
2414
2270
|
const DotDrawerBody = ({
|
|
2415
2271
|
ariaLabel,
|
|
@@ -2420,7 +2276,7 @@ const DotDrawerBody = ({
|
|
|
2420
2276
|
onClose,
|
|
2421
2277
|
variant
|
|
2422
2278
|
}) => {
|
|
2423
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
2279
|
+
const rootClasses = useStylesWithRootClass(rootClassName$P, className);
|
|
2424
2280
|
return jsxs(StyleDrawerBody, Object.assign({
|
|
2425
2281
|
"aria-label": ariaLabel,
|
|
2426
2282
|
className: rootClasses,
|
|
@@ -2434,13 +2290,13 @@ const DotDrawerBody = ({
|
|
|
2434
2290
|
}), void 0);
|
|
2435
2291
|
};
|
|
2436
2292
|
|
|
2437
|
-
const rootClassName$
|
|
2293
|
+
const rootClassName$O = 'dot-drawer-footer';
|
|
2438
2294
|
const StyleDrawerFooter = styled.div.withConfig({
|
|
2439
2295
|
displayName: "DrawerFooterstyles__StyleDrawerFooter",
|
|
2440
2296
|
componentId: "sc-1ki05ze-0"
|
|
2441
2297
|
})(["", ""], ({
|
|
2442
2298
|
theme
|
|
2443
|
-
}) => css(["&.", "{padding:", ";}"], rootClassName$
|
|
2299
|
+
}) => css(["&.", "{padding:", ";}"], rootClassName$O, theme.spacing(2, 0, 0)));
|
|
2444
2300
|
|
|
2445
2301
|
const DotDrawerFooter = ({
|
|
2446
2302
|
ariaLabel,
|
|
@@ -2448,7 +2304,7 @@ const DotDrawerFooter = ({
|
|
|
2448
2304
|
className,
|
|
2449
2305
|
'data-testid': dataTestId
|
|
2450
2306
|
}) => {
|
|
2451
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
2307
|
+
const rootClasses = useStylesWithRootClass(rootClassName$O, className);
|
|
2452
2308
|
return jsx(StyleDrawerFooter, Object.assign({
|
|
2453
2309
|
"aria-label": ariaLabel,
|
|
2454
2310
|
className: rootClasses,
|
|
@@ -2485,7 +2341,7 @@ const DotDrawer = ({
|
|
|
2485
2341
|
onClose(event);
|
|
2486
2342
|
}
|
|
2487
2343
|
};
|
|
2488
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
2344
|
+
const rootClasses = useStylesWithRootClass(rootClassName$S, className);
|
|
2489
2345
|
const headerExists = !!drawerHeaderProps;
|
|
2490
2346
|
const bodyTestId = drawerBodyProps ? drawerBodyProps[`data-testid`] : 'drawer-body';
|
|
2491
2347
|
return jsxs(StyledDrawer, Object.assign({
|
|
@@ -2528,990 +2384,1235 @@ const DotDrawer = ({
|
|
|
2528
2384
|
}), void 0);
|
|
2529
2385
|
};
|
|
2530
2386
|
|
|
2531
|
-
const
|
|
2532
|
-
const
|
|
2533
|
-
displayName: "
|
|
2534
|
-
componentId: "
|
|
2387
|
+
const fadeIn = keyframes(["from{opacity:0;}to{opacity:1;}"]);
|
|
2388
|
+
const StyledDotDrawer = styled(DotDrawer).withConfig({
|
|
2389
|
+
displayName: "NestedListstyles__StyledDotDrawer",
|
|
2390
|
+
componentId: "sc-1wwoqos-0"
|
|
2535
2391
|
})(["", ""], ({
|
|
2536
|
-
|
|
2537
|
-
}) => css(["&.", "{.
|
|
2392
|
+
open
|
|
2393
|
+
}) => css(["&.", "{.dot-drawer-paper{z-index:", ";animation:", ";}}"], nestedDrawerClassName, open ? levelFirst : levelBottom, open && css(["", " 0.2s cubic-bezier(1,0,1,.01);"], fadeIn)));
|
|
2538
2394
|
|
|
2539
|
-
const
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
noAppTypeLabel: _noAppTypeLabel = 'Other',
|
|
2544
|
-
platformConsoleUrl,
|
|
2545
|
-
onClose,
|
|
2546
|
-
open,
|
|
2547
|
-
searchInstancesThreshold: _searchInstancesThreshold = 5,
|
|
2548
|
-
selectedAppType,
|
|
2549
|
-
yOffset: _yOffset = 48,
|
|
2550
|
-
zIndex: _zIndex = 990
|
|
2395
|
+
const DEFAULT_TOOLTIP_PLACEMENT = 'top-start';
|
|
2396
|
+
const DotListDivider = ({
|
|
2397
|
+
item,
|
|
2398
|
+
index
|
|
2551
2399
|
}) => {
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
const [searchText, setSearchText] = useState('');
|
|
2563
|
-
if (!setSelectedAppType) {
|
|
2564
|
-
selectedAppType = selectedAppTypeAlt;
|
|
2565
|
-
setSelectedAppType = setSelectedAppTypeAlt;
|
|
2400
|
+
if (item.text) {
|
|
2401
|
+
return jsx(ListSubheader, Object.assign({
|
|
2402
|
+
disableSticky: true
|
|
2403
|
+
}, {
|
|
2404
|
+
children: jsx(DotTypography, Object.assign({
|
|
2405
|
+
variant: "overline"
|
|
2406
|
+
}, {
|
|
2407
|
+
children: item.text
|
|
2408
|
+
}), void 0)
|
|
2409
|
+
}), void 0);
|
|
2566
2410
|
}
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
let appTypeCount = sortedAppTypeMap.size;
|
|
2606
|
-
if (platformConsoleUrl) {
|
|
2607
|
-
appTypeCount++;
|
|
2608
|
-
}
|
|
2609
|
-
if (otherApps.length > 0) {
|
|
2610
|
-
sortedAppTypeMap.set(_noAppTypeLabel, otherApps);
|
|
2611
|
-
}
|
|
2612
|
-
setAppTypeMap(sortedAppTypeMap);
|
|
2613
|
-
const menuItems = [daiAppsHeaderMenuItem(appTypeCount)];
|
|
2614
|
-
if (platformConsoleUrl) {
|
|
2615
|
-
const children = createTopLevelMenuItem(platformConsoleUrl, getLogoForAppType('Platform'), 'Digital.ai Platform', !window.location.href.startsWith(platformConsoleUrl));
|
|
2616
|
-
menuItems.push({
|
|
2617
|
-
children,
|
|
2618
|
-
key: 'app-switcher-platform-link',
|
|
2619
|
-
height: 64
|
|
2620
|
-
});
|
|
2621
|
-
}
|
|
2622
|
-
const newAppTypeLabels = new Map();
|
|
2623
|
-
sortedAppTypeMap.forEach((singleTypeApps, appTypeName) => {
|
|
2624
|
-
if ((singleTypeApps === null || singleTypeApps === void 0 ? void 0 : singleTypeApps.length) > 0) {
|
|
2625
|
-
const logo = appTypeName === _noAppTypeLabel ? null : getLogoForAppType(appTypeName);
|
|
2626
|
-
newAppTypeLabels.set(appTypeName, {
|
|
2627
|
-
logo,
|
|
2628
|
-
singleTypeApps
|
|
2629
|
-
});
|
|
2630
|
-
menuItems.push({
|
|
2631
|
-
children: jsxs("div", Object.assign({
|
|
2632
|
-
className: "product-menu-item",
|
|
2633
|
-
onClick: () => showApps(appTypeName)
|
|
2634
|
-
}, {
|
|
2635
|
-
children: [createAppTypeLabel(appTypeName, logo, singleTypeApps), jsx(DotIcon, {
|
|
2636
|
-
iconId: "chevron-right"
|
|
2637
|
-
}, void 0)]
|
|
2638
|
-
}), `menu-item-${appTypeName}`),
|
|
2639
|
-
key: appTypeName,
|
|
2640
|
-
height: 64
|
|
2641
|
-
});
|
|
2642
|
-
}
|
|
2643
|
-
});
|
|
2644
|
-
setAppTypeMenuItems(menuItems);
|
|
2645
|
-
setAppTypeLabels(newAppTypeLabels);
|
|
2646
|
-
}, [apps]);
|
|
2647
|
-
const emptyState = useCallback(() => {
|
|
2648
|
-
const currentAppMenuItem = createTopLevelMenuItem(window.location.href, getLogoForAppType(activeApp.product), activeApp.name, false);
|
|
2649
|
-
setAppTypeMenuItems([daiAppsHeaderMenuItem(), {
|
|
2650
|
-
children: currentAppMenuItem,
|
|
2651
|
-
key: 'no_applications_configured',
|
|
2652
|
-
height: 64,
|
|
2653
|
-
disabled: true
|
|
2654
|
-
}]);
|
|
2655
|
-
}, [activeApp]);
|
|
2656
|
-
useEffect(() => {
|
|
2657
|
-
if ((apps === null || apps === void 0 ? void 0 : apps.length) > 0) {
|
|
2658
|
-
populateAppTypeMap();
|
|
2659
|
-
} else {
|
|
2660
|
-
emptyState();
|
|
2411
|
+
return jsx(Divider, {
|
|
2412
|
+
"aria-hidden": true,
|
|
2413
|
+
"data-testid": `divider-${index}`
|
|
2414
|
+
}, void 0);
|
|
2415
|
+
};
|
|
2416
|
+
const DotList = ({
|
|
2417
|
+
ariaLabel,
|
|
2418
|
+
children,
|
|
2419
|
+
className,
|
|
2420
|
+
component: _component = 'ul',
|
|
2421
|
+
'data-testid': dataTestId,
|
|
2422
|
+
dense: _dense = false,
|
|
2423
|
+
disablePadding: _disablePadding = false,
|
|
2424
|
+
items: _items = [],
|
|
2425
|
+
menuPlacement: _menuPlacement = 'right-start',
|
|
2426
|
+
nestedDrawerLeftSpacing: _nestedDrawerLeftSpacing = 240,
|
|
2427
|
+
nestedListType: _nestedListType = 'expandable',
|
|
2428
|
+
width: _width = 240
|
|
2429
|
+
}) => {
|
|
2430
|
+
const rootClasses = useStylesWithRootClass(rootClassName$X, className);
|
|
2431
|
+
const listWidth = typeof _width === 'number' ? `${_width}px` : _width;
|
|
2432
|
+
const listRef = useRef();
|
|
2433
|
+
const [listItemIndex, setListItemIndex] = useState(null);
|
|
2434
|
+
const updateSelectedListItem = currentIndex => {
|
|
2435
|
+
currentIndex === listItemIndex ? setListItemIndex(null) : setListItemIndex(currentIndex);
|
|
2436
|
+
};
|
|
2437
|
+
return jsxs(StyledList, Object.assign({
|
|
2438
|
+
"aria-label": ariaLabel,
|
|
2439
|
+
classes: {
|
|
2440
|
+
root: rootClasses
|
|
2441
|
+
},
|
|
2442
|
+
component: _component,
|
|
2443
|
+
"data-testid": dataTestId,
|
|
2444
|
+
dense: _dense,
|
|
2445
|
+
disablePadding: _disablePadding,
|
|
2446
|
+
ref: listRef,
|
|
2447
|
+
style: {
|
|
2448
|
+
width: listWidth
|
|
2661
2449
|
}
|
|
2662
|
-
},
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
if (
|
|
2678
|
-
|
|
2679
|
-
|
|
2450
|
+
}, {
|
|
2451
|
+
children: [_items.map((item, index) => {
|
|
2452
|
+
const handleListItemClick = e => {
|
|
2453
|
+
var _a;
|
|
2454
|
+
updateSelectedListItem(index);
|
|
2455
|
+
(_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, e);
|
|
2456
|
+
};
|
|
2457
|
+
const handleMenuLeave = event => {
|
|
2458
|
+
var _a, _b;
|
|
2459
|
+
// Remove index only if clicked element is not found within the list
|
|
2460
|
+
if (!((_a = listRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
2461
|
+
setListItemIndex(null);
|
|
2462
|
+
(_b = item.onMenuLeave) === null || _b === void 0 ? void 0 : _b.call(item, event);
|
|
2463
|
+
}
|
|
2464
|
+
};
|
|
2465
|
+
if (item.child) {
|
|
2466
|
+
return jsx(Fragment, {
|
|
2467
|
+
children: item.child
|
|
2468
|
+
}, `item-child-${index}`);
|
|
2680
2469
|
}
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2470
|
+
if (item.divider) {
|
|
2471
|
+
return jsx(DotListDivider, {
|
|
2472
|
+
index: index,
|
|
2473
|
+
item: item
|
|
2474
|
+
}, `divider-${index}`);
|
|
2475
|
+
}
|
|
2476
|
+
return jsx(DotListItem, {
|
|
2477
|
+
className: item.className,
|
|
2478
|
+
component: item.component,
|
|
2479
|
+
"data-testid": `${dataTestId}-item-${index}`,
|
|
2480
|
+
endIcon: item.endIcon,
|
|
2481
|
+
href: item.href,
|
|
2482
|
+
isOpened: listItemIndex === index,
|
|
2483
|
+
items: item.items,
|
|
2484
|
+
menuPlacement: _menuPlacement,
|
|
2485
|
+
nestedDrawerLeftSpacing: _nestedDrawerLeftSpacing,
|
|
2486
|
+
nestedListType: _nestedListType,
|
|
2487
|
+
onClick: item.href && !item.onClick ? null : handleListItemClick,
|
|
2488
|
+
onMenuLeave: handleMenuLeave,
|
|
2489
|
+
primaryText: item.primaryText,
|
|
2490
|
+
secondaryText: item.secondaryText,
|
|
2491
|
+
selected: item.selected,
|
|
2492
|
+
startIcon: item.startIcon,
|
|
2493
|
+
target: item.target,
|
|
2494
|
+
text: item.text,
|
|
2495
|
+
tooltip: item.tooltip,
|
|
2496
|
+
tooltipPlacement: item.tooltipPlacement || DEFAULT_TOOLTIP_PLACEMENT
|
|
2497
|
+
}, index);
|
|
2498
|
+
}), children]
|
|
2499
|
+
}), void 0);
|
|
2500
|
+
};
|
|
2501
|
+
const DotListItem = ({
|
|
2502
|
+
ariaLabel,
|
|
2503
|
+
className,
|
|
2504
|
+
component: _component2 = 'li',
|
|
2505
|
+
'data-testid': dataTestId,
|
|
2506
|
+
divider: _divider = false,
|
|
2507
|
+
endIcon,
|
|
2508
|
+
href,
|
|
2509
|
+
isOpened,
|
|
2510
|
+
onClick,
|
|
2511
|
+
onMenuLeave,
|
|
2512
|
+
items: _items2 = [],
|
|
2513
|
+
menuPlacement,
|
|
2514
|
+
nestedDrawerLeftSpacing,
|
|
2515
|
+
nestedListType,
|
|
2516
|
+
primaryText,
|
|
2517
|
+
secondaryText,
|
|
2518
|
+
selected,
|
|
2519
|
+
startIcon,
|
|
2520
|
+
target,
|
|
2521
|
+
text,
|
|
2522
|
+
tooltip,
|
|
2523
|
+
tooltipPlacement: _tooltipPlacement = DEFAULT_TOOLTIP_PLACEMENT
|
|
2524
|
+
}) => {
|
|
2525
|
+
const hasChildren = _items2.length > 0;
|
|
2526
|
+
const isFlyout = nestedListType === 'menu' && hasChildren;
|
|
2527
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
2528
|
+
const showEndIcon = endIcon || hasChildren;
|
|
2529
|
+
const rootClasses = useStylesWithRootClass(listItemRootClass, className, isOpened ? 'open' : '');
|
|
2530
|
+
const toggleOpen = event => setAnchorEl(event.currentTarget);
|
|
2531
|
+
const handleClick = event => {
|
|
2532
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
2533
|
+
toggleOpen(event);
|
|
2534
|
+
};
|
|
2535
|
+
const handleMenuLeave = event => onMenuLeave(event);
|
|
2536
|
+
const renderListItemText = () => primaryText && secondaryText ? jsx(ListItemText, {
|
|
2537
|
+
primary: primaryText,
|
|
2538
|
+
secondary: secondaryText
|
|
2539
|
+
}, void 0) : jsx(DotTypography, Object.assign({
|
|
2540
|
+
variant: "body1"
|
|
2541
|
+
}, {
|
|
2542
|
+
children: text
|
|
2543
|
+
}), void 0);
|
|
2544
|
+
const renderListItemEndIcon = () => {
|
|
2545
|
+
if (hasChildren || !endIcon) {
|
|
2546
|
+
return jsx(DotIcon, {
|
|
2547
|
+
iconId: hasChildren && getChevronIcon(nestedListType, isOpened)
|
|
2718
2548
|
}, void 0);
|
|
2719
2549
|
}
|
|
2720
|
-
return
|
|
2550
|
+
return endIcon;
|
|
2721
2551
|
};
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
marginTop: _yOffset + 'px',
|
|
2728
|
-
width: '80%'
|
|
2729
|
-
}
|
|
2552
|
+
return jsxs(Fragment$1, {
|
|
2553
|
+
children: [jsx(DotTooltip, Object.assign({
|
|
2554
|
+
"data-testid": `${dataTestId}-tooltip`,
|
|
2555
|
+
placement: _tooltipPlacement,
|
|
2556
|
+
title: tooltip
|
|
2730
2557
|
}, {
|
|
2731
|
-
children:
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2558
|
+
children: jsxs(StyledListItem, Object.assign({
|
|
2559
|
+
"aria-label": ariaLabel,
|
|
2560
|
+
button: true,
|
|
2561
|
+
classes: {
|
|
2562
|
+
root: rootClasses
|
|
2563
|
+
},
|
|
2564
|
+
component: href && !onClick ? 'a' : _component2,
|
|
2565
|
+
"data-testid": dataTestId,
|
|
2566
|
+
divider: _divider,
|
|
2567
|
+
href: onClick ? null : href,
|
|
2568
|
+
onClick: onClick || !href ? handleClick : null,
|
|
2569
|
+
selected: isFlyout ? isOpened : selected,
|
|
2570
|
+
target: target
|
|
2738
2571
|
}, {
|
|
2739
|
-
children: "
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
}
|
|
2572
|
+
children: [jsxs("span", Object.assign({
|
|
2573
|
+
className: listItemLinkClassName
|
|
2574
|
+
}, {
|
|
2575
|
+
children: [startIcon && jsx(ListItemIcon, {
|
|
2576
|
+
children: startIcon
|
|
2577
|
+
}, void 0), renderListItemText()]
|
|
2578
|
+
}), void 0), showEndIcon && renderListItemEndIcon()]
|
|
2579
|
+
}), void 0)
|
|
2580
|
+
}), void 0), hasChildren && jsx(NestedList, {
|
|
2581
|
+
anchorEl: anchorEl,
|
|
2582
|
+
ariaLabel: "nested list",
|
|
2583
|
+
"data-testid": "nestedList",
|
|
2584
|
+
items: _items2,
|
|
2585
|
+
menuPlacement: menuPlacement,
|
|
2586
|
+
nestedDrawerLeftSpacing: nestedDrawerLeftSpacing,
|
|
2587
|
+
onMenuLeave: handleMenuLeave,
|
|
2588
|
+
open: isOpened,
|
|
2589
|
+
type: nestedListType
|
|
2590
|
+
}, void 0)]
|
|
2591
|
+
}, void 0);
|
|
2759
2592
|
};
|
|
2760
|
-
const
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
setSelectedAppType(null);
|
|
2789
|
-
onClose && onClose(event);
|
|
2790
|
-
}, [onClose]);
|
|
2791
|
-
const viewProps = includePlatformConsole ? Object.assign(Object.assign({}, commonProps), {
|
|
2792
|
-
platformConsoleUrl
|
|
2793
|
-
}) : Object.assign({}, commonProps);
|
|
2794
|
-
if (!applicationsLoading && !applicationsError) {
|
|
2795
|
-
return jsx(DotAppSwitcherView, Object.assign({}, viewProps, {
|
|
2796
|
-
open: open,
|
|
2797
|
-
apps: applications,
|
|
2798
|
-
selectedAppType: selectedAppType,
|
|
2799
|
-
onClose: closeHandler
|
|
2593
|
+
const NestedList = ({
|
|
2594
|
+
ariaLabel,
|
|
2595
|
+
anchorEl,
|
|
2596
|
+
'data-testid': dataTestId,
|
|
2597
|
+
items,
|
|
2598
|
+
menuPlacement,
|
|
2599
|
+
nestedDrawerLeftSpacing,
|
|
2600
|
+
onMenuLeave,
|
|
2601
|
+
open,
|
|
2602
|
+
parentItemIndex,
|
|
2603
|
+
type
|
|
2604
|
+
}) => {
|
|
2605
|
+
const flyoutItemClasses = useStylesWithRootClass(listItemRootClass, flyoutListItemClassName);
|
|
2606
|
+
const flyoutSpanClasses = useStylesWithRootClass(listItemLinkClassName, flyoutItemLinkClassName);
|
|
2607
|
+
if (type === 'expandable') {
|
|
2608
|
+
return jsx(Collapse, Object.assign({
|
|
2609
|
+
in: open,
|
|
2610
|
+
timeout: "auto",
|
|
2611
|
+
unmountOnExit: true
|
|
2612
|
+
}, {
|
|
2613
|
+
children: jsx(DotList, {
|
|
2614
|
+
ariaLabel: ariaLabel,
|
|
2615
|
+
className: nestedListClassName,
|
|
2616
|
+
component: "div",
|
|
2617
|
+
"data-testid": dataTestId,
|
|
2618
|
+
disablePadding: true,
|
|
2619
|
+
items: items
|
|
2620
|
+
}, parentItemIndex)
|
|
2800
2621
|
}), void 0);
|
|
2801
2622
|
}
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2623
|
+
if (type === 'menu') {
|
|
2624
|
+
const menuItems = items.map((item, index) => {
|
|
2625
|
+
const {
|
|
2626
|
+
href,
|
|
2627
|
+
target,
|
|
2628
|
+
onClick,
|
|
2629
|
+
tooltip,
|
|
2630
|
+
tooltipPlacement = DEFAULT_TOOLTIP_PLACEMENT,
|
|
2631
|
+
text
|
|
2632
|
+
} = item;
|
|
2633
|
+
return {
|
|
2634
|
+
children: jsx(DotTooltip, Object.assign({
|
|
2635
|
+
placement: tooltipPlacement,
|
|
2636
|
+
title: tooltip
|
|
2637
|
+
}, {
|
|
2638
|
+
children: jsx(StyledListItem, Object.assign({
|
|
2639
|
+
className: flyoutItemClasses,
|
|
2640
|
+
component: href && !onClick ? 'a' : null,
|
|
2641
|
+
"data-testid": `${dataTestId}-item-${index}`,
|
|
2642
|
+
href: href,
|
|
2643
|
+
onClick: onClick,
|
|
2644
|
+
target: target
|
|
2645
|
+
}, {
|
|
2646
|
+
children: jsxs("span", Object.assign({
|
|
2647
|
+
className: flyoutSpanClasses
|
|
2648
|
+
}, {
|
|
2649
|
+
children: [item.startIcon, jsx(DotTypography, Object.assign({
|
|
2650
|
+
variant: "body1"
|
|
2651
|
+
}, {
|
|
2652
|
+
children: text
|
|
2653
|
+
}), void 0)]
|
|
2654
|
+
}), void 0)
|
|
2655
|
+
}), `${parentItemIndex}-${index}`)
|
|
2656
|
+
}), `${parentItemIndex}-${index}-tooltip`),
|
|
2657
|
+
classes: '',
|
|
2658
|
+
key: String(index)
|
|
2659
|
+
};
|
|
2660
|
+
});
|
|
2661
|
+
return jsx(DotMenu, {
|
|
2662
|
+
anchorEl: anchorEl,
|
|
2663
|
+
ariaLabel: ariaLabel,
|
|
2664
|
+
className: flyoutMenuClassName,
|
|
2665
|
+
"data-testid": dataTestId,
|
|
2666
|
+
id: CreateUUID(),
|
|
2667
|
+
menuItemHeight: "auto",
|
|
2668
|
+
menuItems: menuItems,
|
|
2669
|
+
menuPlacement: menuPlacement,
|
|
2670
|
+
onLeave: onMenuLeave,
|
|
2671
|
+
open: open
|
|
2672
|
+
}, parentItemIndex);
|
|
2819
2673
|
}
|
|
2820
|
-
if (
|
|
2821
|
-
return
|
|
2674
|
+
if (type === 'drawer') {
|
|
2675
|
+
return jsx(StyledDotDrawer, Object.assign({
|
|
2676
|
+
PaperProps: {
|
|
2677
|
+
style: {
|
|
2678
|
+
left: `${nestedDrawerLeftSpacing}px`
|
|
2679
|
+
}
|
|
2680
|
+
},
|
|
2681
|
+
anchor: "left",
|
|
2682
|
+
className: nestedDrawerClassName,
|
|
2683
|
+
"data-testid": "nested-drawer",
|
|
2684
|
+
open: open,
|
|
2685
|
+
variant: "persistent"
|
|
2686
|
+
}, {
|
|
2687
|
+
children: jsx(DotList, {
|
|
2688
|
+
ariaLabel: ariaLabel,
|
|
2689
|
+
className: nestedListClassName,
|
|
2690
|
+
component: "div",
|
|
2691
|
+
"data-testid": dataTestId,
|
|
2692
|
+
disablePadding: true,
|
|
2693
|
+
items: items,
|
|
2694
|
+
width: '100%'
|
|
2695
|
+
}, parentItemIndex)
|
|
2696
|
+
}), void 0);
|
|
2822
2697
|
}
|
|
2823
|
-
return 'chevron-down';
|
|
2824
2698
|
};
|
|
2825
2699
|
|
|
2826
|
-
const
|
|
2827
|
-
const flyoutItemLinkClassName = 'dot-flyout-item-link';
|
|
2828
|
-
const listItemLinkClassName = 'dot-list-item-link';
|
|
2829
|
-
const StyledListItem = styled(ListItem).withConfig({
|
|
2830
|
-
displayName: "ListItemstyles__StyledListItem",
|
|
2831
|
-
componentId: "sc-1fawh8v-0"
|
|
2832
|
-
})(["", ""], ({
|
|
2833
|
-
theme
|
|
2834
|
-
}) => css(["&.", "{&.", "{padding:0;}p.MuiTypography-root{margin-bottom:0;}.", "{align-items:center;display:flex;flex-grow:2;}.", " .MuiIcon-root{margin-right:", ";}.dot-icon i:before{color:", ";}}"], listItemRootClass, flyoutListItemClassName, listItemLinkClassName, flyoutItemLinkClassName, theme.spacing(4), theme.palette.text.primary));
|
|
2835
|
-
|
|
2836
|
-
const rootClassName$N = 'dot-progress';
|
|
2837
|
-
const StyledCircularProgress = styled(CircularProgress).withConfig({
|
|
2838
|
-
displayName: "Progressstyles__StyledCircularProgress",
|
|
2839
|
-
componentId: "sc-1gs77rb-0"
|
|
2840
|
-
})(["&.", "{&.MuiCircularProgress-colorSecondary{color:#649a3d;}}"], rootClassName$N);
|
|
2841
|
-
|
|
2842
|
-
const DotProgress = ({
|
|
2843
|
-
ariaLabel,
|
|
2844
|
-
color: _color = 'secondary',
|
|
2845
|
-
className,
|
|
2700
|
+
const DotInputLabel = ({
|
|
2846
2701
|
'data-testid': dataTestId,
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2702
|
+
disabled: _disabled = false,
|
|
2703
|
+
error: _error = false,
|
|
2704
|
+
id,
|
|
2705
|
+
label,
|
|
2706
|
+
required
|
|
2852
2707
|
}) => {
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2708
|
+
return jsx(StyledInputLabel, Object.assign({
|
|
2709
|
+
"data-testid": dataTestId,
|
|
2710
|
+
classes: {
|
|
2711
|
+
root: labelClassName
|
|
2712
|
+
},
|
|
2713
|
+
disabled: _disabled,
|
|
2714
|
+
error: _error,
|
|
2715
|
+
htmlFor: id,
|
|
2716
|
+
required: required,
|
|
2717
|
+
shrink: false,
|
|
2718
|
+
variant: "outlined"
|
|
2856
2719
|
}, {
|
|
2857
|
-
children: jsx(
|
|
2858
|
-
"
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
color: _color,
|
|
2863
|
-
"data-testid": dataTestId,
|
|
2864
|
-
size: _size,
|
|
2865
|
-
thickness: _thickness,
|
|
2866
|
-
value: value,
|
|
2867
|
-
variant: _variant
|
|
2868
|
-
}, void 0)
|
|
2720
|
+
children: jsx(DotTypography, Object.assign({
|
|
2721
|
+
variant: "subtitle2"
|
|
2722
|
+
}, {
|
|
2723
|
+
children: label
|
|
2724
|
+
}), void 0)
|
|
2869
2725
|
}), void 0);
|
|
2870
2726
|
};
|
|
2871
2727
|
|
|
2872
|
-
const
|
|
2873
|
-
const
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
__proto__: null,
|
|
2881
|
-
levelBottom: levelBottom,
|
|
2882
|
-
levelFirst: levelFirst,
|
|
2883
|
-
levelSecond: levelSecond,
|
|
2884
|
-
levelThird: levelThird,
|
|
2885
|
-
levelFourth: levelFourth,
|
|
2886
|
-
levelTop: levelTop
|
|
2887
|
-
});
|
|
2888
|
-
|
|
2889
|
-
const rootClassName$M = 'dot-popper';
|
|
2890
|
-
const StyledPopper$1 = styled(Popper).withConfig({
|
|
2891
|
-
displayName: "Popperstyles__StyledPopper",
|
|
2892
|
-
componentId: "sd1h8p-0"
|
|
2893
|
-
})(["", ""], ({
|
|
2894
|
-
theme
|
|
2895
|
-
}) => css(["&.", "{font-family:", ";font-size:", "px;}"], rootClassName$M, theme.typography.fontFamily, theme.typography.body1.fontSize));
|
|
2896
|
-
|
|
2897
|
-
const flyoutMenuClassName = 'dot-flyout-menu';
|
|
2898
|
-
const rootClassName$L = 'dot-menu';
|
|
2899
|
-
const getListMaxHeight = maxHeight => isString$1(maxHeight) ? maxHeight : `${maxHeight}px`;
|
|
2900
|
-
const StyledPopper = styled(Popper).withConfig({
|
|
2901
|
-
displayName: "Menustyles__StyledPopper",
|
|
2902
|
-
componentId: "sc-134fmqu-0"
|
|
2903
|
-
})(["", ""], ({
|
|
2904
|
-
theme
|
|
2905
|
-
}) => css(["&.", "{font-family:", ";font-size:", "px;z-index:", ";}&.", ",&.", "{&.loading .MuiPaper-root{align-items:center;display:flex;justify-content:center;min-height:200px;min-width:200px;}ul,.dot-action-item{.dot-action-item-text{white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;}}ul{box-sizing:content-box;min-width:112px;overflow:auto;", " .dot-li{min-height:auto;}}.dot-action-item{height:", ";border-top:1px solid ", ";line-height:inherit;button.dot-button{border-radius:", ";justify-content:flex-start;height:100%;margin:0;&:focus-visible{background-color:", ";}.MuiButton-label{gap:", ";.MuiButton-startIcon{margin-left:0;.dot-icon{flex-shrink:0;}}}}}}"], rootClassName$M, theme.typography.fontFamily, theme.typography.body1.fontSize, levelSecond, rootClassName$L, rootClassName$M, ({
|
|
2906
|
-
$maxHeight
|
|
2907
|
-
}) => $maxHeight !== undefined && `
|
|
2908
|
-
max-height: ${getListMaxHeight($maxHeight)};
|
|
2909
|
-
`, theme.spacing(7), theme.palette.grey[100], theme.spacing(0, 0, 0.5, 0.5), theme.palette.layer.n100, theme.spacing(3)));
|
|
2910
|
-
|
|
2911
|
-
const MENU_ITEM_HEIGHT_NORMAL = 48;
|
|
2912
|
-
const MENU_ITEM_HEIGHT_DENSE = 36;
|
|
2913
|
-
const DEFAULT_MAX_VISIBLE_ITEMS = 7;
|
|
2914
|
-
|
|
2915
|
-
const rootClassName$K = 'dot-ul';
|
|
2916
|
-
const listItemClassName$1 = 'dot-li';
|
|
2917
|
-
const listItemWithSubmenuClassName = 'dot-li-with-submenu';
|
|
2918
|
-
const StyledMenuList = styled(MenuList).withConfig({
|
|
2919
|
-
displayName: "MenuListstyles__StyledMenuList",
|
|
2920
|
-
componentId: "yqdwwg-0"
|
|
2921
|
-
})(["", ""], ({
|
|
2922
|
-
theme
|
|
2923
|
-
}) => css(["&.", "{.dot-li{font-size:", "px;justify-content:space-between;gap:", ";&:hover{background:", ";}&.Mui-selected,&.Mui-selected:hover{background:", ";}&.", "{padding-right:", ";}}}"], rootClassName$K, theme.typography.body1.fontSize, theme.spacing(3), hoverGray, lightSelectedGray, listItemWithSubmenuClassName, theme.spacing(0.5)));
|
|
2924
|
-
|
|
2925
|
-
const getDefaultItemHeight = isDense => isDense ? MENU_ITEM_HEIGHT_DENSE : MENU_ITEM_HEIGHT_NORMAL;
|
|
2926
|
-
const calculateItemHeight = (isDense, customItemHeight, menuItemHeight) => {
|
|
2927
|
-
// Custom item height must NOT be lower than MENU_ITEM_HEIGHT_DENSE value
|
|
2928
|
-
if (customItemHeight && customItemHeight >= MENU_ITEM_HEIGHT_DENSE) {
|
|
2929
|
-
return customItemHeight;
|
|
2930
|
-
}
|
|
2931
|
-
const itemHeightType = typeof menuItemHeight;
|
|
2932
|
-
if (itemHeightType === 'number' || itemHeightType === 'string') {
|
|
2933
|
-
return menuItemHeight;
|
|
2934
|
-
} else {
|
|
2935
|
-
return getDefaultItemHeight(isDense);
|
|
2936
|
-
}
|
|
2937
|
-
};
|
|
2938
|
-
const getNumberOfVisibleItems = (numberOfItems, maxVisibleItems) => {
|
|
2939
|
-
if (maxVisibleItems && maxVisibleItems > 0) {
|
|
2940
|
-
return maxVisibleItems <= numberOfItems ? maxVisibleItems : numberOfItems;
|
|
2941
|
-
}
|
|
2942
|
-
return DEFAULT_MAX_VISIBLE_ITEMS;
|
|
2943
|
-
};
|
|
2944
|
-
const calculateMaxHeight = ({
|
|
2945
|
-
isDense,
|
|
2946
|
-
maxVisibleItems,
|
|
2947
|
-
menuItems,
|
|
2948
|
-
menuItemHeight
|
|
2728
|
+
const DELAY_MS = 300;
|
|
2729
|
+
const EndAdornment = ({
|
|
2730
|
+
endAdornmentTooltip,
|
|
2731
|
+
error,
|
|
2732
|
+
dataTestId,
|
|
2733
|
+
endIcon,
|
|
2734
|
+
success,
|
|
2735
|
+
warning
|
|
2949
2736
|
}) => {
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
}
|
|
2954
|
-
|
|
2955
|
-
const
|
|
2956
|
-
|
|
2957
|
-
const
|
|
2958
|
-
const
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
}
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
const checkIfSubmenu = anchorElement => {
|
|
2970
|
-
if (!anchorElement) return false;
|
|
2971
|
-
return anchorElement.classList.contains(listItemWithSubmenuClassName);
|
|
2972
|
-
};
|
|
2973
|
-
const checkIfMenuItemSelected = (key, selectedKey, activeSubmenu) => {
|
|
2974
|
-
return selectedKey === key || activeSubmenu === key;
|
|
2737
|
+
const renderIcon = iconType => jsx(DotIcon, {
|
|
2738
|
+
"data-testid": dataTestId && `${dataTestId}-${iconType}-icon`,
|
|
2739
|
+
iconId: `${iconType}-solid`
|
|
2740
|
+
}, void 0);
|
|
2741
|
+
const errorIcon = error && renderIcon('error');
|
|
2742
|
+
const successIcon = success && renderIcon('check');
|
|
2743
|
+
const warningIcon = warning && renderIcon('warning');
|
|
2744
|
+
const endAdornmentIcon = endIcon || errorIcon || warningIcon || successIcon;
|
|
2745
|
+
const styledAdornment = jsx(StyledAdornment, Object.assign({
|
|
2746
|
+
className: `${adornmentIconClassName} end`,
|
|
2747
|
+
position: "end"
|
|
2748
|
+
}, {
|
|
2749
|
+
children: endAdornmentIcon
|
|
2750
|
+
}), void 0);
|
|
2751
|
+
return endAdornmentTooltip ? jsx(DotTooltip, Object.assign({
|
|
2752
|
+
title: endAdornmentTooltip
|
|
2753
|
+
}, {
|
|
2754
|
+
children: styledAdornment
|
|
2755
|
+
}), void 0) : styledAdornment;
|
|
2975
2756
|
};
|
|
2976
|
-
const
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
const DotMenuList = /*#__PURE__*/forwardRef(({
|
|
2983
|
-
autoFocusItem,
|
|
2757
|
+
const getInitialState = value => ({
|
|
2758
|
+
inputValue: value || ''
|
|
2759
|
+
});
|
|
2760
|
+
const DotInputText = ({
|
|
2761
|
+
autoComplete: _autoComplete = 'off',
|
|
2762
|
+
autoFocus,
|
|
2984
2763
|
className,
|
|
2764
|
+
defaultValue,
|
|
2985
2765
|
'data-testid': dataTestId,
|
|
2986
|
-
|
|
2766
|
+
disabled: _disabled = false,
|
|
2767
|
+
error: _error = false,
|
|
2768
|
+
endAdornmentTooltip,
|
|
2769
|
+
fullWidth: _fullWidth = true,
|
|
2770
|
+
hasDebounce,
|
|
2771
|
+
helperText,
|
|
2772
|
+
endIcon,
|
|
2987
2773
|
id,
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2774
|
+
inputRef,
|
|
2775
|
+
label,
|
|
2776
|
+
maxRows,
|
|
2777
|
+
minRows,
|
|
2778
|
+
multiline: _multiline = false,
|
|
2779
|
+
name,
|
|
2780
|
+
onBlur,
|
|
2781
|
+
onChange,
|
|
2782
|
+
onFocus,
|
|
2992
2783
|
onKeyDown,
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
2784
|
+
onMouseUp,
|
|
2785
|
+
persistentLabel,
|
|
2786
|
+
placeholder,
|
|
2787
|
+
readOnly: _readOnly = false,
|
|
2788
|
+
required: _required = false,
|
|
2789
|
+
shrink,
|
|
2790
|
+
startIcon,
|
|
2791
|
+
size: _size = 'small',
|
|
2792
|
+
success,
|
|
2793
|
+
type: _type = 'text',
|
|
2794
|
+
value,
|
|
2795
|
+
warning: _warning = false
|
|
2796
|
+
}) => {
|
|
2797
|
+
const hasError = _error && errorClassName;
|
|
2798
|
+
const hasWarning = !_error && _warning && warningClassName;
|
|
2799
|
+
const hasSuccess = !_error && !_warning && success && successClassName;
|
|
2800
|
+
const hasEndAdornmentIcon = endIcon || _error || hasWarning || hasSuccess;
|
|
2801
|
+
// This state is used only with debounce feature enabled
|
|
2802
|
+
const [inputTextState, setInputTextState] = useState(hasDebounce && getInitialState(value));
|
|
2803
|
+
const rootStyles = useStylesWithRootClass(rootClassName$10, hasError, hasWarning, hasSuccess, _readOnly ? 'read-only' : '');
|
|
2804
|
+
// Used to control text value from the consumer component
|
|
2805
|
+
// when debounce feature is enabled
|
|
2806
|
+
useEffect(() => {
|
|
2807
|
+
if (hasDebounce && value !== inputTextState.inputValue) {
|
|
2808
|
+
setInputTextState(getInitialState(value));
|
|
2809
|
+
}
|
|
2810
|
+
}, [value]);
|
|
2811
|
+
// Improve performance by avoiding callback execution
|
|
2812
|
+
// on each keystroke (if debounce feature is active)
|
|
2813
|
+
useEffect(() => {
|
|
2814
|
+
// Do not proceed if debounce feature is turned
|
|
2815
|
+
// off or there is no event defined
|
|
2816
|
+
if (!hasDebounce || !inputTextState || !inputTextState.changeEvent || !onChange) return;
|
|
2817
|
+
const handler = setTimeout(() => {
|
|
2818
|
+
onChange(inputTextState.changeEvent);
|
|
2819
|
+
}, DELAY_MS);
|
|
2820
|
+
return () => clearTimeout(handler);
|
|
2821
|
+
}, [inputTextState]);
|
|
2822
|
+
const handleChange = e => {
|
|
2823
|
+
// We need to have control over change event and input value separately
|
|
2824
|
+
// so that we can set initial state via 'value' prop (if needed)
|
|
2825
|
+
hasDebounce ? setInputTextState({
|
|
2826
|
+
changeEvent: e,
|
|
2827
|
+
inputValue: e.target.value
|
|
2828
|
+
}) : onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
3004
2829
|
};
|
|
3005
|
-
const
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
2830
|
+
const inputTextValue = hasDebounce ? inputTextState.inputValue : value;
|
|
2831
|
+
// Don't use default value when debounce feature is enabled because
|
|
2832
|
+
// in that case component is controlled
|
|
2833
|
+
const defaultInputValue = hasDebounce ? undefined : defaultValue;
|
|
2834
|
+
const startAdornmentIcon = () => {
|
|
2835
|
+
if (!startIcon) return null;
|
|
2836
|
+
return jsx(StyledAdornment, Object.assign({
|
|
2837
|
+
className: `${adornmentIconClassName} start`,
|
|
2838
|
+
position: "start"
|
|
2839
|
+
}, {
|
|
2840
|
+
children: startIcon
|
|
2841
|
+
}), void 0);
|
|
3010
2842
|
};
|
|
3011
|
-
const
|
|
3012
|
-
|
|
2843
|
+
const endAdornmentIcon = () => {
|
|
2844
|
+
if (!hasEndAdornmentIcon) return null;
|
|
2845
|
+
return jsx(EndAdornment, Object.assign({}, {
|
|
2846
|
+
endAdornmentTooltip,
|
|
2847
|
+
error: _error,
|
|
2848
|
+
dataTestId,
|
|
2849
|
+
endIcon,
|
|
2850
|
+
success,
|
|
2851
|
+
warning: _warning
|
|
2852
|
+
}), void 0);
|
|
3013
2853
|
};
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
},
|
|
3018
|
-
"data-testid": dataTestId,
|
|
3019
|
-
dense: dense,
|
|
3020
|
-
id: id,
|
|
3021
|
-
onKeyDown: onKeyDown,
|
|
3022
|
-
style: {
|
|
3023
|
-
height: calculateMaxHeight({
|
|
3024
|
-
isDense: dense,
|
|
3025
|
-
maxVisibleItems,
|
|
3026
|
-
menuItems,
|
|
3027
|
-
menuItemHeight
|
|
3028
|
-
})
|
|
3029
|
-
}
|
|
2854
|
+
const wrapperClassName = useStylesWithRootClass(_fullWidth !== false ? 'dot-input-text--fullwidth' : '', className);
|
|
2855
|
+
return jsxs(StyledTextFieldContainer, Object.assign({
|
|
2856
|
+
className: wrapperClassName
|
|
3030
2857
|
}, {
|
|
3031
|
-
children:
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
}
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
subMenuItems: subItems
|
|
3082
|
-
})]
|
|
3083
|
-
}), key);
|
|
3084
|
-
})
|
|
2858
|
+
children: [persistentLabel && jsx(DotInputLabel, Object.assign({}, {
|
|
2859
|
+
disabled: _disabled,
|
|
2860
|
+
error: _error,
|
|
2861
|
+
id,
|
|
2862
|
+
label,
|
|
2863
|
+
required: _required
|
|
2864
|
+
}), void 0), jsx(StyledTextField, {
|
|
2865
|
+
InputProps: {
|
|
2866
|
+
startAdornment: startAdornmentIcon(),
|
|
2867
|
+
endAdornment: endAdornmentIcon()
|
|
2868
|
+
},
|
|
2869
|
+
"aria-label": name,
|
|
2870
|
+
autoComplete: _autoComplete,
|
|
2871
|
+
autoFocus: autoFocus,
|
|
2872
|
+
classes: {
|
|
2873
|
+
root: rootStyles
|
|
2874
|
+
},
|
|
2875
|
+
defaultValue: defaultInputValue,
|
|
2876
|
+
disabled: _disabled,
|
|
2877
|
+
error: _error,
|
|
2878
|
+
focused: _readOnly ? false : undefined,
|
|
2879
|
+
fullWidth: _fullWidth,
|
|
2880
|
+
helperText: helperText,
|
|
2881
|
+
id: id,
|
|
2882
|
+
InputLabelProps: {
|
|
2883
|
+
shrink: _type === 'date' ? true : shrink
|
|
2884
|
+
},
|
|
2885
|
+
inputProps: {
|
|
2886
|
+
'data-testid': dataTestId,
|
|
2887
|
+
className: 'dot-input',
|
|
2888
|
+
readOnly: _readOnly
|
|
2889
|
+
},
|
|
2890
|
+
inputRef: inputRef,
|
|
2891
|
+
label: persistentLabel ? null : label,
|
|
2892
|
+
multiline: _multiline,
|
|
2893
|
+
name: name,
|
|
2894
|
+
onBlur: onBlur,
|
|
2895
|
+
onChange: hasDebounce ? handleChange : onChange,
|
|
2896
|
+
onFocus: onFocus,
|
|
2897
|
+
onKeyDown: onKeyDown,
|
|
2898
|
+
onMouseUp: onMouseUp,
|
|
2899
|
+
placeholder: placeholder,
|
|
2900
|
+
required: _required,
|
|
2901
|
+
minRows: _multiline ? minRows : null,
|
|
2902
|
+
maxRows: _multiline ? maxRows : null,
|
|
2903
|
+
size: _size,
|
|
2904
|
+
type: _type,
|
|
2905
|
+
value: inputTextValue,
|
|
2906
|
+
variant: "outlined"
|
|
2907
|
+
}, void 0)]
|
|
3085
2908
|
}), void 0);
|
|
3086
|
-
}
|
|
2909
|
+
};
|
|
3087
2910
|
|
|
3088
|
-
const
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
2911
|
+
const rootClassName$N = 'dot-search-input';
|
|
2912
|
+
const StyledSearchInput = styled.span.withConfig({
|
|
2913
|
+
displayName: "SearchInputstyles__StyledSearchInput",
|
|
2914
|
+
componentId: "qlwzku-0"
|
|
2915
|
+
})(["", ""], () => css(["&.", "{}"], rootClassName$N));
|
|
2916
|
+
|
|
2917
|
+
function SearchInput({
|
|
3092
2918
|
'data-testid': dataTestId,
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
2919
|
+
autoFocus = true,
|
|
2920
|
+
className,
|
|
2921
|
+
disabled = false,
|
|
2922
|
+
onChange,
|
|
2923
|
+
onClear,
|
|
2924
|
+
placeholder = 'Search',
|
|
2925
|
+
tooltip = null,
|
|
2926
|
+
value
|
|
2927
|
+
}) {
|
|
2928
|
+
const rootClasses = useStylesWithRootClass(rootClassName$N, className);
|
|
2929
|
+
const [searchText, setSearchText] = useState(value);
|
|
2930
|
+
let previousSearchText = '';
|
|
2931
|
+
const handleChange = useCallback(event => {
|
|
2932
|
+
previousSearchText = event.target.value;
|
|
2933
|
+
setSearchText(event.target.value);
|
|
2934
|
+
// Timeout is to give user a chance to finish typing before refreshing data.
|
|
2935
|
+
setTimeout(function () {
|
|
2936
|
+
if (onChange && event.target.value === previousSearchText) {
|
|
2937
|
+
onChange(event.target.value);
|
|
2938
|
+
}
|
|
2939
|
+
}, 500);
|
|
2940
|
+
}, [onChange]);
|
|
2941
|
+
const handleClear = useCallback(() => {
|
|
2942
|
+
setSearchText('');
|
|
2943
|
+
onClear && onClear();
|
|
2944
|
+
}, [onClear]);
|
|
2945
|
+
const searchIcon = jsx(DotIcon, {
|
|
2946
|
+
className: "search-icon",
|
|
2947
|
+
iconId: "search"
|
|
2948
|
+
}, void 0);
|
|
2949
|
+
const clearSearchIcon = jsx(DotIconButton, {
|
|
2950
|
+
iconId: "close",
|
|
2951
|
+
onClick: handleClear,
|
|
2952
|
+
size: "small",
|
|
2953
|
+
tooltip: "Clear search text"
|
|
2954
|
+
}, void 0);
|
|
2955
|
+
return jsx(StyledSearchInput, Object.assign({
|
|
2956
|
+
className: rootClasses
|
|
2957
|
+
}, {
|
|
2958
|
+
children: jsx(DotTooltip, Object.assign({
|
|
2959
|
+
placement: "bottom",
|
|
2960
|
+
title: tooltip
|
|
2961
|
+
}, {
|
|
2962
|
+
children: jsx(DotInputText, {
|
|
2963
|
+
"data-testid": dataTestId,
|
|
2964
|
+
autoFocus: autoFocus,
|
|
2965
|
+
className: "search-text",
|
|
2966
|
+
disabled: disabled,
|
|
2967
|
+
endIcon: (searchText === null || searchText === void 0 ? void 0 : searchText.length) > 0 ? clearSearchIcon : null,
|
|
2968
|
+
id: "app-instance-search-text",
|
|
2969
|
+
name: "app-instance-search-text",
|
|
2970
|
+
onChange: handleChange,
|
|
2971
|
+
placeholder: placeholder,
|
|
2972
|
+
startIcon: searchIcon,
|
|
2973
|
+
value: searchText
|
|
2974
|
+
}, void 0)
|
|
2975
|
+
}), void 0)
|
|
2976
|
+
}), void 0);
|
|
2977
|
+
}
|
|
2978
|
+
|
|
2979
|
+
const rootClassName$M = 'dot-copy-button';
|
|
2980
|
+
const StyledCopyButton = styled.span.withConfig({
|
|
2981
|
+
displayName: "CopyButtonstyles__StyledCopyButton",
|
|
2982
|
+
componentId: "sc-18ff0u-0"
|
|
2983
|
+
})(["", ""], ({
|
|
2984
|
+
theme
|
|
2985
|
+
}) => css(["&.", "{.copied-to-clipboard{color:", ";}}"], rootClassName$M, theme.palette.success[400]));
|
|
2986
|
+
|
|
2987
|
+
const DotCopyButton = ({
|
|
2988
|
+
ariaLabel: _ariaLabel = 'Copy to clipboard',
|
|
2989
|
+
copiedTooltip: _copiedTooltip = 'Copied!',
|
|
2990
|
+
copyTooltip: _copyTooltip = 'Copy to clipboard',
|
|
2991
|
+
'data-testid': dataTestId = 'dot-copy-button',
|
|
2992
|
+
value
|
|
3105
2993
|
}) => {
|
|
3106
|
-
const
|
|
3107
|
-
const
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
const timeout = isSubmenu || hasSubItems ? {
|
|
3116
|
-
exit: 0,
|
|
3117
|
-
enter: 300
|
|
3118
|
-
} : undefined;
|
|
3119
|
-
const handleSelect = (event, itemKey) => {
|
|
3120
|
-
onLeave && onLeave(event);
|
|
3121
|
-
onSelect && onSelect(event, id, itemKey);
|
|
3122
|
-
};
|
|
3123
|
-
const handleListKeyDown = event => {
|
|
3124
|
-
if (onLeave && event.key === 'Tab') {
|
|
3125
|
-
event.preventDefault();
|
|
3126
|
-
onLeave(event);
|
|
2994
|
+
const [showCopiedIcon, setShowCopiedIcon] = useState(false);
|
|
2995
|
+
const copyToClipboard = () => {
|
|
2996
|
+
// The check for navigator.clipboard.writeText is because this function is
|
|
2997
|
+
// only supported in secure contexts (https). This will always be the case in
|
|
2998
|
+
// production but not when running locally.
|
|
2999
|
+
if (!navigator.clipboard || !navigator.clipboard.writeText) {
|
|
3000
|
+
console.warn('Copy to clipboard is only supported in secure context (https)', value);
|
|
3001
|
+
} else {
|
|
3002
|
+
navigator.clipboard.writeText(value);
|
|
3127
3003
|
}
|
|
3128
3004
|
};
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3005
|
+
const copy = () => {
|
|
3006
|
+
copyToClipboard();
|
|
3007
|
+
setShowCopiedIcon(true);
|
|
3008
|
+
setTimeout(function () {
|
|
3009
|
+
setShowCopiedIcon(false);
|
|
3010
|
+
}, 3000);
|
|
3011
|
+
return false;
|
|
3134
3012
|
};
|
|
3135
|
-
return
|
|
3136
|
-
|
|
3137
|
-
"
|
|
3138
|
-
className: rootClasses,
|
|
3139
|
-
"data-testid": dataTestId,
|
|
3140
|
-
disablePortal: disablePortal,
|
|
3141
|
-
open: _open,
|
|
3142
|
-
placement: _menuPlacement,
|
|
3143
|
-
role: undefined,
|
|
3144
|
-
transition: true
|
|
3013
|
+
return jsxs(StyledCopyButton, Object.assign({
|
|
3014
|
+
className: rootClassName$M,
|
|
3015
|
+
"data-testid": dataTestId
|
|
3145
3016
|
}, {
|
|
3146
|
-
children: ({
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
"data-testid": "loading-indicator",
|
|
3161
|
-
tooltip: "Loading Data...",
|
|
3162
|
-
value: 20
|
|
3163
|
-
}, void 0) : jsx(DotMenuList, {
|
|
3164
|
-
autoFocusItem: _open,
|
|
3165
|
-
"data-testid": `${dataTestId}-menu`,
|
|
3166
|
-
dense: _dense,
|
|
3167
|
-
id: id,
|
|
3168
|
-
maxVisibleItems: _maxVisibleItems,
|
|
3169
|
-
menuItemHeight: menuItemHeight,
|
|
3170
|
-
menuItems: _menuItems,
|
|
3171
|
-
onItemSelect: handleSelect,
|
|
3172
|
-
onKeyDown: handleListKeyDown,
|
|
3173
|
-
onSubMenuCreate: ({
|
|
3174
|
-
anchorElement,
|
|
3175
|
-
isOpened,
|
|
3176
|
-
subMenuId,
|
|
3177
|
-
subMenuItems
|
|
3178
|
-
}) => jsx(DotMenu, {
|
|
3179
|
-
anchorEl: anchorElement,
|
|
3180
|
-
menuPlacement: "right-start",
|
|
3181
|
-
id: subMenuId,
|
|
3182
|
-
menuItems: subMenuItems,
|
|
3183
|
-
open: isOpened,
|
|
3184
|
-
onLeave: onLeave,
|
|
3185
|
-
onSelect: onSelect,
|
|
3186
|
-
selectedKey: selectedKey
|
|
3187
|
-
}, void 0),
|
|
3188
|
-
selectedKey: selectedKey
|
|
3189
|
-
}, void 0)
|
|
3190
|
-
}), void 0)
|
|
3191
|
-
}, void 0)
|
|
3192
|
-
}), void 0)
|
|
3017
|
+
children: [!showCopiedIcon && jsx(DotIconButton, {
|
|
3018
|
+
ariaLabel: _ariaLabel,
|
|
3019
|
+
"data-testid": `${dataTestId}-button`,
|
|
3020
|
+
iconId: "duplicate",
|
|
3021
|
+
onClick: copy,
|
|
3022
|
+
size: "small",
|
|
3023
|
+
tooltip: _copyTooltip
|
|
3024
|
+
}, void 0), showCopiedIcon && jsx(DotIcon, {
|
|
3025
|
+
className: "copied-to-clipboard",
|
|
3026
|
+
"data-testid": `${dataTestId}-icon`,
|
|
3027
|
+
fontSize: "small",
|
|
3028
|
+
iconId: "check-solid",
|
|
3029
|
+
tooltip: _copiedTooltip
|
|
3030
|
+
}, void 0)]
|
|
3193
3031
|
}), void 0);
|
|
3194
3032
|
};
|
|
3195
3033
|
|
|
3196
|
-
const
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
});
|
|
3202
|
-
};
|
|
3203
|
-
|
|
3204
|
-
const fadeIn = keyframes(["from{opacity:0;}to{opacity:1;}"]);
|
|
3205
|
-
const StyledDotDrawer = styled(DotDrawer).withConfig({
|
|
3206
|
-
displayName: "NestedListstyles__StyledDotDrawer",
|
|
3207
|
-
componentId: "sc-1wwoqos-0"
|
|
3208
|
-
})(["", ""], ({
|
|
3209
|
-
open
|
|
3210
|
-
}) => css(["&.", "{.dot-drawer-paper{z-index:", ";animation:", ";}}"], nestedDrawerClassName, open ? levelFirst : levelBottom, open && css(["", " 0.2s cubic-bezier(1,0,1,.01);"], fadeIn)));
|
|
3034
|
+
const rootClassName$L = 'dot-link';
|
|
3035
|
+
const StyledLink = styled(Link).withConfig({
|
|
3036
|
+
displayName: "Linkstyles__StyledLink",
|
|
3037
|
+
componentId: "sc-1lpmaww-0"
|
|
3038
|
+
})(["", ""], () => css(["&.", "{cursor:pointer;&:hover:not(.MuiLink-underlineHover){text-decoration:none;}}"], rootClassName$L));
|
|
3211
3039
|
|
|
3212
|
-
const
|
|
3213
|
-
const DotListDivider = ({
|
|
3214
|
-
item,
|
|
3215
|
-
index
|
|
3216
|
-
}) => {
|
|
3217
|
-
if (item.text) {
|
|
3218
|
-
return jsx(ListSubheader, Object.assign({
|
|
3219
|
-
disableSticky: true
|
|
3220
|
-
}, {
|
|
3221
|
-
children: jsx(DotTypography, Object.assign({
|
|
3222
|
-
variant: "overline"
|
|
3223
|
-
}, {
|
|
3224
|
-
children: item.text
|
|
3225
|
-
}), void 0)
|
|
3226
|
-
}), void 0);
|
|
3227
|
-
}
|
|
3228
|
-
return jsx(Divider, {
|
|
3229
|
-
"aria-hidden": true,
|
|
3230
|
-
"data-testid": `divider-${index}`
|
|
3231
|
-
}, void 0);
|
|
3232
|
-
};
|
|
3233
|
-
const DotList = ({
|
|
3040
|
+
const DotLink = ({
|
|
3234
3041
|
ariaLabel,
|
|
3235
3042
|
children,
|
|
3236
3043
|
className,
|
|
3237
|
-
|
|
3238
|
-
'data-testid': dataTestId,
|
|
3239
|
-
dense: _dense = false,
|
|
3240
|
-
disablePadding: _disablePadding = false,
|
|
3241
|
-
items: _items = [],
|
|
3242
|
-
menuPlacement: _menuPlacement = 'right-start',
|
|
3243
|
-
nestedDrawerLeftSpacing: _nestedDrawerLeftSpacing = 240,
|
|
3244
|
-
nestedListType: _nestedListType = 'expandable',
|
|
3245
|
-
width: _width = 240
|
|
3246
|
-
}) => {
|
|
3247
|
-
const rootClasses = useStylesWithRootClass(rootClassName$O, className);
|
|
3248
|
-
const listWidth = typeof _width === 'number' ? `${_width}px` : _width;
|
|
3249
|
-
const listRef = useRef();
|
|
3250
|
-
const [listItemIndex, setListItemIndex] = useState(null);
|
|
3251
|
-
const updateSelectedListItem = currentIndex => {
|
|
3252
|
-
currentIndex === listItemIndex ? setListItemIndex(null) : setListItemIndex(currentIndex);
|
|
3253
|
-
};
|
|
3254
|
-
return jsxs(StyledList, Object.assign({
|
|
3255
|
-
"aria-label": ariaLabel,
|
|
3256
|
-
classes: {
|
|
3257
|
-
root: rootClasses
|
|
3258
|
-
},
|
|
3259
|
-
component: _component,
|
|
3260
|
-
"data-testid": dataTestId,
|
|
3261
|
-
dense: _dense,
|
|
3262
|
-
disablePadding: _disablePadding,
|
|
3263
|
-
ref: listRef,
|
|
3264
|
-
style: {
|
|
3265
|
-
width: listWidth
|
|
3266
|
-
}
|
|
3267
|
-
}, {
|
|
3268
|
-
children: [_items.map((item, index) => {
|
|
3269
|
-
const handleListItemClick = e => {
|
|
3270
|
-
var _a;
|
|
3271
|
-
updateSelectedListItem(index);
|
|
3272
|
-
(_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, e);
|
|
3273
|
-
};
|
|
3274
|
-
const handleMenuLeave = event => {
|
|
3275
|
-
var _a, _b;
|
|
3276
|
-
// Remove index only if clicked element is not found within the list
|
|
3277
|
-
if (!((_a = listRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
3278
|
-
setListItemIndex(null);
|
|
3279
|
-
(_b = item.onMenuLeave) === null || _b === void 0 ? void 0 : _b.call(item, event);
|
|
3280
|
-
}
|
|
3281
|
-
};
|
|
3282
|
-
if (item.child) {
|
|
3283
|
-
return jsx(Fragment$1, {
|
|
3284
|
-
children: item.child
|
|
3285
|
-
}, `item-child-${index}`);
|
|
3286
|
-
}
|
|
3287
|
-
if (item.divider) {
|
|
3288
|
-
return jsx(DotListDivider, {
|
|
3289
|
-
index: index,
|
|
3290
|
-
item: item
|
|
3291
|
-
}, `divider-${index}`);
|
|
3292
|
-
}
|
|
3293
|
-
return jsx(DotListItem, {
|
|
3294
|
-
className: item.className,
|
|
3295
|
-
component: item.component,
|
|
3296
|
-
"data-testid": `${dataTestId}-item-${index}`,
|
|
3297
|
-
endIcon: item.endIcon,
|
|
3298
|
-
href: item.href,
|
|
3299
|
-
isOpened: listItemIndex === index,
|
|
3300
|
-
items: item.items,
|
|
3301
|
-
menuPlacement: _menuPlacement,
|
|
3302
|
-
nestedDrawerLeftSpacing: _nestedDrawerLeftSpacing,
|
|
3303
|
-
nestedListType: _nestedListType,
|
|
3304
|
-
onClick: item.href && !item.onClick ? null : handleListItemClick,
|
|
3305
|
-
onMenuLeave: handleMenuLeave,
|
|
3306
|
-
primaryText: item.primaryText,
|
|
3307
|
-
secondaryText: item.secondaryText,
|
|
3308
|
-
selected: item.selected,
|
|
3309
|
-
startIcon: item.startIcon,
|
|
3310
|
-
target: item.target,
|
|
3311
|
-
text: item.text,
|
|
3312
|
-
tooltip: item.tooltip,
|
|
3313
|
-
tooltipPlacement: item.tooltipPlacement || DEFAULT_TOOLTIP_PLACEMENT
|
|
3314
|
-
}, index);
|
|
3315
|
-
}), children]
|
|
3316
|
-
}), void 0);
|
|
3317
|
-
};
|
|
3318
|
-
const DotListItem = ({
|
|
3319
|
-
ariaLabel,
|
|
3320
|
-
className,
|
|
3321
|
-
component: _component2 = 'li',
|
|
3044
|
+
color: _color = 'primary',
|
|
3322
3045
|
'data-testid': dataTestId,
|
|
3323
|
-
divider: _divider = false,
|
|
3324
|
-
endIcon,
|
|
3325
3046
|
href,
|
|
3326
|
-
isOpened,
|
|
3327
3047
|
onClick,
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
nestedListType,
|
|
3333
|
-
primaryText,
|
|
3334
|
-
secondaryText,
|
|
3335
|
-
selected,
|
|
3336
|
-
startIcon,
|
|
3048
|
+
onMouseEnter,
|
|
3049
|
+
onPointerDown,
|
|
3050
|
+
rel: _rel = 'noreferrer',
|
|
3051
|
+
tabIndex: _tabIndex = 0,
|
|
3337
3052
|
target,
|
|
3338
|
-
text,
|
|
3339
3053
|
tooltip,
|
|
3340
|
-
|
|
3054
|
+
underline
|
|
3341
3055
|
}) => {
|
|
3342
|
-
const
|
|
3343
|
-
const
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
const handleClick = event => {
|
|
3349
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
3350
|
-
toggleOpen(event);
|
|
3056
|
+
const rootClasses = useStylesWithRootClass(rootClassName$L, className);
|
|
3057
|
+
const handleKeyPress = event => {
|
|
3058
|
+
if (onClick && event.key === 'Enter') {
|
|
3059
|
+
event.preventDefault();
|
|
3060
|
+
onClick(event);
|
|
3061
|
+
}
|
|
3351
3062
|
};
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
primary: primaryText,
|
|
3355
|
-
secondary: secondaryText
|
|
3356
|
-
}, void 0) : jsx(DotTypography, Object.assign({
|
|
3357
|
-
variant: "body1"
|
|
3063
|
+
return jsx(DotTooltip, Object.assign({
|
|
3064
|
+
title: tooltip
|
|
3358
3065
|
}, {
|
|
3359
|
-
children:
|
|
3066
|
+
children: jsx(StyledLink, Object.assign({
|
|
3067
|
+
"aria-label": ariaLabel,
|
|
3068
|
+
classes: {
|
|
3069
|
+
root: rootClasses
|
|
3070
|
+
},
|
|
3071
|
+
color: _color,
|
|
3072
|
+
"data-testid": dataTestId,
|
|
3073
|
+
href: href,
|
|
3074
|
+
onClick: onClick,
|
|
3075
|
+
onKeyPress: handleKeyPress,
|
|
3076
|
+
onMouseEnter: onMouseEnter,
|
|
3077
|
+
onPointerDown: onPointerDown,
|
|
3078
|
+
rel: _rel,
|
|
3079
|
+
tabIndex: _tabIndex,
|
|
3080
|
+
target: target,
|
|
3081
|
+
underline: underline
|
|
3082
|
+
}, {
|
|
3083
|
+
children: children
|
|
3084
|
+
}), void 0)
|
|
3360
3085
|
}), void 0);
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3086
|
+
};
|
|
3087
|
+
|
|
3088
|
+
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='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M12.4332 16.3533V14.8333H11.5665V16.3533L10.7432 15.8933L9.85651 16.4033L11.9998 17.6366L14.1932 16.3733L13.3332 15.8766L12.4332 16.3533Z' fill='white'/%3e%3cpath d='M7.99328 10.1866L9.24661 10.9132L9.67995 10.1399L8.36995 9.4299L9.09328 9.01657V8.03323L7.11328 9.18323L7.11661 11.5532L7.99328 11.0566V10.1866Z' fill='white'/%3e%3cpath d='M14.6934 10.9133L15.9934 10.1733L15.99 11.0566L16.8867 11.5599V9.1766L14.81 7.98993L14.7767 8.9566L15.6167 9.45326L14.29 10.0799L14.6934 10.9133Z' fill='white'/%3e%3cpath d='M16.8801 12.5435L16.0001 12.0402V12.0935V13.7068L12.4167 11.6868V7.61015L13.9667 8.49015V7.51682L12.0001 6.35349L9.95006 7.52348V8.52348L11.4967 7.63015V11.6868L8.00006 13.8168V12.0202L7.12006 12.5235V14.8202L8.96672 15.8502L9.86672 15.3335L8.40006 14.5268L12.0001 12.4368L15.5567 14.5035L14.1301 15.3268L15.0567 15.8701L16.8701 14.8268L16.8801 12.5435Z' fill='white'/%3e%3c/svg%3e";
|
|
3089
|
+
|
|
3090
|
+
var img$5 = "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='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M14.1867 11.2667L12.1634 10.0833L10.1367 11.2667V13.62L12.1634 14.7867L14.1867 13.62V11.2667Z' fill='white'/%3e%3cpath d='M8.43666 12.0001L7.47333 11.1501V15.1667L10.41 16.8367V15.7034L8.43666 14.5401V12.0001Z' fill='white'/%3e%3cpath d='M15.8965 12V14.5833L13.9632 15.7033V16.9367L16.8532 15.1533V11.0967L15.8965 12Z' fill='white'/%3e%3cpath d='M12.1565 8.13333L14.7165 9.61333L15.4165 8.89L12.1565 7L8.87988 8.90667L9.57988 9.63333L12.1565 8.13333Z' fill='white'/%3e%3c/svg%3e";
|
|
3091
|
+
|
|
3092
|
+
var img$4 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%2333D389'/%3e%3cpath d='M17.0033 7.62322H16.4567C16.3925 7.62863 16.3324 7.65679 16.2871 7.70264C16.2419 7.74848 16.2146 7.80898 16.21 7.87322V9.14322C15.7432 8.43248 15.1064 7.84955 14.3572 7.44732C13.6081 7.04509 12.7703 6.8363 11.92 6.83989C11.0845 6.84475 10.2627 7.05243 9.52515 7.44508C8.78763 7.83772 8.15649 8.40359 7.68598 9.09405C7.21547 9.7845 6.91966 10.5789 6.82398 11.4089C6.72831 12.2389 6.83562 13.0798 7.13669 13.8592C7.43777 14.6386 7.92361 15.3332 8.55245 15.8834C9.18128 16.4335 9.93431 16.8227 10.7468 17.0176C11.5593 17.2124 12.4069 17.207 13.2169 17.0019C14.0269 16.7967 14.7749 16.398 15.3967 15.8399C15.4257 15.8182 15.4492 15.79 15.4654 15.7576C15.4816 15.7252 15.49 15.6894 15.49 15.6532C15.49 15.617 15.4816 15.5813 15.4654 15.5489C15.4492 15.5165 15.4257 15.4883 15.3967 15.4666L14.9833 15.0532C14.9369 15.0135 14.8778 14.9917 14.8167 14.9917C14.7556 14.9917 14.6965 15.0135 14.65 15.0532C13.9076 15.7352 12.9312 16.1052 11.9233 16.0866C11.1892 16.087 10.4684 15.8897 9.83687 15.5154C9.20531 15.141 8.68627 14.6034 8.33429 13.9591C7.98231 13.3148 7.81039 12.5876 7.83662 11.8539C7.86284 11.1202 8.08624 10.4071 8.48332 9.78959C8.8804 9.17207 9.4365 8.67292 10.0932 8.34461C10.7499 8.0163 11.4828 7.87095 12.2151 7.92384C12.9474 7.97674 13.6519 8.22592 14.2545 8.6452C14.8572 9.06448 15.3358 9.63837 15.64 10.3066H14.1467C14.0828 10.3112 14.0227 10.3387 13.9774 10.384C13.9321 10.4293 13.9046 10.4893 13.9 10.5532V11.0466C13.9046 11.1104 13.9321 11.1705 13.9774 11.2158C14.0227 11.2611 14.0828 11.2886 14.1467 11.2932H17C17.0639 11.2886 17.124 11.2611 17.1693 11.2158C17.2146 11.1705 17.242 11.1104 17.2467 11.0466V7.87322C17.2422 7.8095 17.2154 7.74942 17.1708 7.70364C17.1263 7.65787 17.0669 7.62938 17.0033 7.62322Z' fill='white'/%3e%3cpath d='M12.1232 9.39987C12.1667 9.39747 12.2077 9.37914 12.2384 9.34839C12.2692 9.31764 12.2875 9.27662 12.2899 9.2332C12.2899 9.2332 12.3399 8.8332 12.3399 8.69987C12.3399 8.56653 12.2499 8.4932 12.1666 8.48987C11.5045 8.45232 10.8457 8.60791 10.2703 8.93771C9.69497 9.26752 9.22779 9.75734 8.92557 10.3477C8.62335 10.938 8.4991 11.6034 8.56792 12.263C8.63675 12.9226 8.89568 13.548 9.31325 14.0632C9.83849 14.7239 10.5905 15.1658 11.4232 15.3032C11.5166 15.3032 11.5999 15.2632 11.6299 15.1365C11.6299 15.1365 11.6999 14.8032 11.7132 14.6832C11.7233 14.639 11.7157 14.5927 11.692 14.554C11.6684 14.5154 11.6305 14.4876 11.5866 14.4765C11.225 14.4227 10.8806 14.2869 10.5795 14.0795C10.2785 13.8721 10.029 13.5986 9.84992 13.2799C9.64046 12.9274 9.51393 12.5318 9.47992 12.1232C9.44986 11.7648 9.49697 11.4042 9.61806 11.0655C9.73915 10.7269 9.93142 10.4181 10.1819 10.1601C10.4324 9.90199 10.7353 9.70061 11.0702 9.56947C11.405 9.43834 11.7641 9.38051 12.1232 9.39987Z' fill='white'/%3e%3cpath d='M13.9433 13.1568C13.96 13.1389 13.9724 13.1175 13.9796 13.0942C13.9868 13.0708 13.9885 13.0461 13.9846 13.0219C13.9808 12.9978 13.9714 12.9749 13.9573 12.9549C13.9432 12.9349 13.9247 12.9185 13.9033 12.9068L13.6133 12.7001C13.5739 12.6762 13.5272 12.6674 13.4818 12.6754C13.4364 12.6833 13.3955 12.7075 13.3666 12.7434C13.2321 12.9033 13.0642 13.0318 12.8747 13.12C12.6853 13.2082 12.4789 13.2538 12.2699 13.2538C12.061 13.2538 11.8546 13.2082 11.6651 13.12C11.4757 13.0318 11.3078 12.9033 11.1733 12.7434C11.1277 12.6913 11.0864 12.6356 11.0499 12.5768C10.9268 12.3776 10.8582 12.1495 10.8512 11.9155C10.8442 11.6814 10.8989 11.4496 11.0099 11.2434C11.0314 11.2102 11.0389 11.1699 11.0308 11.1312C11.0227 11.0925 10.9996 11.0585 10.9666 11.0368L10.6333 10.7901C10.5891 10.7715 10.5396 10.7697 10.4942 10.7851C10.4487 10.8004 10.4105 10.8319 10.3866 10.8734C10.2376 11.1465 10.153 11.45 10.1391 11.7608C10.1253 12.0716 10.1825 12.3815 10.3066 12.6668C10.4127 12.938 10.5831 13.1794 10.8033 13.3701C11.1902 13.7461 11.7104 13.9534 12.2499 13.9468C12.5743 13.9565 12.8964 13.8902 13.1905 13.753C13.4845 13.6158 13.7424 13.4116 13.9433 13.1568Z' fill='white'/%3e%3c/svg%3e";
|
|
3093
|
+
|
|
3094
|
+
var img$3 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M17.6865 10.0334C17.3062 9.49067 16.7772 9.06934 16.1632 8.82008C15.6426 8.61932 15.0801 8.55138 14.5267 8.62237C13.9733 8.69337 13.4462 8.90108 12.9932 9.22674C12.4991 9.62868 12.0519 10.0849 11.6598 10.5867L11.4232 10.8534L13.0198 11.5434L13.1498 11.4067C13.4002 11.1158 13.6697 10.8419 13.9565 10.5867C14.1891 10.4177 14.4599 10.3085 14.7448 10.269C15.0297 10.2294 15.3199 10.2607 15.5898 10.3601C15.916 10.4798 16.1929 10.7051 16.3765 11.0001C16.5305 11.2108 16.6383 11.4516 16.6932 11.7067C16.7448 11.9619 16.7448 12.2249 16.6932 12.4801C16.6319 12.8145 16.4783 13.125 16.2498 13.3767C16.0471 13.5809 15.7972 13.7319 15.5221 13.8162C15.2471 13.9005 14.9554 13.9156 14.6732 13.8601C14.318 13.7558 13.9714 13.6243 13.6365 13.4667L13.4598 13.3967L12.3032 14.6934L12.6365 14.8367C13.196 15.1144 13.7809 15.3376 14.3832 15.5034C14.841 15.5831 15.3102 15.5706 15.7632 15.4667C16.4116 15.3301 17.0012 14.9945 17.4498 14.5067C17.907 14.0252 18.2099 13.4182 18.3198 12.7634C18.4116 12.2979 18.4116 11.8189 18.3198 11.3534C18.186 10.8803 17.9717 10.4338 17.6865 10.0334Z' fill='white'/%3e%3cpath d='M12.8401 13.0499L11.2468 12.3599L11.1168 12.4966C10.8669 12.7942 10.5962 13.0738 10.3068 13.3332C10.0741 13.5023 9.80337 13.6115 9.51849 13.651C9.2336 13.6905 8.94336 13.6593 8.67345 13.5599C8.35219 13.4397 8.07852 13.2187 7.89345 12.9299C7.74251 12.7191 7.63591 12.4798 7.58012 12.2266C7.51653 11.9342 7.52262 11.6311 7.5979 11.3415C7.67318 11.052 7.81553 10.7842 8.01345 10.5599C8.2156 10.3551 8.46564 10.2039 8.74095 10.1201C9.01626 10.0363 9.30813 10.0225 9.59012 10.0799C9.94807 10.1781 10.2971 10.3063 10.6335 10.4632L10.8101 10.5299L11.9668 9.23324L11.6735 9.11324C11.1141 8.8326 10.5278 8.60924 9.92345 8.44657C9.37154 8.32869 8.79848 8.35611 8.26035 8.52614C7.72222 8.69617 7.23744 9.00299 6.85345 9.41657C6.38782 9.89208 6.08347 10.5019 5.98345 11.1599C5.88532 11.6248 5.88532 12.105 5.98345 12.5699C6.08588 13.0347 6.28211 13.4736 6.56012 13.8599C6.92983 14.4125 7.46217 14.8365 8.08345 15.0732C8.69864 15.3134 9.37049 15.369 10.0168 15.2332C10.4725 15.1299 10.9023 14.9348 11.2801 14.6599C11.7741 14.258 12.2214 13.8018 12.6135 13.2999L12.8401 13.0499Z' fill='white'/%3e%3c/svg%3e";
|
|
3095
|
+
|
|
3096
|
+
var img$2 = "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='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23F7B731'/%3e%3cpath d='M17.0168 10.4836C16.8598 10.4819 16.704 10.5111 16.5583 10.5697C16.4126 10.6282 16.2799 10.715 16.1679 10.8249C16.0558 10.9348 15.9665 11.0658 15.9051 11.2103C15.8437 11.3548 15.8114 11.51 15.8101 11.667C15.8125 11.8887 15.8759 12.1056 15.9934 12.2936L15.3268 13.0036C15.1062 12.8766 14.8516 12.8214 14.5982 12.8459C14.3449 12.8704 14.1055 12.9733 13.9134 13.1403L13.2168 12.667C13.3204 12.3753 13.3514 12.0627 13.307 11.7564C13.2626 11.45 13.1441 11.1591 12.9619 10.9089C12.7796 10.6587 12.5391 10.4567 12.2611 10.3204C11.9832 10.1842 11.6762 10.1178 11.3668 10.127C10.9257 10.1237 10.4963 10.268 10.1468 10.537L9.2801 9.74364C9.38078 9.56935 9.43368 9.37158 9.43343 9.1703C9.43084 9.01345 9.39725 8.85866 9.33461 8.71484C9.27197 8.57101 9.18151 8.44099 9.06844 8.33225C8.95537 8.22352 8.82191 8.13821 8.67575 8.08124C8.52958 8.02427 8.3736 7.99677 8.21677 8.0003C7.89915 8.00103 7.59426 8.12525 7.36658 8.34671C7.13891 8.56817 7.00628 8.86949 6.99677 9.18697C6.99848 9.34467 7.03153 9.50046 7.09399 9.64528C7.15645 9.7901 7.24707 9.92106 7.36059 10.0305C7.4741 10.14 7.60825 10.2259 7.75524 10.283C7.90222 10.3402 8.0591 10.3676 8.21677 10.3636C8.43906 10.3609 8.65657 10.2987 8.84677 10.1836L9.71343 10.977C9.49991 11.2949 9.3884 11.6704 9.39376 12.0533C9.39912 12.4363 9.5211 12.8085 9.74343 13.1203L9.07677 13.8303C8.87595 13.7162 8.64759 13.6597 8.41677 13.667C8.18607 13.6729 7.96224 13.7467 7.77327 13.8791C7.5843 14.0116 7.43859 14.1968 7.35437 14.4117C7.27015 14.6265 7.25115 14.8615 7.29975 15.087C7.34836 15.3126 7.46241 15.5189 7.62763 15.68C7.79286 15.8411 8.00192 15.9499 8.22867 15.9928C8.45542 16.0357 8.68978 16.0108 8.90244 15.9212C9.11509 15.8315 9.2966 15.6812 9.42425 15.4889C9.5519 15.2967 9.62002 15.0711 9.6201 14.8403C9.61839 14.6452 9.57041 14.4533 9.4801 14.2803L10.1468 13.5703C10.5613 13.8772 11.0792 14.0102 11.5902 13.9411C12.1013 13.872 12.5653 13.6062 12.8834 13.2003L13.5501 13.637C13.5048 13.7597 13.4811 13.8894 13.4801 14.0203C13.4963 14.3289 13.6304 14.6196 13.8546 14.8323C14.0788 15.045 14.376 15.1636 14.6851 15.1636C14.9942 15.1636 15.2914 15.045 15.5156 14.8323C15.7398 14.6196 15.8739 14.3289 15.8901 14.0203C15.8923 13.8081 15.8333 13.5998 15.7201 13.4203L16.3868 12.7103C16.5613 12.81 16.7591 12.8617 16.9601 12.8603C17.1212 12.8706 17.2827 12.8481 17.4348 12.794C17.5869 12.74 17.7264 12.6555 17.8448 12.5458C17.9633 12.4361 18.0581 12.3035 18.1237 12.156C18.1893 12.0085 18.2241 11.8492 18.2261 11.6878C18.2282 11.5264 18.1974 11.3662 18.1356 11.2171C18.0737 11.068 17.9822 10.933 17.8666 10.8203C17.751 10.7077 17.6137 10.6198 17.463 10.5619C17.3123 10.504 17.1514 10.4774 16.9901 10.4836H17.0168ZM11.3501 13.2436C11.1161 13.2377 10.8891 13.163 10.6973 13.0287C10.5056 12.8944 10.3578 12.7065 10.2723 12.4886C10.1868 12.2707 10.1675 12.0325 10.2167 11.8036C10.266 11.5748 10.3816 11.3656 10.5492 11.2021C10.7167 11.0387 10.9288 10.9283 11.1588 10.8848C11.3887 10.8412 11.6264 10.8665 11.8422 10.9574C12.0579 11.0483 12.242 11.2007 12.3714 11.3957C12.5009 11.5907 12.57 11.8196 12.5701 12.0536C12.5657 12.3719 12.4357 12.6756 12.2085 12.8985C11.9812 13.1214 11.6751 13.2454 11.3568 13.2436H11.3501Z' fill='white'/%3e%3c/svg%3e";
|
|
3097
|
+
|
|
3098
|
+
var img$1 = "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='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23205AB7'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M16.0859 8.30868C16.4108 8.42839 16.6831 8.6593 16.8542 8.96074L16.8628 8.97583L16.8705 8.99134C17.0174 9.28464 17.0775 9.61353 17.0441 9.93936C17.0123 11.03 16.8132 12.1093 16.4535 13.1395L16.4528 13.1415C16.1368 14.0377 15.4456 15.1335 14.6589 16.0108C14.2622 16.4533 13.8228 16.8611 13.3705 17.1668C12.9284 17.4656 12.4155 17.7067 11.8835 17.7262L11.8597 17.7271L11.8358 17.7262C11.291 17.7072 10.7708 17.4701 10.3204 17.1682C9.86244 16.8612 9.42376 16.4516 9.03057 16.0079C8.24999 15.1271 7.57941 14.0321 7.26533 13.1415L7.2645 13.1391C6.90532 12.1083 6.70674 11.0285 6.67566 9.93751C6.64229 9.61177 6.70236 9.28297 6.84922 8.98974L6.85684 8.97453L6.86522 8.95974C7.03585 8.65846 7.30747 8.42744 7.63179 8.30728L11.3874 6.76891C11.4429 6.74689 11.4996 6.7281 11.5571 6.71254C11.7538 6.6514 11.9644 6.6514 12.161 6.71254C12.2186 6.7281 12.2753 6.74693 12.3307 6.76895L12.3374 6.77159L16.0859 8.30868ZM11.9735 7.35255C11.8994 7.32695 11.8188 7.32695 11.7447 7.35255C11.7069 7.36213 11.6698 7.37415 11.6335 7.38855L7.87245 8.92913C7.69157 8.99369 7.53996 9.12117 7.44531 9.28828C7.35196 9.47467 7.31578 9.6845 7.34132 9.89139C7.36791 10.9234 7.55437 11.9449 7.89404 12.9198C8.45396 14.5075 10.3737 17.008 11.8591 17.06C13.2749 17.008 15.2642 14.5075 15.8241 12.9198C16.1642 11.9455 16.3512 10.9245 16.3784 9.89299C16.404 9.6861 16.3678 9.47627 16.2745 9.28988C16.1794 9.12247 16.0272 8.99495 15.8457 8.93073L12.0847 7.38855C12.0484 7.37415 12.0113 7.36213 11.9735 7.35255Z' fill='white'/%3e%3cpath d='M11.8631 8.29559L8.22357 9.77059V10.8904L11.8631 9.33705L15.5025 10.8904V9.77059L11.8631 8.29559Z' fill='white'/%3e%3cpath d='M10.6184 15.718C10.7942 16.0092 11.3957 16.4678 11.8633 16.4774C12.3078 16.4678 12.9324 16.0092 13.108 15.718C13.2835 15.4268 10.4426 15.427 10.6184 15.718Z' fill='white'/%3e%3c/svg%3e";
|
|
3099
|
+
|
|
3100
|
+
var img = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='-8 -8 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M19.7521 0.348161H20.3976V2.23694H20.7722L20.7752 0.351063H21.4208V0.00290065L19.7521 0V0.348161Z' fill='%232B2B2B'/%3e %3cpath d='M22.31 0.00290065H21.7223V2.23114H22.0785L22.0816 0.438104H22.0877L22.718 2.23404H22.9799L23.6224 0.441005H23.6285L23.6255 2.23404H23.997L24 0.00290065H23.4093L22.8642 1.58994H22.8551L22.31 0.00290065Z' fill='%232B2B2B'/%3e %3cpath d='M16.4863 0C15.3048 0 14.5435 0.713733 14.5435 1.81915L14.5374 8.1557C13.3194 6.89362 11.4893 6.20309 9.34245 6.20019C4.36976 6.19729 0.00609663 10.3636 6.37628e-06 15.1219C-0.00608387 19.8453 4.35149 23.9942 9.32114 24C11.5258 24.0029 13.5904 22.9207 14.6836 21.853C14.8968 23.0135 15.6306 23.6489 16.7726 23.6489C17.7165 23.6489 18.4017 22.9584 18.4047 22.0068L18.4291 1.82495C18.4291 0.734042 17.6496 0.00290135 16.4863 0ZM9.28764 20.0803C6.42218 20.0774 4.08961 17.852 4.09266 15.1161C4.0957 12.383 6.43131 10.1605 9.29677 10.1634C12.1622 10.1663 14.4948 12.3917 14.4918 15.1277C14.4887 17.8607 12.1531 20.0832 9.28764 20.0803Z' fill='%232B2B2B'/%3e %3cpath d='M9.29431 11.7998C7.3363 11.7998 5.74979 13.3143 5.74979 15.1799C5.74979 17.0455 7.3363 18.56 9.29431 18.56C11.2523 18.56 12.8419 17.0455 12.8419 15.1799C12.8419 13.3143 11.2523 11.7998 9.29431 11.7998Z' fill='%23517934'/%3e%3c/svg%3e";
|
|
3101
|
+
|
|
3102
|
+
// Takes a appType name and returns its logo as a data url.
|
|
3103
|
+
// If appType does not exist the Digital.ai logo is returned.
|
|
3104
|
+
const getLogoForAppType = appType => {
|
|
3105
|
+
switch (appType) {
|
|
3106
|
+
case 'Release':
|
|
3107
|
+
{
|
|
3108
|
+
return img$6;
|
|
3109
|
+
}
|
|
3110
|
+
case 'Deploy':
|
|
3111
|
+
{
|
|
3112
|
+
return img$5;
|
|
3113
|
+
}
|
|
3114
|
+
case 'Agility':
|
|
3115
|
+
{
|
|
3116
|
+
return img$4;
|
|
3117
|
+
}
|
|
3118
|
+
case 'Continuous Testing':
|
|
3119
|
+
{
|
|
3120
|
+
return img$3;
|
|
3121
|
+
}
|
|
3122
|
+
case 'Intelligence':
|
|
3123
|
+
{
|
|
3124
|
+
return img$2;
|
|
3125
|
+
}
|
|
3126
|
+
case 'Application Protection':
|
|
3127
|
+
{
|
|
3128
|
+
return img$1;
|
|
3129
|
+
}
|
|
3130
|
+
default:
|
|
3131
|
+
{
|
|
3132
|
+
return img;
|
|
3133
|
+
}
|
|
3134
|
+
}
|
|
3135
|
+
};
|
|
3136
|
+
const daiAppsHeaderMenuItem = (count = 0) => {
|
|
3137
|
+
return sectionHeaderMenuItem('DIGITAL.AI APPLICATIONS', count, true);
|
|
3138
|
+
};
|
|
3139
|
+
const sectionHeaderMenuItem = (title, count, showEmpty = false) => {
|
|
3140
|
+
const children = showEmpty || count > 0 ? jsxs(DotTypography, Object.assign({
|
|
3141
|
+
className: "dai-apps-title"
|
|
3142
|
+
}, {
|
|
3143
|
+
children: [title, count > 0 ? ` (${count})` : '']
|
|
3144
|
+
}), `menu-item-section-title-${title}`) : null;
|
|
3145
|
+
return {
|
|
3146
|
+
children,
|
|
3147
|
+
key: `dai-apps-section-header-${title}`
|
|
3148
|
+
};
|
|
3149
|
+
};
|
|
3150
|
+
const createMenuItem = (url, title, subtitle, onClick) => jsxs("div", Object.assign({
|
|
3151
|
+
className: "app-menu-item"
|
|
3152
|
+
}, {
|
|
3153
|
+
children: [jsx(DotLink, Object.assign({
|
|
3154
|
+
href: url,
|
|
3155
|
+
color: "textPrimary",
|
|
3156
|
+
target: "_blank",
|
|
3157
|
+
onClick: onClick,
|
|
3158
|
+
onPointerDown: onClick
|
|
3159
|
+
}, {
|
|
3160
|
+
children: jsxs("div", Object.assign({
|
|
3161
|
+
className: "logo-title"
|
|
3162
|
+
}, {
|
|
3163
|
+
children: [jsx(DotIcon, {
|
|
3164
|
+
iconId: "open-new-tab"
|
|
3165
|
+
}, void 0), jsxs("div", Object.assign({
|
|
3166
|
+
className: "dot-app-switcher-app-title"
|
|
3167
|
+
}, {
|
|
3168
|
+
children: [jsx(DotTypography, Object.assign({
|
|
3169
|
+
variant: "body1"
|
|
3170
|
+
}, {
|
|
3171
|
+
children: title
|
|
3172
|
+
}), void 0), subtitle && jsx(DotTypography, Object.assign({
|
|
3173
|
+
variant: "body2"
|
|
3174
|
+
}, {
|
|
3175
|
+
children: subtitle
|
|
3176
|
+
}), void 0)]
|
|
3177
|
+
}), void 0)]
|
|
3178
|
+
}), void 0)
|
|
3179
|
+
}), void 0), jsx(DotCopyButton, {
|
|
3180
|
+
copyTooltip: "Copy application URL",
|
|
3181
|
+
value: url
|
|
3182
|
+
}, void 0)]
|
|
3183
|
+
}), `app-menu-item-${title}`);
|
|
3184
|
+
const createTopLevelMenuItem = (url, logo, title, openNewTab = true) => {
|
|
3185
|
+
// Creates an entry in the AppSwitcher at the same level as the AppTypeLabels, used for the Platform link and
|
|
3186
|
+
// Empty state current application link
|
|
3187
|
+
const target = openNewTab ? '_blank' : '_self';
|
|
3188
|
+
return jsxs(DotLink, Object.assign({
|
|
3189
|
+
href: url,
|
|
3190
|
+
color: "textPrimary",
|
|
3191
|
+
target: target
|
|
3192
|
+
}, {
|
|
3193
|
+
children: [jsxs("div", Object.assign({
|
|
3194
|
+
className: "logo-title"
|
|
3195
|
+
}, {
|
|
3196
|
+
children: [jsx(DotAvatar, {
|
|
3197
|
+
alt: "app image",
|
|
3198
|
+
imageSrc: logo,
|
|
3199
|
+
type: "image",
|
|
3200
|
+
variant: "circular"
|
|
3201
|
+
}, void 0), jsx("div", Object.assign({
|
|
3202
|
+
className: "dot-app-switcher-app-title"
|
|
3203
|
+
}, {
|
|
3204
|
+
children: jsx(DotTypography, Object.assign({
|
|
3205
|
+
variant: "body1"
|
|
3206
|
+
}, {
|
|
3207
|
+
children: title
|
|
3208
|
+
}), void 0)
|
|
3209
|
+
}), void 0)]
|
|
3210
|
+
}), void 0), openNewTab && jsx(DotIcon, {
|
|
3211
|
+
iconId: "open-new-tab"
|
|
3212
|
+
}, void 0)]
|
|
3213
|
+
}), `top-menu-item-${title}`);
|
|
3214
|
+
};
|
|
3215
|
+
const createAppTypeLabel = (appTypeName, logo, appProps) => {
|
|
3216
|
+
const logoProps = logo ? {
|
|
3217
|
+
imageSrc: logo
|
|
3218
|
+
} : {
|
|
3219
|
+
iconId: 'collection'
|
|
3220
|
+
};
|
|
3221
|
+
return jsxs("div", Object.assign({
|
|
3222
|
+
className: "logo-title"
|
|
3223
|
+
}, {
|
|
3224
|
+
children: [jsx(DotAvatar, Object.assign({}, logoProps, {
|
|
3225
|
+
alt: "app image",
|
|
3226
|
+
type: "image",
|
|
3227
|
+
variant: "circular"
|
|
3228
|
+
}), void 0), jsxs("div", Object.assign({
|
|
3229
|
+
className: "dot-app-switcher-app-title"
|
|
3230
|
+
}, {
|
|
3231
|
+
children: [jsx(DotTypography, Object.assign({
|
|
3232
|
+
variant: "body1"
|
|
3233
|
+
}, {
|
|
3234
|
+
children: appTypeName
|
|
3235
|
+
}), void 0), jsxs(DotTypography, Object.assign({
|
|
3236
|
+
variant: "body2"
|
|
3237
|
+
}, {
|
|
3238
|
+
children: ["Instance (", appProps.length, ")"]
|
|
3239
|
+
}), void 0)]
|
|
3240
|
+
}), void 0)]
|
|
3241
|
+
}), void 0);
|
|
3242
|
+
};
|
|
3243
|
+
const getInstanceStateText = application => {
|
|
3244
|
+
if (application.instance_state === 1) {
|
|
3245
|
+
return 'Production instance';
|
|
3246
|
+
}
|
|
3247
|
+
return 'Non-production instance';
|
|
3248
|
+
};
|
|
3249
|
+
const sortRecentAppInstancesFn = (a, b) => {
|
|
3250
|
+
const appA = a.application;
|
|
3251
|
+
const appB = b.application;
|
|
3252
|
+
return sortAppInstancesFn(appA, appB);
|
|
3253
|
+
};
|
|
3254
|
+
const sortAppInstancesFn = (a, b) => {
|
|
3255
|
+
let result = a.name.localeCompare(b.name);
|
|
3256
|
+
if (result === 0) {
|
|
3257
|
+
if (a.instance_state > b.instance_state) {
|
|
3258
|
+
result = -1;
|
|
3259
|
+
} else if (a.instance_state < b.instance_state) {
|
|
3260
|
+
result = 1;
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
return result;
|
|
3264
|
+
};
|
|
3265
|
+
const RECENT_INSTANCES_KEY = 'dot-app-switcher-recent-app-instances';
|
|
3266
|
+
const recentAppInstancesSetter = (latestInstance, maxRecentItems
|
|
3267
|
+
//): (RecentAppInstance[]) => RecentAppInstance[])=> {
|
|
3268
|
+
) => {
|
|
3269
|
+
return orig => {
|
|
3270
|
+
const lastAccess = Date.now();
|
|
3271
|
+
let isNew = true;
|
|
3272
|
+
let oldestIndex = 0;
|
|
3273
|
+
let oldestAccess = lastAccess;
|
|
3274
|
+
orig.forEach((item, index) => {
|
|
3275
|
+
if (item.application.id === latestInstance.id) {
|
|
3276
|
+
isNew = false;
|
|
3277
|
+
// don't need to rerender so eventually returning orig
|
|
3278
|
+
item.lastAccess = lastAccess;
|
|
3279
|
+
}
|
|
3280
|
+
if (item.lastAccess < oldestAccess) {
|
|
3281
|
+
oldestIndex = index;
|
|
3282
|
+
oldestAccess = item.lastAccess;
|
|
3283
|
+
}
|
|
3284
|
+
});
|
|
3285
|
+
if (isNew) {
|
|
3286
|
+
const newRecentItem = {
|
|
3287
|
+
application: latestInstance,
|
|
3288
|
+
lastAccess
|
|
3289
|
+
};
|
|
3290
|
+
let newRecent;
|
|
3291
|
+
if (orig.length >= maxRecentItems) {
|
|
3292
|
+
newRecent = [...orig];
|
|
3293
|
+
newRecent.splice(oldestIndex, 1, newRecentItem);
|
|
3294
|
+
} else {
|
|
3295
|
+
newRecent = [...orig, newRecentItem];
|
|
3296
|
+
}
|
|
3297
|
+
newRecent.sort(sortRecentAppInstancesFn);
|
|
3298
|
+
localStorage.setItem(RECENT_INSTANCES_KEY, JSON.stringify(newRecent));
|
|
3299
|
+
return newRecent;
|
|
3300
|
+
}
|
|
3301
|
+
return orig;
|
|
3302
|
+
};
|
|
3303
|
+
};
|
|
3304
|
+
|
|
3305
|
+
const rootClassName$K = 'dot-app-switcher';
|
|
3306
|
+
const StyledAppSwitcher = styled(DotDrawer).withConfig({
|
|
3307
|
+
displayName: "AppSwitcherstyles__StyledAppSwitcher",
|
|
3308
|
+
componentId: "hhxfqg-0"
|
|
3309
|
+
})(["", ""], ({
|
|
3310
|
+
theme
|
|
3311
|
+
}) => css(["&.", "{.dot-drawer-paper{padding:0;}.content{padding:", ";overflow-y:auto;}.app-menu-item{display:flex;justify-content:space-between;align-items:center;}.dot-link,.product-menu-item{display:flex;justify-content:space-between;align-items:center;width:100%;height:60px;text-decoration:none;cursor:pointer;}.logo-title{display:flex;align-items:center;gap:24px;width:100%;}.dot-avatar{flex-basis:40px;}.dai-apps-title{display:flex;align-items:center;height:32px;padding:", ";margin-top:", ";background-color:", ";}.dot-app-switcher-app-title{min-width:150px;}.dot-icon{flex-basis:content;}.app-switcher-header{.app-switcher-header-title{display:flex;align-items:center;}display:flex;justify-content:space-between;align-items:end;border-bottom:1px solid ", ";padding:", ";.app-switcher-label{padding-left:", ";}}.app-switcher-back-button{&.dot-button.MuiButton-text{padding-left:0;}}.product-heading{display:flex;align-items:center;gap:24px;padding-bottom:", ";}.product-applications{width:100%;}.product-applications-search{margin-bottom:", ";}}"], rootClassName$K, theme.spacing(0, 2, 1, 2), theme.spacing(0, 0, 0, 1), theme.spacing(1), theme.palette.grey[50], theme.palette.grey[200], theme.spacing(0, 2, 1, 2), theme.spacing(3), theme.spacing(3), theme.spacing(3)));
|
|
3312
|
+
|
|
3313
|
+
const DotAppSwitcherView = ({
|
|
3314
|
+
activeApp,
|
|
3315
|
+
apps,
|
|
3316
|
+
className,
|
|
3317
|
+
maxRecentInstances: _maxRecentInstances = 5,
|
|
3318
|
+
noAppTypeLabel: _noAppTypeLabel = 'Other',
|
|
3319
|
+
platformConsoleUrl,
|
|
3320
|
+
onClose,
|
|
3321
|
+
open,
|
|
3322
|
+
searchInstancesThreshold: _searchInstancesThreshold = 5,
|
|
3323
|
+
selectedAppType,
|
|
3324
|
+
yOffset: _yOffset = 64,
|
|
3325
|
+
zIndex: _zIndex = 990
|
|
3326
|
+
}) => {
|
|
3327
|
+
const dotCoreApiContext = useDotCoreApiContext();
|
|
3328
|
+
let setSelectedAppType = null;
|
|
3329
|
+
if (dotCoreApiContext !== null) {
|
|
3330
|
+
setSelectedAppType = dotCoreApiContext.setSelectedAppSwitcherAppType;
|
|
3331
|
+
}
|
|
3332
|
+
const rootClasses = useStylesWithRootClass(rootClassName$K, className);
|
|
3333
|
+
const [appTypeMap, setAppTypeMap] = useState();
|
|
3334
|
+
const [appTypeLabels, setAppTypeLabels] = useState();
|
|
3335
|
+
const [appTypeMenuItems, setAppTypeMenuItems] = useState();
|
|
3336
|
+
const [selectedAppTypeAlt, setSelectedAppTypeAlt] = useState(null);
|
|
3337
|
+
const [searchText, setSearchText] = useState('');
|
|
3338
|
+
const cachedRecentItemsJson = localStorage.getItem(RECENT_INSTANCES_KEY);
|
|
3339
|
+
const [recentAppInstances, setRecentAppInstances] = useState(cachedRecentItemsJson ? JSON.parse(cachedRecentItemsJson) : []);
|
|
3340
|
+
if (!setSelectedAppType) {
|
|
3341
|
+
selectedAppType = selectedAppTypeAlt;
|
|
3342
|
+
setSelectedAppType = setSelectedAppTypeAlt;
|
|
3343
|
+
}
|
|
3344
|
+
const showApps = useCallback(appType => {
|
|
3345
|
+
setSelectedAppType(appType);
|
|
3346
|
+
}, []);
|
|
3347
|
+
const showAppTypes = useCallback(() => {
|
|
3348
|
+
setSearchText('');
|
|
3349
|
+
setSelectedAppType(null);
|
|
3350
|
+
}, []);
|
|
3351
|
+
const populateAppTypeMap = useCallback(() => {
|
|
3352
|
+
const newAppTypeMap = new Map();
|
|
3353
|
+
// we'll put Other at the end
|
|
3354
|
+
const otherApps = [];
|
|
3355
|
+
apps === null || apps === void 0 ? void 0 : apps.forEach(app => {
|
|
3356
|
+
const instanceStateText = getInstanceStateText(app);
|
|
3357
|
+
const children = createMenuItem(app.url, app.name, instanceStateText, e => {
|
|
3358
|
+
handleRecentInstance(e, app);
|
|
3359
|
+
});
|
|
3360
|
+
const searchableContent = `${app.name} ${instanceStateText}`;
|
|
3361
|
+
const appTypeName = app.logo_product_name;
|
|
3362
|
+
let appTypeApps;
|
|
3363
|
+
if (appTypeName) {
|
|
3364
|
+
appTypeApps = newAppTypeMap.get(appTypeName);
|
|
3365
|
+
if (!appTypeApps) {
|
|
3366
|
+
appTypeApps = [];
|
|
3367
|
+
newAppTypeMap.set(appTypeName, appTypeApps);
|
|
3368
|
+
}
|
|
3369
|
+
} else {
|
|
3370
|
+
appTypeApps = otherApps;
|
|
3371
|
+
}
|
|
3372
|
+
appTypeApps.push({
|
|
3373
|
+
application: app,
|
|
3374
|
+
children,
|
|
3375
|
+
searchableContent,
|
|
3376
|
+
key: app.id
|
|
3377
|
+
});
|
|
3378
|
+
});
|
|
3379
|
+
const keys = Array.from(newAppTypeMap.keys()).sort();
|
|
3380
|
+
const sortedAppTypeMap = new Map();
|
|
3381
|
+
for (const appType of keys) {
|
|
3382
|
+
const appTypeApps = newAppTypeMap.get(appType);
|
|
3383
|
+
appTypeApps.sort((a, b) => {
|
|
3384
|
+
return sortAppInstancesFn(a.application, b.application);
|
|
3385
|
+
});
|
|
3386
|
+
sortedAppTypeMap.set(appType, appTypeApps);
|
|
3387
|
+
}
|
|
3388
|
+
let appTypeCount = sortedAppTypeMap.size;
|
|
3389
|
+
if (platformConsoleUrl) {
|
|
3390
|
+
appTypeCount++;
|
|
3391
|
+
}
|
|
3392
|
+
if (otherApps.length > 0) {
|
|
3393
|
+
otherApps.sort((a, b) => {
|
|
3394
|
+
return sortAppInstancesFn(a.application, b.application);
|
|
3395
|
+
});
|
|
3396
|
+
sortedAppTypeMap.set(_noAppTypeLabel, otherApps);
|
|
3397
|
+
}
|
|
3398
|
+
setAppTypeMap(sortedAppTypeMap);
|
|
3399
|
+
const menuItems = [daiAppsHeaderMenuItem(appTypeCount)];
|
|
3400
|
+
if (platformConsoleUrl) {
|
|
3401
|
+
const children = createTopLevelMenuItem(platformConsoleUrl, getLogoForAppType('Platform'), 'Digital.ai Platform', !window.location.href.startsWith(platformConsoleUrl));
|
|
3402
|
+
menuItems.push({
|
|
3403
|
+
children,
|
|
3404
|
+
key: 'app-switcher-platform-link'
|
|
3405
|
+
});
|
|
3406
|
+
}
|
|
3407
|
+
const newAppTypeLabels = new Map();
|
|
3408
|
+
sortedAppTypeMap.forEach((singleTypeApps, appTypeName) => {
|
|
3409
|
+
if ((singleTypeApps === null || singleTypeApps === void 0 ? void 0 : singleTypeApps.length) > 0) {
|
|
3410
|
+
const logo = appTypeName === _noAppTypeLabel ? null : getLogoForAppType(appTypeName);
|
|
3411
|
+
newAppTypeLabels.set(appTypeName, {
|
|
3412
|
+
logo,
|
|
3413
|
+
singleTypeApps
|
|
3414
|
+
});
|
|
3415
|
+
menuItems.push({
|
|
3416
|
+
children: jsxs("div", Object.assign({
|
|
3417
|
+
className: "product-menu-item",
|
|
3418
|
+
onClick: () => showApps(appTypeName),
|
|
3419
|
+
tabIndex: 0
|
|
3420
|
+
}, {
|
|
3421
|
+
children: [createAppTypeLabel(appTypeName, logo, singleTypeApps), jsx(DotIcon, {
|
|
3422
|
+
iconId: "chevron-right"
|
|
3423
|
+
}, void 0)]
|
|
3424
|
+
}), `menu-item-${appTypeName}`),
|
|
3425
|
+
key: appTypeName
|
|
3426
|
+
});
|
|
3427
|
+
}
|
|
3428
|
+
});
|
|
3429
|
+
setAppTypeMenuItems(menuItems);
|
|
3430
|
+
setAppTypeLabels(newAppTypeLabels);
|
|
3431
|
+
}, [apps]);
|
|
3432
|
+
const emptyState = useCallback(() => {
|
|
3433
|
+
const currentAppMenuItem = createTopLevelMenuItem(window.location.href, getLogoForAppType(activeApp.product), activeApp.name, false);
|
|
3434
|
+
setAppTypeMenuItems([daiAppsHeaderMenuItem(), {
|
|
3435
|
+
children: currentAppMenuItem,
|
|
3436
|
+
key: 'no_applications_configured'
|
|
3437
|
+
}]);
|
|
3438
|
+
}, [activeApp]);
|
|
3439
|
+
useEffect(() => {
|
|
3440
|
+
if ((apps === null || apps === void 0 ? void 0 : apps.length) > 0) {
|
|
3441
|
+
populateAppTypeMap();
|
|
3442
|
+
} else {
|
|
3443
|
+
emptyState();
|
|
3444
|
+
}
|
|
3445
|
+
}, [apps]);
|
|
3446
|
+
const onAppInstanceSearchTextChange = useCallback(text => {
|
|
3447
|
+
setSearchText(text);
|
|
3448
|
+
}, []);
|
|
3449
|
+
const clearAppInstanceSearchText = useCallback(() => {
|
|
3450
|
+
setSearchText('');
|
|
3451
|
+
}, []);
|
|
3452
|
+
const closeHandler = useCallback(event => {
|
|
3453
|
+
setSearchText('');
|
|
3454
|
+
onClose && onClose(event);
|
|
3455
|
+
}, [onClose]);
|
|
3456
|
+
const filteredAppInstances = useCallback(() => {
|
|
3457
|
+
var _a;
|
|
3458
|
+
return (_a = appTypeMap.get(selectedAppType)) === null || _a === void 0 ? void 0 : _a.filter(item => {
|
|
3459
|
+
let isMatch = !searchText;
|
|
3460
|
+
if (searchText) {
|
|
3461
|
+
const testStr = isLowerCase(searchText) ? item.searchableContent.toLowerCase() : item.searchableContent;
|
|
3462
|
+
isMatch = testStr.indexOf(searchText) >= 0;
|
|
3463
|
+
}
|
|
3464
|
+
return isMatch;
|
|
3465
|
+
}).map(item => item.children);
|
|
3466
|
+
}, [appTypeMap, selectedAppType, searchText]);
|
|
3467
|
+
const handleRecentInstance = useCallback((event, latestInstance) => {
|
|
3468
|
+
// middle button counts; click to open context menu does not
|
|
3469
|
+
if (event.button < 2) {
|
|
3470
|
+
setRecentAppInstances(recentAppInstancesSetter(latestInstance, _maxRecentInstances));
|
|
3471
|
+
}
|
|
3472
|
+
}, [recentAppInstances]);
|
|
3473
|
+
const recentAppInstancesSection = jsxs(Fragment$1, {
|
|
3474
|
+
children: [sectionHeaderMenuItem('RECENT', recentAppInstances.length).children, jsx("div", Object.assign({
|
|
3475
|
+
className: "product-applications"
|
|
3476
|
+
}, {
|
|
3477
|
+
children: recentAppInstances.map(item => {
|
|
3478
|
+
const app = item.application;
|
|
3479
|
+
return createMenuItem(app.url, app.name, getInstanceStateText(app), e => {
|
|
3480
|
+
handleRecentInstance(e, app);
|
|
3481
|
+
});
|
|
3482
|
+
})
|
|
3483
|
+
}), void 0)]
|
|
3484
|
+
}, void 0);
|
|
3485
|
+
const content = () => {
|
|
3486
|
+
var _a;
|
|
3487
|
+
if (selectedAppType && appTypeMap && appTypeLabels) {
|
|
3488
|
+
const labelConfig = appTypeLabels.get(selectedAppType);
|
|
3489
|
+
return jsxs("div", Object.assign({
|
|
3490
|
+
className: "content"
|
|
3491
|
+
}, {
|
|
3492
|
+
children: [jsx("span", {
|
|
3493
|
+
children: jsx(DotButton, Object.assign({
|
|
3494
|
+
className: "app-switcher-back-button",
|
|
3495
|
+
type: "text",
|
|
3496
|
+
onClick: showAppTypes,
|
|
3497
|
+
startIcon: jsx(DotIcon, {
|
|
3498
|
+
iconId: "back"
|
|
3499
|
+
}, void 0)
|
|
3500
|
+
}, {
|
|
3501
|
+
children: jsx("span", {
|
|
3502
|
+
children: "Back"
|
|
3503
|
+
}, void 0)
|
|
3504
|
+
}), void 0)
|
|
3505
|
+
}, void 0), jsx("div", Object.assign({
|
|
3506
|
+
className: "product-heading"
|
|
3507
|
+
}, {
|
|
3508
|
+
children: createAppTypeLabel(selectedAppType, labelConfig.logo, labelConfig.singleTypeApps)
|
|
3509
|
+
}), void 0), ((_a = appTypeMap === null || appTypeMap === void 0 ? void 0 : appTypeMap.get(selectedAppType)) === null || _a === void 0 ? void 0 : _a.length) >= _searchInstancesThreshold && jsx("div", {
|
|
3510
|
+
children: jsx(SearchInput, {
|
|
3511
|
+
"data-testid": "app-instance-search-input",
|
|
3512
|
+
onChange: onAppInstanceSearchTextChange,
|
|
3513
|
+
onClear: clearAppInstanceSearchText,
|
|
3514
|
+
value: searchText
|
|
3515
|
+
}, void 0)
|
|
3516
|
+
}, void 0), jsx("div", Object.assign({
|
|
3517
|
+
className: "product-applications"
|
|
3518
|
+
}, {
|
|
3519
|
+
children: filteredAppInstances()
|
|
3520
|
+
}), void 0)]
|
|
3521
|
+
}), void 0);
|
|
3522
|
+
} else {
|
|
3523
|
+
return jsxs("div", Object.assign({
|
|
3524
|
+
className: "content"
|
|
3525
|
+
}, {
|
|
3526
|
+
children: [jsx(DotList, {
|
|
3527
|
+
items: appTypeMenuItems === null || appTypeMenuItems === void 0 ? void 0 : appTypeMenuItems.map(item => ({
|
|
3528
|
+
child: item.children
|
|
3529
|
+
})),
|
|
3530
|
+
width: "100%"
|
|
3531
|
+
}, void 0), recentAppInstancesSection]
|
|
3532
|
+
}), void 0);
|
|
3366
3533
|
}
|
|
3367
|
-
return endIcon;
|
|
3368
3534
|
};
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3535
|
+
const header = {
|
|
3536
|
+
className: 'app-switcher-header',
|
|
3537
|
+
children: jsxs("div", Object.assign({
|
|
3538
|
+
className: "app-switcher-header-title",
|
|
3539
|
+
style: {
|
|
3540
|
+
marginTop: _yOffset + 'px',
|
|
3541
|
+
width: '80%'
|
|
3542
|
+
}
|
|
3374
3543
|
}, {
|
|
3375
|
-
children:
|
|
3376
|
-
"
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
"data-testid": dataTestId,
|
|
3383
|
-
divider: _divider,
|
|
3384
|
-
href: onClick ? null : href,
|
|
3385
|
-
onClick: onClick || !href ? handleClick : null,
|
|
3386
|
-
selected: isFlyout ? isOpened : selected,
|
|
3387
|
-
target: target
|
|
3544
|
+
children: [jsx(DotAvatar, {
|
|
3545
|
+
iconId: "apps",
|
|
3546
|
+
alt: "app image",
|
|
3547
|
+
type: "image",
|
|
3548
|
+
variant: "circular"
|
|
3549
|
+
}, void 0), jsx(DotTypography, Object.assign({
|
|
3550
|
+
className: "app-switcher-label"
|
|
3388
3551
|
}, {
|
|
3389
|
-
children:
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
}, void 0);
|
|
3552
|
+
children: "App switcher"
|
|
3553
|
+
}), void 0)]
|
|
3554
|
+
}), void 0)
|
|
3555
|
+
};
|
|
3556
|
+
return jsx(StyledAppSwitcher, Object.assign({
|
|
3557
|
+
className: rootClasses,
|
|
3558
|
+
ModalProps: {
|
|
3559
|
+
style: {
|
|
3560
|
+
zIndex: _zIndex
|
|
3561
|
+
},
|
|
3562
|
+
hideBackdrop: true
|
|
3563
|
+
},
|
|
3564
|
+
drawerHeaderProps: header,
|
|
3565
|
+
variant: "temporary",
|
|
3566
|
+
width: "340px",
|
|
3567
|
+
open: open,
|
|
3568
|
+
onClose: closeHandler
|
|
3569
|
+
}, {
|
|
3570
|
+
children: content()
|
|
3571
|
+
}), void 0);
|
|
3409
3572
|
};
|
|
3410
|
-
const
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
disablePadding: true,
|
|
3436
|
-
items: items
|
|
3437
|
-
}, parentItemIndex)
|
|
3438
|
-
}), void 0);
|
|
3439
|
-
}
|
|
3440
|
-
if (type === 'menu') {
|
|
3441
|
-
const menuItems = items.map((item, index) => {
|
|
3442
|
-
const {
|
|
3443
|
-
href,
|
|
3444
|
-
target,
|
|
3445
|
-
onClick,
|
|
3446
|
-
tooltip,
|
|
3447
|
-
tooltipPlacement = DEFAULT_TOOLTIP_PLACEMENT,
|
|
3448
|
-
text
|
|
3449
|
-
} = item;
|
|
3450
|
-
return {
|
|
3451
|
-
children: jsx(DotTooltip, Object.assign({
|
|
3452
|
-
placement: tooltipPlacement,
|
|
3453
|
-
title: tooltip
|
|
3454
|
-
}, {
|
|
3455
|
-
children: jsx(StyledListItem, Object.assign({
|
|
3456
|
-
className: flyoutItemClasses,
|
|
3457
|
-
component: href && !onClick ? 'a' : null,
|
|
3458
|
-
"data-testid": `${dataTestId}-item-${index}`,
|
|
3459
|
-
href: href,
|
|
3460
|
-
onClick: onClick,
|
|
3461
|
-
target: target
|
|
3462
|
-
}, {
|
|
3463
|
-
children: jsxs("span", Object.assign({
|
|
3464
|
-
className: flyoutSpanClasses
|
|
3465
|
-
}, {
|
|
3466
|
-
children: [item.startIcon, jsx(DotTypography, Object.assign({
|
|
3467
|
-
variant: "body1"
|
|
3468
|
-
}, {
|
|
3469
|
-
children: text
|
|
3470
|
-
}), void 0)]
|
|
3471
|
-
}), void 0)
|
|
3472
|
-
}), `${parentItemIndex}-${index}`)
|
|
3473
|
-
}), `${parentItemIndex}-${index}-tooltip`),
|
|
3474
|
-
classes: '',
|
|
3475
|
-
key: String(index)
|
|
3476
|
-
};
|
|
3477
|
-
});
|
|
3478
|
-
return jsx(DotMenu, {
|
|
3479
|
-
anchorEl: anchorEl,
|
|
3480
|
-
ariaLabel: ariaLabel,
|
|
3481
|
-
className: flyoutMenuClassName,
|
|
3482
|
-
"data-testid": dataTestId,
|
|
3483
|
-
id: CreateUUID(),
|
|
3484
|
-
menuItemHeight: "auto",
|
|
3485
|
-
menuItems: menuItems,
|
|
3486
|
-
menuPlacement: menuPlacement,
|
|
3487
|
-
onLeave: onMenuLeave,
|
|
3488
|
-
open: open
|
|
3489
|
-
}, parentItemIndex);
|
|
3573
|
+
const DotAppSwitcher = _a => {
|
|
3574
|
+
var {
|
|
3575
|
+
accountId,
|
|
3576
|
+
includePlatformConsole = true,
|
|
3577
|
+
onClose
|
|
3578
|
+
} = _a,
|
|
3579
|
+
commonProps = __rest(_a, ["accountId", "includePlatformConsole", "onClose"]);
|
|
3580
|
+
const {
|
|
3581
|
+
applications,
|
|
3582
|
+
applicationsLoading,
|
|
3583
|
+
applicationsError,
|
|
3584
|
+
loadApplications,
|
|
3585
|
+
isAppSwitcherOpen: open,
|
|
3586
|
+
platformConsoleUrl,
|
|
3587
|
+
setIsAppSwitcherOpen: setOpen,
|
|
3588
|
+
selectedAppSwitcherAppType: selectedAppType,
|
|
3589
|
+
setSelectedAppSwitcherAppType: setSelectedAppType
|
|
3590
|
+
} = useDotCoreApiContext();
|
|
3591
|
+
useEffect(() => {
|
|
3592
|
+
if ((!applications || applications.length === 0) && open) {
|
|
3593
|
+
loadApplications(accountId);
|
|
3594
|
+
}
|
|
3595
|
+
}, [accountId, open]);
|
|
3596
|
+
if (applicationsError) {
|
|
3597
|
+
console.error('Error loading application list in AppSwitcher', applicationsError);
|
|
3490
3598
|
}
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3599
|
+
const closeHandler = useCallback(event => {
|
|
3600
|
+
setOpen(false);
|
|
3601
|
+
setSelectedAppType(null);
|
|
3602
|
+
onClose && onClose(event);
|
|
3603
|
+
}, [onClose]);
|
|
3604
|
+
const viewProps = includePlatformConsole ? Object.assign(Object.assign({}, commonProps), {
|
|
3605
|
+
platformConsoleUrl
|
|
3606
|
+
}) : Object.assign({}, commonProps);
|
|
3607
|
+
if (!applicationsLoading && !applicationsError) {
|
|
3608
|
+
return jsx(DotAppSwitcherView, Object.assign({}, viewProps, {
|
|
3501
3609
|
open: open,
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
ariaLabel: ariaLabel,
|
|
3506
|
-
className: nestedListClassName,
|
|
3507
|
-
component: "div",
|
|
3508
|
-
"data-testid": dataTestId,
|
|
3509
|
-
disablePadding: true,
|
|
3510
|
-
items: items,
|
|
3511
|
-
width: '100%'
|
|
3512
|
-
}, parentItemIndex)
|
|
3610
|
+
apps: applications,
|
|
3611
|
+
selectedAppType: selectedAppType,
|
|
3612
|
+
onClose: closeHandler
|
|
3513
3613
|
}), void 0);
|
|
3514
3614
|
}
|
|
3615
|
+
return null;
|
|
3515
3616
|
};
|
|
3516
3617
|
|
|
3517
3618
|
var _path$2, _path2$2, _path3, _path4;
|
|
@@ -3702,7 +3803,7 @@ const Header = ({
|
|
|
3702
3803
|
appLogo: appLogo,
|
|
3703
3804
|
appLogoSmall: appLogoSmall,
|
|
3704
3805
|
smallOnly: !isOpen
|
|
3705
|
-
}, void 0) : jsxs(Fragment, {
|
|
3806
|
+
}, void 0) : jsxs(Fragment$1, {
|
|
3706
3807
|
children: [jsx(DotAvatar, Object.assign({}, titleAvatarProps), void 0), isOpen && jsx(DotTypography, Object.assign({
|
|
3707
3808
|
variant: "h4"
|
|
3708
3809
|
}, {
|
|
@@ -3965,7 +4066,7 @@ const DotAppToolbar = ({
|
|
|
3965
4066
|
borderBottomColor: borderColor
|
|
3966
4067
|
}
|
|
3967
4068
|
}, {
|
|
3968
|
-
children: [showMainMenu && jsxs(Fragment, {
|
|
4069
|
+
children: [showMainMenu && jsxs(Fragment$1, {
|
|
3969
4070
|
children: [jsx("div", Object.assign({
|
|
3970
4071
|
className: "dot-main-menu-btn"
|
|
3971
4072
|
}, {
|
|
@@ -4064,7 +4165,7 @@ const StyledAutocomplete = styled(Autocomplete).withConfig({
|
|
|
4064
4165
|
componentId: "j2sgjy-0"
|
|
4065
4166
|
})(["", ""], ({
|
|
4066
4167
|
theme
|
|
4067
|
-
}) => css(["&.", "{&.", " .dot-text-field .", "{height:56px;padding-left:", ";}.", "{padding-top:", ";padding-bottom:", ";}.dot-chip:first-child{margin-left:", ";}.dot-text-field{.", "{height:", ";}.warning-icon{color:", ";}.error-icon{color:", ";}}}"], rootClassName$F, inputMediumClassName, inputRootClassName, theme.spacing(2), inputRootClassName, theme.spacing(0), theme.spacing(0), theme.spacing(0), inputRootClassName, theme.spacing(5), theme.palette.warning.main, theme.palette.error.main));
|
|
4168
|
+
}) => css(["&.", "{&.", " .dot-text-field .", "{height:56px;padding-left:", ";}.", "{padding-top:", ";padding-bottom:", ";}.dot-chip:first-child{margin-left:", ";}.dot-text-field{.", "{min-height:", ";}.warning-icon{color:", ";}.error-icon{color:", ";}}}"], rootClassName$F, inputMediumClassName, inputRootClassName, theme.spacing(2), inputRootClassName, theme.spacing(0), theme.spacing(0), theme.spacing(0), inputRootClassName, theme.spacing(5), theme.palette.warning.main, theme.palette.error.main));
|
|
4068
4169
|
|
|
4069
4170
|
const rootClassName$E = 'dot-chip';
|
|
4070
4171
|
const StyledChip = styled(Chip).withConfig({
|
|
@@ -4271,7 +4372,7 @@ const DotAutoComplete = ({
|
|
|
4271
4372
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4272
4373
|
const DotPopper = props => {
|
|
4273
4374
|
if (!isActionItemDefined) return jsx(StyledPopper, Object.assign({}, props, {
|
|
4274
|
-
className: rootClassName$
|
|
4375
|
+
className: rootClassName$V,
|
|
4275
4376
|
disablePortal: _disablePortal,
|
|
4276
4377
|
"$maxHeight": maxHeight
|
|
4277
4378
|
}), void 0);
|
|
@@ -4295,7 +4396,7 @@ const DotAutoComplete = ({
|
|
|
4295
4396
|
const paperProps = props.children.props;
|
|
4296
4397
|
const paperChildren = paperProps.children;
|
|
4297
4398
|
return jsx(StyledPopper, Object.assign({}, props, {
|
|
4298
|
-
className: rootClassName$
|
|
4399
|
+
className: rootClassName$V,
|
|
4299
4400
|
disablePortal: _disablePortal,
|
|
4300
4401
|
"$maxHeight": maxHeight
|
|
4301
4402
|
}, {
|
|
@@ -4388,7 +4489,7 @@ const DotAutoComplete = ({
|
|
|
4388
4489
|
children: icon
|
|
4389
4490
|
}), void 0) : icon;
|
|
4390
4491
|
};
|
|
4391
|
-
return jsxs(Fragment, {
|
|
4492
|
+
return jsxs(Fragment$1, {
|
|
4392
4493
|
children: [loading && jsx(DotProgress, {
|
|
4393
4494
|
color: "inherit",
|
|
4394
4495
|
size: 20
|
|
@@ -4446,7 +4547,7 @@ const DotAutoComplete = ({
|
|
|
4446
4547
|
// at least pick up any styling that is used there. Should additional
|
|
4447
4548
|
// functionality be added to DotInputText we will have to make a
|
|
4448
4549
|
// decision about if/how to expose it here.
|
|
4449
|
-
jsxs(Fragment, {
|
|
4550
|
+
jsxs(Fragment$1, {
|
|
4450
4551
|
children: [persistentLabel && jsx(DotInputLabel, Object.assign({
|
|
4451
4552
|
"data-testid": dataTestId && `${dataTestId}-persistent-label`,
|
|
4452
4553
|
id: inputId
|
|
@@ -4902,7 +5003,7 @@ const DotButtonToggle = ({
|
|
|
4902
5003
|
key,
|
|
4903
5004
|
value: optionValue
|
|
4904
5005
|
};
|
|
4905
|
-
const children = jsxs(Fragment, {
|
|
5006
|
+
const children = jsxs(Fragment$1, {
|
|
4906
5007
|
children: [optionIconId && jsx(DotIcon, {
|
|
4907
5008
|
className: "dot-toggle-icon",
|
|
4908
5009
|
iconId: optionIconId
|
|
@@ -6791,7 +6892,7 @@ const DotDynamicForm = ({
|
|
|
6791
6892
|
}
|
|
6792
6893
|
case 'custom-element':
|
|
6793
6894
|
{
|
|
6794
|
-
return jsx(Fragment
|
|
6895
|
+
return jsx(Fragment, {
|
|
6795
6896
|
children: customElement
|
|
6796
6897
|
}, elementIndex);
|
|
6797
6898
|
}
|
|
@@ -6944,13 +7045,12 @@ const DotInlineEdit = ({
|
|
|
6944
7045
|
const [showTooltip, setShowTooltip] = useState(false);
|
|
6945
7046
|
const [originalValue, setOriginalValue] = useState('');
|
|
6946
7047
|
const [inputValue, setInputValue] = useState(_value);
|
|
6947
|
-
const isNotReadOnlyOrEditing = !readOnly && !editing;
|
|
6948
7048
|
const inputRef = useRef();
|
|
6949
7049
|
const inlineEditRef = useRef();
|
|
6950
7050
|
const isSaveDisabled = checkIfEmptyValue(inputValue);
|
|
6951
7051
|
const rootClasses = useStylesWithRootClass(rootClassName$m, className, editing ? editModeClassName : '');
|
|
6952
7052
|
const handleShowTooltip = visible => {
|
|
6953
|
-
if (
|
|
7053
|
+
if (!editing) {
|
|
6954
7054
|
setShowTooltip(visible);
|
|
6955
7055
|
}
|
|
6956
7056
|
};
|
|
@@ -7021,7 +7121,7 @@ const DotInlineEdit = ({
|
|
|
7021
7121
|
};
|
|
7022
7122
|
const renderViewMode = () => {
|
|
7023
7123
|
const viewModeClasses = useStylesWithRootClass(viewModeClassName, readOnly ? readOnlyClassName : '');
|
|
7024
|
-
const viewModeChildren = jsxs(Fragment, {
|
|
7124
|
+
const viewModeChildren = jsxs(Fragment$1, {
|
|
7025
7125
|
children: [jsx(DotTypography, Object.assign({
|
|
7026
7126
|
className: "dot-view-mode-typography",
|
|
7027
7127
|
"data-testid": dataTestId && `${dataTestId}-view-mode-typography`,
|
|
@@ -7050,7 +7150,7 @@ const DotInlineEdit = ({
|
|
|
7050
7150
|
};
|
|
7051
7151
|
const renderEditMode = () => {
|
|
7052
7152
|
const textFieldClasses = useStylesWithRootClass(editTextFieldClassName, isSaveDisabled ? 'dot-empty-value' : '');
|
|
7053
|
-
return jsxs(Fragment, {
|
|
7153
|
+
return jsxs(Fragment$1, {
|
|
7054
7154
|
children: [jsx(TextField, {
|
|
7055
7155
|
InputProps: {
|
|
7056
7156
|
endAdornment: renderEndAdornment()
|
|
@@ -7484,7 +7584,7 @@ const DotSplitButton = ({
|
|
|
7484
7584
|
setOpen(false);
|
|
7485
7585
|
onOptionClick(itemKey);
|
|
7486
7586
|
};
|
|
7487
|
-
return jsxs(Fragment, {
|
|
7587
|
+
return jsxs(Fragment$1, {
|
|
7488
7588
|
children: [jsxs(StyledSplitButtonGroup, Object.assign({
|
|
7489
7589
|
"aria-label": ariaLabel,
|
|
7490
7590
|
className: rootClasses,
|
|
@@ -7924,7 +8024,7 @@ const DotTableBody = ({
|
|
|
7924
8024
|
}, index);
|
|
7925
8025
|
});
|
|
7926
8026
|
};
|
|
7927
|
-
return jsxs(Fragment, {
|
|
8027
|
+
return jsxs(Fragment$1, {
|
|
7928
8028
|
children: [jsx(StyledTableBody, Object.assign({
|
|
7929
8029
|
classes: {
|
|
7930
8030
|
root: rootClassName$a
|
|
@@ -8153,7 +8253,7 @@ const DotTableSelectionToolbar = ({
|
|
|
8153
8253
|
variant: "h3"
|
|
8154
8254
|
}, {
|
|
8155
8255
|
children: [selectedRowsNumber, " selected"]
|
|
8156
|
-
}), void 0), onClearAll && jsxs(Fragment, {
|
|
8256
|
+
}), void 0), onClearAll && jsxs(Fragment$1, {
|
|
8157
8257
|
children: [jsx(DotTypography, Object.assign({
|
|
8158
8258
|
className: "dot-selected-rows-divider"
|
|
8159
8259
|
}, {
|
|
@@ -8485,7 +8585,7 @@ const DotTableActions = ({
|
|
|
8485
8585
|
onClick: action.onClick
|
|
8486
8586
|
}, `action-${index}`));
|
|
8487
8587
|
};
|
|
8488
|
-
return jsxs(Fragment, {
|
|
8588
|
+
return jsxs(Fragment$1, {
|
|
8489
8589
|
children: [jsxs(TableActionsContainer, Object.assign({
|
|
8490
8590
|
className: rootClassName$6,
|
|
8491
8591
|
ref: wrapperRef
|
|
@@ -8679,7 +8779,7 @@ const renderSelectFilesButton = (isUploadDisabled, onButtonClick) => jsx(DotButt
|
|
|
8679
8779
|
}, {
|
|
8680
8780
|
children: "Select file(s)"
|
|
8681
8781
|
}), void 0);
|
|
8682
|
-
const renderActiveDragArea = () => jsxs(Fragment, {
|
|
8782
|
+
const renderActiveDragArea = () => jsxs(Fragment$1, {
|
|
8683
8783
|
children: [jsx(DotIcon, {
|
|
8684
8784
|
iconId: "upload-file"
|
|
8685
8785
|
}, void 0), jsx(DotTypography, Object.assign({
|
|
@@ -8688,7 +8788,7 @@ const renderActiveDragArea = () => jsxs(Fragment, {
|
|
|
8688
8788
|
children: "Drop the file(s) here ..."
|
|
8689
8789
|
}), void 0)]
|
|
8690
8790
|
}, void 0);
|
|
8691
|
-
const renderDragAndDropArea = (isUploadDisabled, onSelectButtonClick) => jsxs(Fragment, {
|
|
8791
|
+
const renderDragAndDropArea = (isUploadDisabled, onSelectButtonClick) => jsxs(Fragment$1, {
|
|
8692
8792
|
children: [jsx(DotIcon, {
|
|
8693
8793
|
iconId: "upload-file"
|
|
8694
8794
|
}, void 0), jsxs(DotTypography, Object.assign({
|
|
@@ -8894,7 +8994,7 @@ const DotPopper = ({
|
|
|
8894
8994
|
open,
|
|
8895
8995
|
placement
|
|
8896
8996
|
}) => {
|
|
8897
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
8997
|
+
const rootClasses = useStylesWithRootClass(rootClassName$V, className);
|
|
8898
8998
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8899
8999
|
const handleClickAway = event => {
|
|
8900
9000
|
if (onClickAway && (!anchorEl || !anchorEl.contains(event.currentTarget))) {
|