@digital-ai/dot-components 3.11.2 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +533 -322
- package/package.json +1 -1
- package/src/lib/components/analytics/dashboard-actions/DashboardActions.d.ts +1 -4
- package/src/lib/components/analytics/dashboard-actions/DashboardPublishConfirm.d.ts +2 -4
- package/src/lib/components/analytics/dashboard-actions/DashboardPublishConfirm.styles.d.ts +1 -1
- package/src/lib/components/analytics/dashboard-categories-autocomplete/DashboardCategoriesAutoComplete.d.ts +5 -0
- package/src/lib/components/analytics/metadata-api/MetadataApiProvider.d.ts +4 -4
- package/src/lib/components/analytics/metadata-api/openapi/models/DashboardView.d.ts +6 -6
- package/src/lib/components/analytics/metadata-api/openapi/models/Origin.d.ts +1 -1
- package/src/lib/components/analytics/metadata-api/openapi/services/DashboardsService.d.ts +10 -5
- package/src/lib/components/analytics/metadata-api/openapi/services/OriginsService.d.ts +2 -1
- package/src/lib/components/auto-complete/AutoComplete.d.ts +3 -1
- package/src/lib/components/card/CardHeader.styles.d.ts +2 -0
- package/src/lib/components/list/List.d.ts +1 -1
- package/src/lib/components/list/utils/models.d.ts +2 -0
- package/src/lib/components/popper/Popper.d.ts +3 -1
- package/src/lib/components/popper/Popper.data.d.ts +2 -0
- package/src/lib/components/popper/Popper.styles.d.ts +2 -0
package/index.esm.js
CHANGED
|
@@ -104,12 +104,12 @@ const DotTooltip = ({
|
|
|
104
104
|
}) : children;
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
-
const rootClassName$
|
|
107
|
+
const rootClassName$1j = 'dot-icon';
|
|
108
108
|
const StyledIcon = styled(Icon)`
|
|
109
109
|
${({
|
|
110
110
|
theme
|
|
111
111
|
}) => css`
|
|
112
|
-
&.${rootClassName$
|
|
112
|
+
&.${rootClassName$1j} {
|
|
113
113
|
color: ${theme.palette.figma.icon.black};
|
|
114
114
|
font-size: 20px;
|
|
115
115
|
|
|
@@ -146,7 +146,7 @@ const DotIcon = ({
|
|
|
146
146
|
iconId,
|
|
147
147
|
tooltip
|
|
148
148
|
}) => {
|
|
149
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
149
|
+
const rootClasses = useStylesWithRootClass(rootClassName$1j, className);
|
|
150
150
|
return jsx(DotTooltip, {
|
|
151
151
|
title: tooltip,
|
|
152
152
|
children: jsx(StyledIcon, {
|
|
@@ -207,7 +207,7 @@ const DotTypography = ({
|
|
|
207
207
|
});
|
|
208
208
|
};
|
|
209
209
|
|
|
210
|
-
const rootClassName$
|
|
210
|
+
const rootClassName$1i = 'dot-accordion';
|
|
211
211
|
const summaryClassName = 'dot-accordion-summary';
|
|
212
212
|
const detailClassName = 'dot-accordion-details';
|
|
213
213
|
const StyledAccordion = styled(Accordion)`
|
|
@@ -218,7 +218,7 @@ const StyledAccordion = styled(Accordion)`
|
|
|
218
218
|
background: ${theme.palette.figma.background.level1.white};
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
&.${rootClassName$
|
|
221
|
+
&.${rootClassName$1i} .${summaryClassName} {
|
|
222
222
|
align-items: center;
|
|
223
223
|
background: ${theme.palette.figma.background.level1.white};
|
|
224
224
|
color: ${theme.palette.figma.typography.black};
|
|
@@ -263,7 +263,7 @@ const DotAccordion = ({
|
|
|
263
263
|
ariaLabel,
|
|
264
264
|
children,
|
|
265
265
|
className,
|
|
266
|
-
'data-pendoid': dataPendoId = rootClassName$
|
|
266
|
+
'data-pendoid': dataPendoId = rootClassName$1i,
|
|
267
267
|
'data-testid': dataTestId = 'dot-accordion',
|
|
268
268
|
disabled = false,
|
|
269
269
|
expanded,
|
|
@@ -274,7 +274,7 @@ const DotAccordion = ({
|
|
|
274
274
|
summary,
|
|
275
275
|
noWrap = true
|
|
276
276
|
}) => {
|
|
277
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
277
|
+
const rootClasses = useStylesWithRootClass(rootClassName$1i, className);
|
|
278
278
|
const [elevation, setElevation] = useState();
|
|
279
279
|
useEffect(() => {
|
|
280
280
|
if (onChange && expanded === undefined) {
|
|
@@ -390,7 +390,7 @@ const readOnlyStyles = theme => css`
|
|
|
390
390
|
}
|
|
391
391
|
`;
|
|
392
392
|
|
|
393
|
-
const rootClassName$
|
|
393
|
+
const rootClassName$1h = 'dot-text-field';
|
|
394
394
|
const rootSelectClassName = 'dot-select-field';
|
|
395
395
|
const labelClassName = 'dot-input-label';
|
|
396
396
|
const errorClassName = 'dot-error';
|
|
@@ -438,7 +438,7 @@ const StyledTextField = styled(TextField)`
|
|
|
438
438
|
theme,
|
|
439
439
|
InputProps
|
|
440
440
|
}) => css`
|
|
441
|
-
&.${rootClassName$
|
|
441
|
+
&.${rootClassName$1h} {
|
|
442
442
|
.MuiInputBase-root {
|
|
443
443
|
margin-bottom: 0;
|
|
444
444
|
}
|
|
@@ -482,7 +482,7 @@ const StyledTextField = styled(TextField)`
|
|
|
482
482
|
margin-right: ${theme.spacing(2)};
|
|
483
483
|
}
|
|
484
484
|
|
|
485
|
-
&.${rootSelectClassName}, &.${rootClassName$
|
|
485
|
+
&.${rootSelectClassName}, &.${rootClassName$1h} {
|
|
486
486
|
.${adornmentIconClassName} {
|
|
487
487
|
color: ${theme.palette.figma.icon.black};
|
|
488
488
|
p {
|
|
@@ -573,15 +573,15 @@ const StyledTextField = styled(TextField)`
|
|
|
573
573
|
`}
|
|
574
574
|
`;
|
|
575
575
|
|
|
576
|
-
const rootClassName$
|
|
576
|
+
const rootClassName$1g = 'dot-action-toolbar';
|
|
577
577
|
const StyledToolbar = styled(Toolbar)`
|
|
578
578
|
${({
|
|
579
579
|
theme
|
|
580
580
|
}) => css`
|
|
581
|
-
&.${rootClassName$
|
|
581
|
+
&.${rootClassName$1g} {
|
|
582
582
|
border-bottom: 1px solid ${theme.palette.figma.border.default};
|
|
583
583
|
|
|
584
|
-
.${rootClassName$
|
|
584
|
+
.${rootClassName$1h} .MuiInputBase-root {
|
|
585
585
|
margin-bottom: 0;
|
|
586
586
|
}
|
|
587
587
|
}
|
|
@@ -595,7 +595,7 @@ const DotActionToolbar = ({
|
|
|
595
595
|
'data-testid': dataTestId,
|
|
596
596
|
variant = 'dense'
|
|
597
597
|
}) => {
|
|
598
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
598
|
+
const rootClasses = useStylesWithRootClass(rootClassName$1g, className);
|
|
599
599
|
return jsx(StyledToolbar, {
|
|
600
600
|
"aria-label": ariaLabel,
|
|
601
601
|
className: rootClasses,
|
|
@@ -1665,12 +1665,12 @@ const renderNodeOrTypography = (content, typographyVariant = 'body1') => {
|
|
|
1665
1665
|
const checkIfArrowUpPressed = event => event.key === 'ArrowUp';
|
|
1666
1666
|
const checkIfArrowDownPressed = event => event.key === 'ArrowDown';
|
|
1667
1667
|
|
|
1668
|
-
const rootClassName$
|
|
1668
|
+
const rootClassName$1f = 'dot-alert-banner';
|
|
1669
1669
|
const StyledAlertBanner = styled(Alert)`
|
|
1670
1670
|
${({
|
|
1671
1671
|
theme
|
|
1672
1672
|
}) => css`
|
|
1673
|
-
&.${rootClassName$
|
|
1673
|
+
&.${rootClassName$1f} {
|
|
1674
1674
|
align-items: center;
|
|
1675
1675
|
box-sizing: border-box;
|
|
1676
1676
|
min-height: 48px;
|
|
@@ -1705,7 +1705,7 @@ const DotAlertBanner = ({
|
|
|
1705
1705
|
ariaLabel,
|
|
1706
1706
|
children,
|
|
1707
1707
|
className,
|
|
1708
|
-
'data-pendoid': dataPendoId = rootClassName$
|
|
1708
|
+
'data-pendoid': dataPendoId = rootClassName$1f,
|
|
1709
1709
|
'data-testid': dataTestId,
|
|
1710
1710
|
onClose,
|
|
1711
1711
|
roundedCorners = true,
|
|
@@ -1713,7 +1713,7 @@ const DotAlertBanner = ({
|
|
|
1713
1713
|
textVariant = 'body1',
|
|
1714
1714
|
width
|
|
1715
1715
|
}) => {
|
|
1716
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
1716
|
+
const rootClasses = useStylesWithRootClass(rootClassName$1f, severity, className);
|
|
1717
1717
|
/* For simple string use default component, for everything else use 'div' */
|
|
1718
1718
|
const typographyComponent = isString$2(children) ? undefined : 'div';
|
|
1719
1719
|
return jsx(StyledAlertBanner, {
|
|
@@ -2391,7 +2391,7 @@ const useDotCoreApiContext = () => {
|
|
|
2391
2391
|
return useContext(DotCoreApiContext);
|
|
2392
2392
|
};
|
|
2393
2393
|
|
|
2394
|
-
const rootClassName$
|
|
2394
|
+
const rootClassName$1e = 'dot-avatar';
|
|
2395
2395
|
const avatarSpacing = {
|
|
2396
2396
|
small: 3,
|
|
2397
2397
|
medium: 5,
|
|
@@ -2401,7 +2401,7 @@ const StyledAvatar = styled(Avatar)`
|
|
|
2401
2401
|
${({
|
|
2402
2402
|
theme
|
|
2403
2403
|
}) => css`
|
|
2404
|
-
&.${rootClassName$
|
|
2404
|
+
&.${rootClassName$1e} {
|
|
2405
2405
|
display: inline-flex;
|
|
2406
2406
|
background-color: ${({
|
|
2407
2407
|
color
|
|
@@ -2513,7 +2513,7 @@ const DotAvatar = ({
|
|
|
2513
2513
|
variant = 'circular',
|
|
2514
2514
|
style
|
|
2515
2515
|
}) => {
|
|
2516
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
2516
|
+
const rootClasses = useStylesWithRootClass(rootClassName$1e, className);
|
|
2517
2517
|
const getAvatarColor = () => {
|
|
2518
2518
|
if ((style === null || style === void 0 ? void 0 : style.color) !== undefined) return 'inherit';
|
|
2519
2519
|
if (color) return color;
|
|
@@ -2552,12 +2552,12 @@ const DotAvatar = ({
|
|
|
2552
2552
|
});
|
|
2553
2553
|
};
|
|
2554
2554
|
|
|
2555
|
-
const rootClassName$
|
|
2555
|
+
const rootClassName$1d = 'dot-button';
|
|
2556
2556
|
const StyledButton = styled(Button)`
|
|
2557
2557
|
${({
|
|
2558
2558
|
theme
|
|
2559
2559
|
}) => css`
|
|
2560
|
-
&.${rootClassName$
|
|
2560
|
+
&.${rootClassName$1d} {
|
|
2561
2561
|
background-color: ${theme.palette.figma.primary.normal};
|
|
2562
2562
|
margin: ${theme.spacing(0.5)};
|
|
2563
2563
|
padding: ${theme.spacing(0.75, 2)};
|
|
@@ -2641,7 +2641,7 @@ const DotButton = forwardRef(({
|
|
|
2641
2641
|
autoFocus = false,
|
|
2642
2642
|
children,
|
|
2643
2643
|
className,
|
|
2644
|
-
'data-pendoid': dataPendoId = rootClassName$
|
|
2644
|
+
'data-pendoid': dataPendoId = rootClassName$1d,
|
|
2645
2645
|
'data-testid': dataTestId,
|
|
2646
2646
|
disabled = false,
|
|
2647
2647
|
disableRipple = false,
|
|
@@ -2657,7 +2657,7 @@ const DotButton = forwardRef(({
|
|
|
2657
2657
|
tooltipPlacement,
|
|
2658
2658
|
type = 'primary'
|
|
2659
2659
|
}, ref) => {
|
|
2660
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
2660
|
+
const rootClasses = useStylesWithRootClass(rootClassName$1d, className);
|
|
2661
2661
|
let color;
|
|
2662
2662
|
let variant;
|
|
2663
2663
|
switch (type) {
|
|
@@ -2681,7 +2681,7 @@ const DotButton = forwardRef(({
|
|
|
2681
2681
|
return jsx(DotTooltip, {
|
|
2682
2682
|
placement: tooltipPlacement,
|
|
2683
2683
|
title: tooltip,
|
|
2684
|
-
"data-testid": `${dataTestId || rootClassName$
|
|
2684
|
+
"data-testid": `${dataTestId || rootClassName$1d}-tooltip`,
|
|
2685
2685
|
children: jsx(StyledButton, {
|
|
2686
2686
|
"aria-label": ariaLabel,
|
|
2687
2687
|
autoFocus: autoFocus,
|
|
@@ -2690,7 +2690,7 @@ const DotButton = forwardRef(({
|
|
|
2690
2690
|
},
|
|
2691
2691
|
color: color,
|
|
2692
2692
|
"data-pendoid": dataPendoId,
|
|
2693
|
-
"data-testid": dataTestId || rootClassName$
|
|
2693
|
+
"data-testid": dataTestId || rootClassName$1d,
|
|
2694
2694
|
disableRipple: disableRipple,
|
|
2695
2695
|
disabled: disabled,
|
|
2696
2696
|
endIcon: endIcon,
|
|
@@ -2709,10 +2709,10 @@ const DotButton = forwardRef(({
|
|
|
2709
2709
|
});
|
|
2710
2710
|
});
|
|
2711
2711
|
|
|
2712
|
-
const rootClassName$
|
|
2712
|
+
const rootClassName$1c = 'dot-link';
|
|
2713
2713
|
const StyledLink = styled(Link)`
|
|
2714
2714
|
${() => css`
|
|
2715
|
-
&.${rootClassName$
|
|
2715
|
+
&.${rootClassName$1c} {
|
|
2716
2716
|
cursor: pointer;
|
|
2717
2717
|
|
|
2718
2718
|
&:hover.MuiLink-underlineHover {
|
|
@@ -2728,7 +2728,7 @@ const DotLink = ({
|
|
|
2728
2728
|
children,
|
|
2729
2729
|
className,
|
|
2730
2730
|
color = 'primary',
|
|
2731
|
-
'data-pendoid': dataPendoId = rootClassName$
|
|
2731
|
+
'data-pendoid': dataPendoId = rootClassName$1c,
|
|
2732
2732
|
'data-testid': dataTestId,
|
|
2733
2733
|
href,
|
|
2734
2734
|
onClick,
|
|
@@ -2740,7 +2740,7 @@ const DotLink = ({
|
|
|
2740
2740
|
tooltip,
|
|
2741
2741
|
underline = 'always'
|
|
2742
2742
|
}) => {
|
|
2743
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
2743
|
+
const rootClasses = useStylesWithRootClass(rootClassName$1c, className);
|
|
2744
2744
|
useEffect(() => {
|
|
2745
2745
|
// Include a console warning if the link is not a string and no ariaLabel is provided
|
|
2746
2746
|
if (!isString$2(children) && !ariaLabel) {
|
|
@@ -2790,7 +2790,7 @@ const CreateUUID = () => {
|
|
|
2790
2790
|
});
|
|
2791
2791
|
};
|
|
2792
2792
|
|
|
2793
|
-
const rootClassName$
|
|
2793
|
+
const rootClassName$1b = 'dot-list';
|
|
2794
2794
|
const listItemRootClass = 'dot-list-item';
|
|
2795
2795
|
const nestedListClassName = 'dot-nested-list';
|
|
2796
2796
|
const nestedDrawerClassName = 'dot-nested-drawer';
|
|
@@ -2798,7 +2798,7 @@ const StyledList = styled(List)`
|
|
|
2798
2798
|
${({
|
|
2799
2799
|
theme
|
|
2800
2800
|
}) => css`
|
|
2801
|
-
&.${rootClassName$
|
|
2801
|
+
&.${rootClassName$1b} {
|
|
2802
2802
|
background: ${theme.palette.figma.background.level0.componentsBackground};
|
|
2803
2803
|
|
|
2804
2804
|
.dot-icon {
|
|
@@ -2810,13 +2810,13 @@ const StyledList = styled(List)`
|
|
|
2810
2810
|
}
|
|
2811
2811
|
|
|
2812
2812
|
.MuiCollapse-root {
|
|
2813
|
-
|
|
2814
|
-
|
|
2813
|
+
&.${nestedListClassName} .${listItemRootClass} {
|
|
2814
|
+
padding-left: ${theme.spacing(6)};
|
|
2815
|
+
padding-right: ${theme.spacing(2)};
|
|
2816
|
+
}
|
|
2815
2817
|
|
|
2816
2818
|
.MuiCollapse-wrapper {
|
|
2817
|
-
margin: ${theme.spacing(0, 2)};
|
|
2818
2819
|
overflow: hidden;
|
|
2819
|
-
width: calc(100% - ${theme.spacing(4)});
|
|
2820
2820
|
}
|
|
2821
2821
|
|
|
2822
2822
|
.MuiListSubheader-root .MuiTypography-root {
|
|
@@ -2881,12 +2881,12 @@ const DotListDivider = ({
|
|
|
2881
2881
|
});
|
|
2882
2882
|
};
|
|
2883
2883
|
|
|
2884
|
-
const rootClassName$
|
|
2884
|
+
const rootClassName$1a = 'dot-progress';
|
|
2885
2885
|
const StyledProgress = styled.div`
|
|
2886
2886
|
${({
|
|
2887
2887
|
theme
|
|
2888
2888
|
}) => css`
|
|
2889
|
-
&.${rootClassName$
|
|
2889
|
+
&.${rootClassName$1a} {
|
|
2890
2890
|
line-height: 0;
|
|
2891
2891
|
|
|
2892
2892
|
.dot-progress-with-label-wrapper {
|
|
@@ -2937,7 +2937,7 @@ const DotProgress = ({
|
|
|
2937
2937
|
value,
|
|
2938
2938
|
variant = 'indeterminate'
|
|
2939
2939
|
}) => {
|
|
2940
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
2940
|
+
const rootClasses = useStylesWithRootClass(rootClassName$1a, className);
|
|
2941
2941
|
useEffect(() => {
|
|
2942
2942
|
if (!ariaLabel) {
|
|
2943
2943
|
console.warn('a11y: DotProgress must have an ariaLabel to describe the progress component');
|
|
@@ -3003,34 +3003,112 @@ var variables = /*#__PURE__*/Object.freeze({
|
|
|
3003
3003
|
levelTop: levelTop
|
|
3004
3004
|
});
|
|
3005
3005
|
|
|
3006
|
-
const rootClassName$
|
|
3006
|
+
const rootClassName$19 = 'dot-popper';
|
|
3007
|
+
const arrowClassName = 'MuiPopper-arrow';
|
|
3007
3008
|
const StyledPopper$1 = styled(Popper)`
|
|
3008
3009
|
${({
|
|
3009
3010
|
theme
|
|
3010
3011
|
}) => css`
|
|
3011
|
-
&.${rootClassName$
|
|
3012
|
+
&.${rootClassName$19} {
|
|
3012
3013
|
font-family: ${theme.typography.fontFamily};
|
|
3013
3014
|
font-size: ${theme.typography.body1.fontSize}px;
|
|
3015
|
+
|
|
3016
|
+
&[data-popper-placement='top'],
|
|
3017
|
+
&[data-popper-placement='top-start'],
|
|
3018
|
+
&[data-popper-placement='top-end'] {
|
|
3019
|
+
.${arrowClassName} {
|
|
3020
|
+
bottom: 0;
|
|
3021
|
+
left: 0;
|
|
3022
|
+
margin-bottom: -10px;
|
|
3023
|
+
&::before {
|
|
3024
|
+
transform-origin: 100% 0;
|
|
3025
|
+
}
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
|
|
3029
|
+
&[data-popper-placement='right'],
|
|
3030
|
+
&[data-popper-placement='right-start'],
|
|
3031
|
+
&[data-popper-placement='right-end'] {
|
|
3032
|
+
.${arrowClassName} {
|
|
3033
|
+
left: 0;
|
|
3034
|
+
margin-left: -10px;
|
|
3035
|
+
height: 14px;
|
|
3036
|
+
width: 10px;
|
|
3037
|
+
&::before {
|
|
3038
|
+
transform-origin: 100% 100%;
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
}
|
|
3042
|
+
|
|
3043
|
+
&[data-popper-placement='bottom'],
|
|
3044
|
+
&[data-popper-placement='bottom-start'],
|
|
3045
|
+
&[data-popper-placement='bottom-end'] {
|
|
3046
|
+
.${arrowClassName} {
|
|
3047
|
+
top: 0;
|
|
3048
|
+
left: 0;
|
|
3049
|
+
margin-top: -10px;
|
|
3050
|
+
&::before {
|
|
3051
|
+
transform-origin: 0 100%;
|
|
3052
|
+
}
|
|
3053
|
+
}
|
|
3054
|
+
}
|
|
3055
|
+
|
|
3056
|
+
&[data-popper-placement='left'],
|
|
3057
|
+
&[data-popper-placement='left-start'],
|
|
3058
|
+
&[data-popper-placement='left-end'] {
|
|
3059
|
+
.${arrowClassName} {
|
|
3060
|
+
right: 0;
|
|
3061
|
+
margin-right: -10px;
|
|
3062
|
+
height: 14px;
|
|
3063
|
+
width: 10px;
|
|
3064
|
+
&::before {
|
|
3065
|
+
transform-origin: 0 0;
|
|
3066
|
+
}
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3014
3069
|
}
|
|
3015
3070
|
|
|
3016
|
-
&.${rootClassName$
|
|
3071
|
+
&.${rootClassName$19}, &.${rootClassName$19} > .dot-popper-paper {
|
|
3017
3072
|
background-color: ${theme.palette.figma.background.level1.white};
|
|
3018
3073
|
}
|
|
3019
3074
|
`}
|
|
3020
3075
|
`;
|
|
3076
|
+
const StyledArrow = styled('span')`
|
|
3077
|
+
${({
|
|
3078
|
+
theme
|
|
3079
|
+
}) => css`
|
|
3080
|
+
&.${arrowClassName} {
|
|
3081
|
+
overflow: hidden;
|
|
3082
|
+
position: absolute;
|
|
3083
|
+
width: 14px;
|
|
3084
|
+
height: 10px;
|
|
3085
|
+
box-sizing: border-box;
|
|
3086
|
+
&::before {
|
|
3087
|
+
content: '';
|
|
3088
|
+
margin: auto;
|
|
3089
|
+
display: block;
|
|
3090
|
+
width: 100%;
|
|
3091
|
+
height: 100%;
|
|
3092
|
+
background-color: ${theme.palette.figma.background.level1.white};
|
|
3093
|
+
box-shadow: ${theme.shadows[1]};
|
|
3094
|
+
transform: rotate(45deg);
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
3097
|
+
`}
|
|
3098
|
+
`;
|
|
3021
3099
|
|
|
3022
3100
|
const flyoutMenuClassName = 'dot-flyout-menu';
|
|
3023
|
-
const rootClassName$
|
|
3101
|
+
const rootClassName$18 = 'dot-menu';
|
|
3024
3102
|
const StyledPopper = styled(Popper)`
|
|
3025
3103
|
${({
|
|
3026
3104
|
theme
|
|
3027
3105
|
}) => css`
|
|
3028
|
-
&.${rootClassName$
|
|
3106
|
+
&.${rootClassName$19} {
|
|
3029
3107
|
font-family: ${theme.typography.fontFamily};
|
|
3030
3108
|
font-size: ${theme.typography.body1.fontSize}px;
|
|
3031
3109
|
z-index: ${levelSecond};
|
|
3032
3110
|
}
|
|
3033
|
-
&.${rootClassName$
|
|
3111
|
+
&.${rootClassName$18}, &.${rootClassName$19} {
|
|
3034
3112
|
.MuiPaper-root {
|
|
3035
3113
|
border: 1px solid ${theme.palette.layer.n100};
|
|
3036
3114
|
}
|
|
@@ -3110,14 +3188,14 @@ const MENU_ITEM_HEIGHT_NORMAL = 48;
|
|
|
3110
3188
|
const MENU_ITEM_HEIGHT_DENSE = 36;
|
|
3111
3189
|
const DEFAULT_MAX_VISIBLE_ITEMS = 7;
|
|
3112
3190
|
|
|
3113
|
-
const rootClassName$
|
|
3191
|
+
const rootClassName$17 = 'dot-ul';
|
|
3114
3192
|
const listItemClassName$1 = 'dot-li';
|
|
3115
3193
|
const listItemWithSubmenuClassName = 'dot-li-with-submenu';
|
|
3116
3194
|
const StyledMenuList = styled(MenuList)`
|
|
3117
3195
|
${({
|
|
3118
3196
|
theme
|
|
3119
3197
|
}) => css`
|
|
3120
|
-
&.${rootClassName$
|
|
3198
|
+
&.${rootClassName$17} {
|
|
3121
3199
|
background: ${theme.palette.figma.background.level1.white};
|
|
3122
3200
|
|
|
3123
3201
|
.dot-li {
|
|
@@ -3213,7 +3291,7 @@ const DotMenuList = forwardRef(({
|
|
|
3213
3291
|
onSubMenuCreate,
|
|
3214
3292
|
selectedKey
|
|
3215
3293
|
}, ref) => {
|
|
3216
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
3294
|
+
const rootClasses = useStylesWithRootClass(rootClassName$17, className);
|
|
3217
3295
|
const [activeSubmenu, setActiveSubmenu] = useState(null);
|
|
3218
3296
|
const [subItemAnchorEl, setSubItemAnchorEl] = useState(null);
|
|
3219
3297
|
const openSubmenu = (target, itemKey) => {
|
|
@@ -3324,7 +3402,7 @@ const DotMenu = ({
|
|
|
3324
3402
|
open = false,
|
|
3325
3403
|
selectedKey
|
|
3326
3404
|
}) => {
|
|
3327
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
3405
|
+
const rootClasses = useStylesWithRootClass(rootClassName$18, className, loading ? 'loading' : '');
|
|
3328
3406
|
const isSubmenu = checkIfSubmenu(anchorEl);
|
|
3329
3407
|
const hasSubItems = checkForSubItems(menuItems);
|
|
3330
3408
|
// Timeout object is customizable when Menu component is either submenu
|
|
@@ -3412,12 +3490,12 @@ const DotMenu = ({
|
|
|
3412
3490
|
});
|
|
3413
3491
|
};
|
|
3414
3492
|
|
|
3415
|
-
const rootClassName$
|
|
3493
|
+
const rootClassName$16 = 'dot-drawer';
|
|
3416
3494
|
const StyledDrawer = styled(Drawer)`
|
|
3417
3495
|
${({
|
|
3418
3496
|
theme
|
|
3419
3497
|
}) => css`
|
|
3420
|
-
&.${rootClassName$
|
|
3498
|
+
&.${rootClassName$16} .MuiBackdrop-root {
|
|
3421
3499
|
background-color: ${theme.palette.figma.overlay.default};
|
|
3422
3500
|
}
|
|
3423
3501
|
|
|
@@ -3436,12 +3514,12 @@ const StyledDrawer = styled(Drawer)`
|
|
|
3436
3514
|
`}
|
|
3437
3515
|
`;
|
|
3438
3516
|
|
|
3439
|
-
const rootClassName$
|
|
3517
|
+
const rootClassName$15 = 'dot-drawer-header';
|
|
3440
3518
|
const StyleDrawerHeader = styled.div`
|
|
3441
3519
|
${({
|
|
3442
3520
|
theme
|
|
3443
3521
|
}) => css`
|
|
3444
|
-
&.${rootClassName$
|
|
3522
|
+
&.${rootClassName$15} {
|
|
3445
3523
|
padding: ${theme.spacing(0, 0, 2)};
|
|
3446
3524
|
display: flex;
|
|
3447
3525
|
align-items: center;
|
|
@@ -3452,13 +3530,13 @@ const StyleDrawerHeader = styled.div`
|
|
|
3452
3530
|
`}
|
|
3453
3531
|
`;
|
|
3454
3532
|
|
|
3455
|
-
const rootClassName$
|
|
3533
|
+
const rootClassName$14 = 'dot-icon-btn';
|
|
3456
3534
|
const StyledIconButton = styled(IconButton)`
|
|
3457
3535
|
${({
|
|
3458
3536
|
theme,
|
|
3459
3537
|
color
|
|
3460
3538
|
}) => css`
|
|
3461
|
-
&.${rootClassName$
|
|
3539
|
+
&.${rootClassName$14} {
|
|
3462
3540
|
${color === 'inherit' ? css`
|
|
3463
3541
|
color: inherit;
|
|
3464
3542
|
` : ''}
|
|
@@ -3517,7 +3595,7 @@ const DotIconButton = ({
|
|
|
3517
3595
|
ariaRole = 'button',
|
|
3518
3596
|
className,
|
|
3519
3597
|
color = 'inherit',
|
|
3520
|
-
'data-pendoid': dataPendoId = rootClassName$
|
|
3598
|
+
'data-pendoid': dataPendoId = rootClassName$14,
|
|
3521
3599
|
'data-testid': dataTestId,
|
|
3522
3600
|
disableRipple = false,
|
|
3523
3601
|
disabled = false,
|
|
@@ -3530,7 +3608,7 @@ const DotIconButton = ({
|
|
|
3530
3608
|
tooltipPlacement
|
|
3531
3609
|
}) => {
|
|
3532
3610
|
const rippleClassName = disableRipple ? 'ripple-disabled' : '';
|
|
3533
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
3611
|
+
const rootClasses = useStylesWithRootClass(rootClassName$14, rippleClassName, `shape-${shape}`, className);
|
|
3534
3612
|
return jsx(DotTooltip, {
|
|
3535
3613
|
"data-testid": "icon-button-tooltip",
|
|
3536
3614
|
placement: tooltipPlacement,
|
|
@@ -3565,7 +3643,7 @@ const DotDrawerHeader = ({
|
|
|
3565
3643
|
onClose,
|
|
3566
3644
|
variant
|
|
3567
3645
|
}) => {
|
|
3568
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
3646
|
+
const rootClasses = useStylesWithRootClass(rootClassName$15, className);
|
|
3569
3647
|
return jsxs(StyleDrawerHeader, {
|
|
3570
3648
|
"aria-label": ariaLabel,
|
|
3571
3649
|
"aria-level": 2,
|
|
@@ -3582,10 +3660,10 @@ const DotDrawerHeader = ({
|
|
|
3582
3660
|
});
|
|
3583
3661
|
};
|
|
3584
3662
|
|
|
3585
|
-
const rootClassName$
|
|
3663
|
+
const rootClassName$13 = 'dot-drawer-body';
|
|
3586
3664
|
const StyleDrawerBody = styled.div`
|
|
3587
3665
|
${() => css`
|
|
3588
|
-
&.${rootClassName$
|
|
3666
|
+
&.${rootClassName$13} {
|
|
3589
3667
|
display: flex;
|
|
3590
3668
|
.dot-drawer-close-button {
|
|
3591
3669
|
align-self: self-start;
|
|
@@ -3606,7 +3684,7 @@ const DotDrawerBody = ({
|
|
|
3606
3684
|
onClose,
|
|
3607
3685
|
variant
|
|
3608
3686
|
}) => {
|
|
3609
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
3687
|
+
const rootClasses = useStylesWithRootClass(rootClassName$13, className);
|
|
3610
3688
|
return jsxs(StyleDrawerBody, {
|
|
3611
3689
|
"aria-label": ariaLabel,
|
|
3612
3690
|
className: rootClasses,
|
|
@@ -3621,12 +3699,12 @@ const DotDrawerBody = ({
|
|
|
3621
3699
|
});
|
|
3622
3700
|
};
|
|
3623
3701
|
|
|
3624
|
-
const rootClassName$
|
|
3702
|
+
const rootClassName$12 = 'dot-drawer-footer';
|
|
3625
3703
|
const StyleDrawerFooter = styled.div`
|
|
3626
3704
|
${({
|
|
3627
3705
|
theme
|
|
3628
3706
|
}) => css`
|
|
3629
|
-
&.${rootClassName$
|
|
3707
|
+
&.${rootClassName$12} {
|
|
3630
3708
|
padding: ${theme.spacing(2, 0, 0)};
|
|
3631
3709
|
}
|
|
3632
3710
|
`}
|
|
@@ -3639,7 +3717,7 @@ const DotDrawerFooter = ({
|
|
|
3639
3717
|
className,
|
|
3640
3718
|
'data-testid': dataTestId
|
|
3641
3719
|
}) => {
|
|
3642
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
3720
|
+
const rootClasses = useStylesWithRootClass(rootClassName$12, className);
|
|
3643
3721
|
return jsx(StyleDrawerFooter, {
|
|
3644
3722
|
"aria-label": ariaLabel,
|
|
3645
3723
|
className: rootClasses,
|
|
@@ -3655,7 +3733,7 @@ const DotDrawer = ({
|
|
|
3655
3733
|
ariaRole = 'dialog',
|
|
3656
3734
|
className,
|
|
3657
3735
|
children,
|
|
3658
|
-
'data-pendoid': dataPendoId = rootClassName$
|
|
3736
|
+
'data-pendoid': dataPendoId = rootClassName$16,
|
|
3659
3737
|
'data-testid': dataTestId,
|
|
3660
3738
|
drawerBodyProps,
|
|
3661
3739
|
drawerFooterProps,
|
|
@@ -3678,7 +3756,7 @@ const DotDrawer = ({
|
|
|
3678
3756
|
onClose(event);
|
|
3679
3757
|
}
|
|
3680
3758
|
};
|
|
3681
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
3759
|
+
const rootClasses = useStylesWithRootClass(rootClassName$16, className);
|
|
3682
3760
|
const backdropEnabled = variant === 'temporary' && !(ModalProps === null || ModalProps === void 0 ? void 0 : ModalProps.hideBackdrop);
|
|
3683
3761
|
const headerExists = !!drawerHeaderProps;
|
|
3684
3762
|
const bodyPendoId = drawerBodyProps ? drawerBodyProps['data-pendoid'] : 'drawer-body';
|
|
@@ -4073,12 +4151,14 @@ const DotList = ({
|
|
|
4073
4151
|
items = [],
|
|
4074
4152
|
menuPlacement = 'right-start',
|
|
4075
4153
|
nestedDrawerLeftSpacing = 240,
|
|
4154
|
+
nestedListCloseOnClickAway = true,
|
|
4076
4155
|
nestedListType = 'expandable',
|
|
4077
4156
|
width = 240
|
|
4078
4157
|
}) => {
|
|
4079
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
4158
|
+
const rootClasses = useStylesWithRootClass(rootClassName$1b, className);
|
|
4080
4159
|
const listWidth = typeof width === 'number' ? `${width}px` : width;
|
|
4081
4160
|
const listRef = useRef();
|
|
4161
|
+
const disableCloseOnClickAway = !nestedListCloseOnClickAway && nestedListType === 'expandable';
|
|
4082
4162
|
const [listItemIndex, setListItemIndex] = useState(null);
|
|
4083
4163
|
const updateSelectedListItem = currentIndex => {
|
|
4084
4164
|
currentIndex === listItemIndex ? setListItemIndex(null) : setListItemIndex(currentIndex);
|
|
@@ -4089,93 +4169,94 @@ const DotList = ({
|
|
|
4089
4169
|
const handleHrefClick = index => () => {
|
|
4090
4170
|
updateSelectedListItem(index);
|
|
4091
4171
|
};
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4172
|
+
const list = jsxs(StyledList, {
|
|
4173
|
+
"aria-label": ariaLabel,
|
|
4174
|
+
classes: {
|
|
4175
|
+
root: rootClasses
|
|
4176
|
+
},
|
|
4177
|
+
component: component,
|
|
4178
|
+
"data-testid": dataTestId,
|
|
4179
|
+
dense: dense,
|
|
4180
|
+
disablePadding: disablePadding,
|
|
4181
|
+
ref: listRef,
|
|
4182
|
+
role: ariaRole,
|
|
4183
|
+
style: {
|
|
4184
|
+
width: listWidth
|
|
4185
|
+
},
|
|
4186
|
+
children: [items.map((item, index) => {
|
|
4187
|
+
var _a;
|
|
4188
|
+
const handleListItemClick = e => {
|
|
4109
4189
|
var _a;
|
|
4110
|
-
const
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
if (shouldToggleOpen(target.className)) {
|
|
4118
|
-
updateSelectedListItem(index);
|
|
4119
|
-
}
|
|
4120
|
-
};
|
|
4121
|
-
const determineOnClick = item.onClick || ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) ? handleListItemClick : null;
|
|
4122
|
-
const handleMenuLeave = event => {
|
|
4123
|
-
// TODO: Need to apply animation to open/close
|
|
4124
|
-
var _a, _b;
|
|
4125
|
-
// Remove index only if clicked element is not found within the list
|
|
4126
|
-
if (!((_a = listRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
4127
|
-
setListItemIndex(null);
|
|
4128
|
-
(_b = item.onMenuLeave) === null || _b === void 0 ? void 0 : _b.call(item, event);
|
|
4129
|
-
}
|
|
4130
|
-
};
|
|
4131
|
-
if (item.child) {
|
|
4132
|
-
return jsx("div", {
|
|
4133
|
-
onClick: item.onClick,
|
|
4134
|
-
role: "listitem",
|
|
4135
|
-
children: item.child
|
|
4136
|
-
}, `item-child-${item.id || CreateUUID()}`);
|
|
4190
|
+
const target = e.target;
|
|
4191
|
+
e.stopPropagation();
|
|
4192
|
+
(_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, e);
|
|
4193
|
+
// If clicking on a nested list item, don't update the selected index
|
|
4194
|
+
// Do nothing if clicking on the drawer itself
|
|
4195
|
+
if (shouldToggleOpen(target.className)) {
|
|
4196
|
+
updateSelectedListItem(index);
|
|
4137
4197
|
}
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4198
|
+
};
|
|
4199
|
+
const determineOnClick = item.onClick || ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) ? handleListItemClick : null;
|
|
4200
|
+
const handleMenuLeave = event => {
|
|
4201
|
+
// TODO: Need to apply animation to open/close
|
|
4202
|
+
var _a, _b;
|
|
4203
|
+
// Remove index only if clicked element is not found within the list
|
|
4204
|
+
if (!((_a = listRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
4205
|
+
setListItemIndex(null);
|
|
4206
|
+
(_b = item.onMenuLeave) === null || _b === void 0 ? void 0 : _b.call(item, event);
|
|
4143
4207
|
}
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
"
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4208
|
+
};
|
|
4209
|
+
if (item.child) {
|
|
4210
|
+
return jsx("div", {
|
|
4211
|
+
onClick: item.onClick,
|
|
4212
|
+
role: "listitem",
|
|
4213
|
+
children: item.child
|
|
4214
|
+
}, `item-child-${item.id || CreateUUID()}`);
|
|
4215
|
+
}
|
|
4216
|
+
if (item.divider) {
|
|
4217
|
+
return jsx(DotListDivider, {
|
|
4218
|
+
index: index,
|
|
4219
|
+
item: item
|
|
4220
|
+
}, `divider-${item.id || CreateUUID()}`);
|
|
4221
|
+
}
|
|
4222
|
+
return jsx(DotListItem, {
|
|
4223
|
+
ariaLabel: item.text || item.primaryText,
|
|
4224
|
+
className: item.className,
|
|
4225
|
+
component: item.component,
|
|
4226
|
+
"data-testid": `${dataTestId}-item-${index}`,
|
|
4227
|
+
endIcon: item.endIcon,
|
|
4228
|
+
href: item.href,
|
|
4229
|
+
isOpened: item.isOpened ? item.isOpened : listItemIndex === index,
|
|
4230
|
+
items: item.items,
|
|
4231
|
+
menuPlacement: menuPlacement,
|
|
4232
|
+
nestedDrawerLeftSpacing: nestedDrawerLeftSpacing,
|
|
4233
|
+
nestedListType: nestedListType,
|
|
4234
|
+
onClick: determineOnClick,
|
|
4235
|
+
onHrefClick: item.href ? handleHrefClick(index) : undefined,
|
|
4236
|
+
onMenuLeave: handleMenuLeave,
|
|
4237
|
+
primaryText: item.primaryText,
|
|
4238
|
+
secondaryText: item.secondaryText,
|
|
4239
|
+
selected: item.selected,
|
|
4240
|
+
startIcon: item.startIcon,
|
|
4241
|
+
target: item.target,
|
|
4242
|
+
text: item.text,
|
|
4243
|
+
tooltip: item.tooltip,
|
|
4244
|
+
tooltipPlacement: item.tooltipPlacement || DEFAULT_TOOLTIP_PLACEMENT
|
|
4245
|
+
}, item.id || item.text);
|
|
4246
|
+
}), children]
|
|
4247
|
+
});
|
|
4248
|
+
return disableCloseOnClickAway ? list : jsx(DotClickAwayListener, {
|
|
4249
|
+
onClickAway: handleClickAway,
|
|
4250
|
+
children: list
|
|
4170
4251
|
});
|
|
4171
4252
|
};
|
|
4172
4253
|
|
|
4173
|
-
const rootClassName$
|
|
4254
|
+
const rootClassName$11 = 'dot-copy-button';
|
|
4174
4255
|
const StyledCopyButton = styled.span`
|
|
4175
4256
|
${({
|
|
4176
4257
|
theme
|
|
4177
4258
|
}) => css`
|
|
4178
|
-
&.${rootClassName$
|
|
4259
|
+
&.${rootClassName$11} .copied-to-clipboard {
|
|
4179
4260
|
color: ${theme.palette.figma.success.normal};
|
|
4180
4261
|
|
|
4181
4262
|
&.MuiIcon-fontSizeSmall.button-size-small {
|
|
@@ -4201,7 +4282,7 @@ const DotCopyButton = ({
|
|
|
4201
4282
|
color = 'inherit',
|
|
4202
4283
|
copiedTooltip = 'Copied!',
|
|
4203
4284
|
copyTooltip = 'Copy to clipboard',
|
|
4204
|
-
'data-pendoid': dataPendoId = rootClassName$
|
|
4285
|
+
'data-pendoid': dataPendoId = rootClassName$11,
|
|
4205
4286
|
'data-testid': dataTestId = 'dot-copy-button',
|
|
4206
4287
|
disabled = false,
|
|
4207
4288
|
disableRipple = false,
|
|
@@ -4249,7 +4330,7 @@ const DotCopyButton = ({
|
|
|
4249
4330
|
return false;
|
|
4250
4331
|
}, [value, showCopiedIcon, disabled, onClick]);
|
|
4251
4332
|
return jsxs(StyledCopyButton, {
|
|
4252
|
-
className: rootClassName$
|
|
4333
|
+
className: rootClassName$11,
|
|
4253
4334
|
"data-testid": dataTestId,
|
|
4254
4335
|
children: [!timedShowCopiedIcon && jsx(DotIconButton, {
|
|
4255
4336
|
ariaLabel: ariaLabel,
|
|
@@ -4338,7 +4419,7 @@ const DotInputText = ({
|
|
|
4338
4419
|
autoFocus,
|
|
4339
4420
|
className,
|
|
4340
4421
|
defaultValue,
|
|
4341
|
-
'data-pendoid': dataPendoId = rootClassName$
|
|
4422
|
+
'data-pendoid': dataPendoId = rootClassName$1h,
|
|
4342
4423
|
'data-testid': dataTestId,
|
|
4343
4424
|
disabled = false,
|
|
4344
4425
|
error = false,
|
|
@@ -4384,7 +4465,7 @@ const DotInputText = ({
|
|
|
4384
4465
|
const internalInputRef = useRef(null);
|
|
4385
4466
|
const textFieldInputRef = inputRef || internalInputRef;
|
|
4386
4467
|
const [inputTextState, setInputTextState] = useState(getInitialState(value));
|
|
4387
|
-
const rootStyles = useStylesWithRootClass(rootClassName$
|
|
4468
|
+
const rootStyles = useStylesWithRootClass(rootClassName$1h, hasError, hasWarning, hasSuccess, readOnly && readOnlyClassName$1);
|
|
4388
4469
|
useEffect(() => {
|
|
4389
4470
|
if (value !== inputTextState.inputValue) {
|
|
4390
4471
|
setInputTextState(getInitialState(value, defaultValue));
|
|
@@ -4520,10 +4601,10 @@ const DotInputText = ({
|
|
|
4520
4601
|
});
|
|
4521
4602
|
};
|
|
4522
4603
|
|
|
4523
|
-
const rootClassName
|
|
4604
|
+
const rootClassName$10 = 'dot-search-input';
|
|
4524
4605
|
const StyledSearchInput = styled.span`
|
|
4525
4606
|
${() => css`
|
|
4526
|
-
&.${rootClassName
|
|
4607
|
+
&.${rootClassName$10} {
|
|
4527
4608
|
}
|
|
4528
4609
|
`}
|
|
4529
4610
|
`;
|
|
@@ -4540,7 +4621,7 @@ function SearchInput({
|
|
|
4540
4621
|
tooltip = null,
|
|
4541
4622
|
value
|
|
4542
4623
|
}) {
|
|
4543
|
-
const rootClasses = useStylesWithRootClass(rootClassName
|
|
4624
|
+
const rootClasses = useStylesWithRootClass(rootClassName$10, className);
|
|
4544
4625
|
const [searchText, setSearchText] = useState(value);
|
|
4545
4626
|
let previousSearchText = '';
|
|
4546
4627
|
const handleChange = useCallback(event => {
|
|
@@ -4796,12 +4877,12 @@ const recentAppInstancesSetter = (latestInstance, maxRecentItems
|
|
|
4796
4877
|
};
|
|
4797
4878
|
};
|
|
4798
4879
|
|
|
4799
|
-
const rootClassName
|
|
4880
|
+
const rootClassName$$ = 'dot-app-switcher';
|
|
4800
4881
|
const StyledAppSwitcher = styled(DotDrawer)`
|
|
4801
4882
|
${({
|
|
4802
4883
|
theme
|
|
4803
4884
|
}) => css`
|
|
4804
|
-
&.${rootClassName
|
|
4885
|
+
&.${rootClassName$$} {
|
|
4805
4886
|
.dot-drawer-paper {
|
|
4806
4887
|
padding: 0;
|
|
4807
4888
|
width: 382px;
|
|
@@ -4911,7 +4992,7 @@ const DotAppSwitcherView = ({
|
|
|
4911
4992
|
if (dotCoreApiContext !== null) {
|
|
4912
4993
|
setSelectedAppType = dotCoreApiContext.setSelectedAppSwitcherAppType;
|
|
4913
4994
|
}
|
|
4914
|
-
const rootClasses = useStylesWithRootClass(rootClassName
|
|
4995
|
+
const rootClasses = useStylesWithRootClass(rootClassName$$, className);
|
|
4915
4996
|
const [appTypeMap, setAppTypeMap] = useState();
|
|
4916
4997
|
const [appTypeLabels, setAppTypeLabels] = useState();
|
|
4917
4998
|
const [appTypeMenuItems, setAppTypeMenuItems] = useState();
|
|
@@ -5289,12 +5370,12 @@ var SvgLogoDigitalAiWhite = function SvgLogoDigitalAiWhite(_ref, ref) {
|
|
|
5289
5370
|
};
|
|
5290
5371
|
var ForwardRef = /*#__PURE__*/forwardRef(SvgLogoDigitalAiWhite);
|
|
5291
5372
|
|
|
5292
|
-
const rootClassName$
|
|
5373
|
+
const rootClassName$_ = 'dot-sidebar';
|
|
5293
5374
|
const StyledSidebar = styled.aside`
|
|
5294
5375
|
${({
|
|
5295
5376
|
theme
|
|
5296
5377
|
}) => css`
|
|
5297
|
-
&.${rootClassName$
|
|
5378
|
+
&.${rootClassName$_} {
|
|
5298
5379
|
align-items: stretch;
|
|
5299
5380
|
background: ${theme.palette.figma.background.level1.white};
|
|
5300
5381
|
border-width: 0 1px;
|
|
@@ -5588,10 +5669,10 @@ const StyledSidebar = styled.aside`
|
|
|
5588
5669
|
`}
|
|
5589
5670
|
`;
|
|
5590
5671
|
|
|
5591
|
-
const rootClassName$
|
|
5672
|
+
const rootClassName$Z = 'dot-truncate-with-tooltip';
|
|
5592
5673
|
const StyledTruncateWithTooltip = styled(Tooltip)`
|
|
5593
5674
|
${() => css`
|
|
5594
|
-
&.${rootClassName$
|
|
5675
|
+
&.${rootClassName$Z} {
|
|
5595
5676
|
display: block;
|
|
5596
5677
|
overflow: hidden;
|
|
5597
5678
|
white-space: nowrap;
|
|
@@ -5622,7 +5703,7 @@ const DotTruncateWithTooltip = ({
|
|
|
5622
5703
|
label,
|
|
5623
5704
|
width
|
|
5624
5705
|
}) => {
|
|
5625
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
5706
|
+
const rootClasses = useStylesWithRootClass(rootClassName$Z, className, charactersLimit ? 'dot-characters-limit' : '');
|
|
5626
5707
|
return jsx(StyledTruncateWithTooltip, {
|
|
5627
5708
|
"aria-label": ariaLabel,
|
|
5628
5709
|
arrow: arrow,
|
|
@@ -5746,7 +5827,7 @@ const DotSidebar = ({
|
|
|
5746
5827
|
};
|
|
5747
5828
|
}, [isOpen, collapsable]);
|
|
5748
5829
|
const sidebarClasses = useStylesWithRootClass('side-nav', openClass);
|
|
5749
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
5830
|
+
const rootClasses = useStylesWithRootClass(rootClassName$_, openClass, className);
|
|
5750
5831
|
return jsxs(StyledSidebar, {
|
|
5751
5832
|
"aria-label": ariaLabel,
|
|
5752
5833
|
className: rootClasses,
|
|
@@ -5802,7 +5883,7 @@ const DotSidebar = ({
|
|
|
5802
5883
|
children: jsx(DotIconButton, {
|
|
5803
5884
|
ariaLabel: "collapse sidebar navigation",
|
|
5804
5885
|
"data-testid": "toggle-nav",
|
|
5805
|
-
iconId: isOpen ? '
|
|
5886
|
+
iconId: isOpen ? 'push-left' : 'push-right',
|
|
5806
5887
|
iconSize: "small",
|
|
5807
5888
|
onClick: toggleNavCollapseState,
|
|
5808
5889
|
size: "small"
|
|
@@ -5814,12 +5895,12 @@ const DotSidebar = ({
|
|
|
5814
5895
|
});
|
|
5815
5896
|
};
|
|
5816
5897
|
|
|
5817
|
-
const rootClassName$
|
|
5898
|
+
const rootClassName$Y = 'dot-badge';
|
|
5818
5899
|
const StyledBadge = styled(Badge)`
|
|
5819
5900
|
${({
|
|
5820
5901
|
theme
|
|
5821
5902
|
}) => css`
|
|
5822
|
-
&.${rootClassName$
|
|
5903
|
+
&.${rootClassName$Y} {
|
|
5823
5904
|
color: ${theme.palette.figma.typography.black};
|
|
5824
5905
|
word-break: normal;
|
|
5825
5906
|
|
|
@@ -5854,7 +5935,7 @@ const DotBadge = ({
|
|
|
5854
5935
|
overlap,
|
|
5855
5936
|
variant = 'dot'
|
|
5856
5937
|
}) => {
|
|
5857
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
5938
|
+
const rootClasses = useStylesWithRootClass(rootClassName$Y, className);
|
|
5858
5939
|
return jsx(StyledBadge, {
|
|
5859
5940
|
"$badgeColor": badgeColor,
|
|
5860
5941
|
anchorOrigin: {
|
|
@@ -5876,7 +5957,7 @@ const DotBadge = ({
|
|
|
5876
5957
|
});
|
|
5877
5958
|
};
|
|
5878
5959
|
|
|
5879
|
-
const rootClassName$
|
|
5960
|
+
const rootClassName$X = 'dot-app-toolbar';
|
|
5880
5961
|
const denseClassName = 'dense';
|
|
5881
5962
|
const StyledMainMenu = styled(DotDrawer)`
|
|
5882
5963
|
${({
|
|
@@ -5916,7 +5997,7 @@ const StyledAppToolbar = styled.header`
|
|
|
5916
5997
|
${({
|
|
5917
5998
|
theme
|
|
5918
5999
|
}) => css`
|
|
5919
|
-
&.${rootClassName$
|
|
6000
|
+
&.${rootClassName$X} {
|
|
5920
6001
|
align-items: center;
|
|
5921
6002
|
background: ${theme.palette.figma.appToolbar.background};
|
|
5922
6003
|
border-bottom: 4px solid ${theme.palette.figma.border.default};
|
|
@@ -6038,7 +6119,7 @@ const DotAppToolbar = ({
|
|
|
6038
6119
|
const displayAppLogo = appLogo || appLogoSmall;
|
|
6039
6120
|
const mainMenuRef = useRef(null);
|
|
6040
6121
|
const denseClass = dense ? denseClassName : '';
|
|
6041
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
6122
|
+
const rootClasses = useStylesWithRootClass(rootClassName$X, className, denseClass, showMainMenu ? '' : 'without-menu-icon');
|
|
6042
6123
|
const mainMenuClasses = useStylesWithRootClass('dot-main-menu', denseClass, menuOpen ? 'open' : '');
|
|
6043
6124
|
const targetBreakpoint = useMediaQuery(theme => theme.breakpoints.up('lg'));
|
|
6044
6125
|
useEffect(() => {
|
|
@@ -6168,14 +6249,14 @@ const DotAppToolbar = ({
|
|
|
6168
6249
|
}) : appToolbar;
|
|
6169
6250
|
};
|
|
6170
6251
|
|
|
6171
|
-
const rootClassName$
|
|
6252
|
+
const rootClassName$W = 'dot-autocomplete';
|
|
6172
6253
|
const inputRootClassName = 'dot-input-root';
|
|
6173
6254
|
const inputMediumClassName = 'dot-input-medium';
|
|
6174
6255
|
const StyledAutocomplete = styled(Autocomplete)`
|
|
6175
6256
|
${({
|
|
6176
6257
|
theme
|
|
6177
6258
|
}) => css`
|
|
6178
|
-
&.${rootClassName$
|
|
6259
|
+
&.${rootClassName$W} {
|
|
6179
6260
|
&.${inputMediumClassName} .dot-text-field .${inputRootClassName} {
|
|
6180
6261
|
height: 56px;
|
|
6181
6262
|
padding-left: ${theme.spacing(2)};
|
|
@@ -6212,12 +6293,12 @@ const StyledAutocomplete = styled(Autocomplete)`
|
|
|
6212
6293
|
`}
|
|
6213
6294
|
`;
|
|
6214
6295
|
|
|
6215
|
-
const rootClassName$
|
|
6296
|
+
const rootClassName$V = 'dot-chip';
|
|
6216
6297
|
const StyledChip = styled(Chip)`
|
|
6217
6298
|
${({
|
|
6218
6299
|
theme
|
|
6219
6300
|
}) => css`
|
|
6220
|
-
&.${rootClassName$
|
|
6301
|
+
&.${rootClassName$V} {
|
|
6221
6302
|
background: ${theme.palette.figma.neutral.normal};
|
|
6222
6303
|
border-color: ${theme.palette.figma.border.darker};
|
|
6223
6304
|
color: ${theme.palette.figma.typography.black};
|
|
@@ -6323,7 +6404,7 @@ const DotChip = ({
|
|
|
6323
6404
|
charactersLimit = DEFAULT_CHARACTERS_LIMIT,
|
|
6324
6405
|
children,
|
|
6325
6406
|
className,
|
|
6326
|
-
'data-pendoid': dataPendoId = rootClassName$
|
|
6407
|
+
'data-pendoid': dataPendoId = rootClassName$V,
|
|
6327
6408
|
'data-testid': dataTestId,
|
|
6328
6409
|
disabled = false,
|
|
6329
6410
|
error = false,
|
|
@@ -6336,7 +6417,7 @@ const DotChip = ({
|
|
|
6336
6417
|
tabIndex
|
|
6337
6418
|
}) => {
|
|
6338
6419
|
const errorClass = error ? 'Mui-error' : '';
|
|
6339
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
6420
|
+
const rootClasses = useStylesWithRootClass(rootClassName$V, className, errorClass);
|
|
6340
6421
|
const getChipLabel = () => {
|
|
6341
6422
|
if (charactersLimit <= 0 || children.length < charactersLimit) return children;
|
|
6342
6423
|
const label = `${children.substring(0, charactersLimit)}...`;
|
|
@@ -6436,7 +6517,7 @@ const DotAutoComplete = ({
|
|
|
6436
6517
|
autoFocus,
|
|
6437
6518
|
autoHighlight,
|
|
6438
6519
|
className,
|
|
6439
|
-
'data-pendoid': dataPendoId = rootClassName$
|
|
6520
|
+
'data-pendoid': dataPendoId = rootClassName$W,
|
|
6440
6521
|
'data-testid': dataTestId,
|
|
6441
6522
|
defaultValue,
|
|
6442
6523
|
dense = true,
|
|
@@ -6468,6 +6549,7 @@ const DotAutoComplete = ({
|
|
|
6468
6549
|
persistentLabel,
|
|
6469
6550
|
placeholder,
|
|
6470
6551
|
popperClassName,
|
|
6552
|
+
preserveGroupOrder = false,
|
|
6471
6553
|
readOnly = false,
|
|
6472
6554
|
renderGroup,
|
|
6473
6555
|
renderOption,
|
|
@@ -6488,10 +6570,10 @@ const DotAutoComplete = ({
|
|
|
6488
6570
|
const popperOpen = !readOnly && (open || isOpened);
|
|
6489
6571
|
const preventDuplicateInsertion = actionItem === null || actionItem === void 0 ? void 0 : actionItem.preventDuplicateInsertion;
|
|
6490
6572
|
const textFieldWarningClassName = !error && warning && warningClassName;
|
|
6491
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
6492
|
-
const textFieldRootClasses = useStylesWithRootClass(rootClassName$
|
|
6573
|
+
const rootClasses = useStylesWithRootClass(rootClassName$W, size === 'medium' && inputMediumClassName, className);
|
|
6574
|
+
const textFieldRootClasses = useStylesWithRootClass(rootClassName$1h, readOnly && readOnlyClassName$1, textFieldWarningClassName);
|
|
6493
6575
|
const inputRootClasses = useStylesWithRootClass(inputRootClassName, !dense && inputMediumClassName);
|
|
6494
|
-
const popperClasses = useStylesWithRootClass(rootClassName$
|
|
6576
|
+
const popperClasses = useStylesWithRootClass(rootClassName$19, popperClassName);
|
|
6495
6577
|
let highlightedOption = null;
|
|
6496
6578
|
let textFieldInput;
|
|
6497
6579
|
const textFieldRef = element => {
|
|
@@ -6517,11 +6599,12 @@ const DotAutoComplete = ({
|
|
|
6517
6599
|
setShowPlaceholder(parseAutoCompleteValue(val) === '');
|
|
6518
6600
|
};
|
|
6519
6601
|
const sortOptions = () => {
|
|
6520
|
-
|
|
6602
|
+
if (!group || preserveGroupOrder) return options;
|
|
6603
|
+
return options.sort((a, b) => {
|
|
6521
6604
|
const aGroup = a.group ? a.group : '';
|
|
6522
6605
|
const bGroup = b.group ? b.group : '';
|
|
6523
6606
|
return -bGroup.localeCompare(aGroup);
|
|
6524
|
-
})
|
|
6607
|
+
});
|
|
6525
6608
|
};
|
|
6526
6609
|
const handleBlur = event => {
|
|
6527
6610
|
event.relatedTarget !== actionItemRef.current && setIsOpened(false);
|
|
@@ -6768,10 +6851,10 @@ const DotAutoComplete = ({
|
|
|
6768
6851
|
});
|
|
6769
6852
|
};
|
|
6770
6853
|
|
|
6771
|
-
const rootClassName$
|
|
6854
|
+
const rootClassName$U = 'dot-avatar-group';
|
|
6772
6855
|
const StyledAvatarGroup = styled(AvatarGroup)`
|
|
6773
6856
|
${() => css`
|
|
6774
|
-
&.${rootClassName$
|
|
6857
|
+
&.${rootClassName$U} {
|
|
6775
6858
|
justify-content: flex-end;
|
|
6776
6859
|
|
|
6777
6860
|
.MuiAvatar-root {
|
|
@@ -6790,7 +6873,7 @@ const DotAvatarGroup = ({
|
|
|
6790
6873
|
max = 3,
|
|
6791
6874
|
spacing = 'medium'
|
|
6792
6875
|
}) => {
|
|
6793
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
6876
|
+
const rootClasses = useStylesWithRootClass(rootClassName$U, className);
|
|
6794
6877
|
return jsx(StyledAvatarGroup, {
|
|
6795
6878
|
"aria-label": ariaLabel,
|
|
6796
6879
|
classes: {
|
|
@@ -6805,13 +6888,13 @@ const DotAvatarGroup = ({
|
|
|
6805
6888
|
});
|
|
6806
6889
|
};
|
|
6807
6890
|
|
|
6808
|
-
const rootClassName$
|
|
6891
|
+
const rootClassName$T = 'dot-breadcrumbs';
|
|
6809
6892
|
const breadcrumbsWrapperClass = 'dot-breadcrumbs-wrapper';
|
|
6810
6893
|
const StyledBreadcrumbsWrapper = styled.div`
|
|
6811
6894
|
${({
|
|
6812
6895
|
theme
|
|
6813
6896
|
}) => css`
|
|
6814
|
-
&.${rootClassName$
|
|
6897
|
+
&.${rootClassName$T} {
|
|
6815
6898
|
overflow: hidden;
|
|
6816
6899
|
|
|
6817
6900
|
.dot-breadcrumbs-menu {
|
|
@@ -6831,7 +6914,7 @@ const StyledBreadcrumbs = styled(Breadcrumbs)`
|
|
|
6831
6914
|
${({
|
|
6832
6915
|
theme
|
|
6833
6916
|
}) => css`
|
|
6834
|
-
&.${rootClassName$
|
|
6917
|
+
&.${rootClassName$T} {
|
|
6835
6918
|
margin-bottom: 0;
|
|
6836
6919
|
|
|
6837
6920
|
.MuiBreadcrumbs-ol {
|
|
@@ -7159,7 +7242,7 @@ const DotBreadcrumbs = ({
|
|
|
7159
7242
|
children: [jsx(StyledBreadcrumbs, {
|
|
7160
7243
|
"aria-label": "breadcrumb",
|
|
7161
7244
|
classes: {
|
|
7162
|
-
root: rootClassName$
|
|
7245
|
+
root: rootClassName$T,
|
|
7163
7246
|
ol: 'dot-ol',
|
|
7164
7247
|
li: 'dot-li'
|
|
7165
7248
|
},
|
|
@@ -7190,14 +7273,14 @@ const DotBreadcrumbs = ({
|
|
|
7190
7273
|
});
|
|
7191
7274
|
};
|
|
7192
7275
|
|
|
7193
|
-
const rootClassName$
|
|
7276
|
+
const rootClassName$S = 'dot-button-toggle';
|
|
7194
7277
|
// TODO: need to update ripple color
|
|
7195
7278
|
// https://github.com/mui/material-ui/issues/28543
|
|
7196
7279
|
const StyledToggleButtonGroup = styled(ToggleButtonGroup)`
|
|
7197
7280
|
${({
|
|
7198
7281
|
theme
|
|
7199
7282
|
}) => css`
|
|
7200
|
-
&.${rootClassName$
|
|
7283
|
+
&.${rootClassName$S} {
|
|
7201
7284
|
button:not(.MuiToggleButton-sizeLarge):not(.MuiToggleButton-sizeSmall) {
|
|
7202
7285
|
/* Override height for medium size */
|
|
7203
7286
|
height: ${theme.spacing(5)};
|
|
@@ -7313,7 +7396,7 @@ const DotButtonToggle = ({
|
|
|
7313
7396
|
buttonOptions,
|
|
7314
7397
|
className,
|
|
7315
7398
|
color,
|
|
7316
|
-
'data-pendoid': dataPendoId = rootClassName$
|
|
7399
|
+
'data-pendoid': dataPendoId = rootClassName$S,
|
|
7317
7400
|
'data-testid': dataTestId = 'dot-toggle',
|
|
7318
7401
|
disableFocusRipple = false,
|
|
7319
7402
|
disableRipple = false,
|
|
@@ -7323,7 +7406,7 @@ const DotButtonToggle = ({
|
|
|
7323
7406
|
size = 'medium',
|
|
7324
7407
|
value
|
|
7325
7408
|
}) => {
|
|
7326
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
7409
|
+
const rootClasses = useStylesWithRootClass(rootClassName$S, className);
|
|
7327
7410
|
const renderToggleButton = ({
|
|
7328
7411
|
ariaLabel: optionAriaLabel,
|
|
7329
7412
|
badgeContent: optionBadgeContent,
|
|
@@ -7406,12 +7489,12 @@ const TooltipToggleButton = forwardRef((_a, ref) => {
|
|
|
7406
7489
|
}));
|
|
7407
7490
|
});
|
|
7408
7491
|
|
|
7409
|
-
const rootClassName$
|
|
7492
|
+
const rootClassName$R = 'dot-card';
|
|
7410
7493
|
const StyledCard = styled(Card)`
|
|
7411
7494
|
${({
|
|
7412
7495
|
theme
|
|
7413
7496
|
}) => css`
|
|
7414
|
-
&.${rootClassName$
|
|
7497
|
+
&.${rootClassName$R} {
|
|
7415
7498
|
background-color: ${theme.palette.figma.background.level1.white};
|
|
7416
7499
|
}
|
|
7417
7500
|
`}
|
|
@@ -7423,7 +7506,7 @@ const DotCard = ({
|
|
|
7423
7506
|
className,
|
|
7424
7507
|
'data-testid': dataTestId
|
|
7425
7508
|
}) => {
|
|
7426
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
7509
|
+
const rootClasses = useStylesWithRootClass(rootClassName$R, className);
|
|
7427
7510
|
return jsx(StyledCard, {
|
|
7428
7511
|
"aria-label": ariaLabel,
|
|
7429
7512
|
classes: {
|
|
@@ -7452,12 +7535,12 @@ const DotCardContent = ({
|
|
|
7452
7535
|
});
|
|
7453
7536
|
};
|
|
7454
7537
|
|
|
7455
|
-
const rootClassName$
|
|
7538
|
+
const rootClassName$Q = 'dot-card-footer';
|
|
7456
7539
|
const StyledDiv = styled.div`
|
|
7457
7540
|
${({
|
|
7458
7541
|
theme
|
|
7459
7542
|
}) => css`
|
|
7460
|
-
&.${rootClassName$
|
|
7543
|
+
&.${rootClassName$Q} {
|
|
7461
7544
|
padding: ${theme.spacing(2)};
|
|
7462
7545
|
}
|
|
7463
7546
|
`}
|
|
@@ -7469,7 +7552,7 @@ const DotCardFooter = ({
|
|
|
7469
7552
|
className,
|
|
7470
7553
|
'data-testid': dataTestId
|
|
7471
7554
|
}) => {
|
|
7472
|
-
const rootClasses = useStylesWithRootClass(rootClassName$
|
|
7555
|
+
const rootClasses = useStylesWithRootClass(rootClassName$Q, className);
|
|
7473
7556
|
return jsx(StyledDiv, {
|
|
7474
7557
|
"aria-label": ariaLabel,
|
|
7475
7558
|
className: rootClasses,
|
|
@@ -7478,6 +7561,23 @@ const DotCardFooter = ({
|
|
|
7478
7561
|
});
|
|
7479
7562
|
};
|
|
7480
7563
|
|
|
7564
|
+
const rootClassName$P = 'dot-card-header';
|
|
7565
|
+
const StyledCardHeader = styled(CardHeader)`
|
|
7566
|
+
${({
|
|
7567
|
+
theme
|
|
7568
|
+
}) => css`
|
|
7569
|
+
&.${rootClassName$P} {
|
|
7570
|
+
.MuiCardHeader-content {
|
|
7571
|
+
overflow-x: hidden;
|
|
7572
|
+
|
|
7573
|
+
.dot-card-subheader {
|
|
7574
|
+
color: ${theme.palette.figma.typography.gray};
|
|
7575
|
+
}
|
|
7576
|
+
}
|
|
7577
|
+
}
|
|
7578
|
+
`}
|
|
7579
|
+
`;
|
|
7580
|
+
|
|
7481
7581
|
const DotCardHeader = ({
|
|
7482
7582
|
action,
|
|
7483
7583
|
ariaLabel,
|
|
@@ -7489,16 +7589,11 @@ const DotCardHeader = ({
|
|
|
7489
7589
|
title,
|
|
7490
7590
|
titleSize = 'large'
|
|
7491
7591
|
}) => {
|
|
7492
|
-
const rootClasses = useStylesWithRootClass(
|
|
7493
|
-
const
|
|
7494
|
-
const
|
|
7495
|
-
variant: titleVariant
|
|
7496
|
-
};
|
|
7592
|
+
const rootClasses = useStylesWithRootClass(rootClassName$P, className);
|
|
7593
|
+
const nonSmallTitleSize = titleSize === 'medium' ? 'h3' : 'h2';
|
|
7594
|
+
const titleVariant = titleSize === 'small' ? 'h4' : nonSmallTitleSize;
|
|
7497
7595
|
const subheaderVariant = subheaderSize === 'small' ? 'body2' : 'body1';
|
|
7498
|
-
|
|
7499
|
-
variant: subheaderVariant
|
|
7500
|
-
};
|
|
7501
|
-
return jsx(CardHeader, {
|
|
7596
|
+
return jsx(StyledCardHeader, {
|
|
7502
7597
|
action: action,
|
|
7503
7598
|
"aria-label": ariaLabel,
|
|
7504
7599
|
avatar: avatar,
|
|
@@ -7506,10 +7601,26 @@ const DotCardHeader = ({
|
|
|
7506
7601
|
root: rootClasses
|
|
7507
7602
|
},
|
|
7508
7603
|
"data-testid": dataTestId,
|
|
7509
|
-
subheader:
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7604
|
+
subheader: jsx(DotTooltip, {
|
|
7605
|
+
hoverVisibility: "overflow",
|
|
7606
|
+
title: subheader,
|
|
7607
|
+
children: jsx(DotTypography, {
|
|
7608
|
+
className: "dot-card-subheader",
|
|
7609
|
+
children: subheader,
|
|
7610
|
+
noWrap: true,
|
|
7611
|
+
variant: subheaderVariant
|
|
7612
|
+
})
|
|
7613
|
+
}),
|
|
7614
|
+
title: jsx(DotTooltip, {
|
|
7615
|
+
hoverVisibility: "overflow",
|
|
7616
|
+
title: title,
|
|
7617
|
+
children: jsx(DotTypography, {
|
|
7618
|
+
className: "dot-card-header-title",
|
|
7619
|
+
children: title,
|
|
7620
|
+
noWrap: true,
|
|
7621
|
+
variant: titleVariant
|
|
7622
|
+
})
|
|
7623
|
+
})
|
|
7513
7624
|
});
|
|
7514
7625
|
};
|
|
7515
7626
|
|
|
@@ -8806,49 +8917,6 @@ function request(options) {
|
|
|
8806
8917
|
});
|
|
8807
8918
|
}
|
|
8808
8919
|
|
|
8809
|
-
class CategoriesService {
|
|
8810
|
-
/**
|
|
8811
|
-
* Get a list of Categories by Application type.
|
|
8812
|
-
* Return a list of Categories by Application type.
|
|
8813
|
-
* @returns AllCategoriesResponse OK
|
|
8814
|
-
* @returns Error Default error response
|
|
8815
|
-
* @throws ApiError
|
|
8816
|
-
*/
|
|
8817
|
-
static getCategoriesService() {
|
|
8818
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
8819
|
-
const result = yield request({
|
|
8820
|
-
method: 'GET',
|
|
8821
|
-
path: `/metadata/bi/categories`,
|
|
8822
|
-
errors: {
|
|
8823
|
-
401: `Could not resolve a valid Tenant from the provided API Token.`
|
|
8824
|
-
}
|
|
8825
|
-
});
|
|
8826
|
-
return result.body;
|
|
8827
|
-
});
|
|
8828
|
-
}
|
|
8829
|
-
/**
|
|
8830
|
-
* Get Categories for a single application type.
|
|
8831
|
-
* Return all Categories for a single application type.
|
|
8832
|
-
* @param appType
|
|
8833
|
-
* @returns CategoriesResponse OK
|
|
8834
|
-
* @returns Error Default error response
|
|
8835
|
-
* @throws ApiError
|
|
8836
|
-
*/
|
|
8837
|
-
static getCategoriesService1(appType) {
|
|
8838
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
8839
|
-
const result = yield request({
|
|
8840
|
-
method: 'GET',
|
|
8841
|
-
path: `/metadata/bi/categories/${appType}`,
|
|
8842
|
-
errors: {
|
|
8843
|
-
400: `Given app type is not valid.`,
|
|
8844
|
-
401: `Could not resolve a valid Tenant from the provided API Token.`
|
|
8845
|
-
}
|
|
8846
|
-
});
|
|
8847
|
-
return result.body;
|
|
8848
|
-
});
|
|
8849
|
-
}
|
|
8850
|
-
}
|
|
8851
|
-
|
|
8852
8920
|
class DashboardsService {
|
|
8853
8921
|
/**
|
|
8854
8922
|
* Get a list of Dashboards.
|
|
@@ -8858,8 +8926,8 @@ class DashboardsService {
|
|
|
8858
8926
|
* @param sort Sort ordering to apply to the query.
|
|
8859
8927
|
* @param filter List of filters (each filter is a separate query param, and they are OR'ed).
|
|
8860
8928
|
*
|
|
8861
|
-
* * **Filterable field names**: author_fullname, author_id, bi_type, categories, created_dt, description, external_embedding_id, external_id, id, is_ootb_dashboard, lifecycle_state, name, target_apps, updated_dt
|
|
8862
|
-
* * **Searchable field names**: author_fullname, categories, description, name
|
|
8929
|
+
* * **Filterable field names**: author_fullname, author_id, bi_type, categories, created_dt, description, external_embedding_id, external_id, id, is_ootb_dashboard, lifecycle_state, name, target_apps, updated_by_fullname, updated_by_id, updated_dt
|
|
8930
|
+
* * **Searchable field names**: author_fullname, categories, description, name, updated_by_fullname
|
|
8863
8931
|
*
|
|
8864
8932
|
* @param favorite Boolean flag to only return dashboards marked as favorites.
|
|
8865
8933
|
* @param q Case-insensitive search of all text fields.
|
|
@@ -9100,25 +9168,31 @@ class DashboardsService {
|
|
|
9100
9168
|
}
|
|
9101
9169
|
/**
|
|
9102
9170
|
* Get Metadata (categories and authors)
|
|
9103
|
-
* Return all Metadata for
|
|
9171
|
+
* Return all Metadata for dashboards optionally filtered by the given parameters
|
|
9172
|
+
* @param filter List of filters (each filter is a separate query param, and they are OR'ed).
|
|
9173
|
+
*
|
|
9174
|
+
* * **Filterable field names**: author_fullname, bi_type, categories, created_dt, description, is_ootb_dashboard, lifecycle_state, name, updated_by_fullname, updated_dt
|
|
9175
|
+
* * **Searchable field names**: author_fullname, categories, description, name
|
|
9176
|
+
*
|
|
9177
|
+
* @param targetApp String match on the Dashboard target application - 'AGILITY', 'CONTINUOUSTEST', 'DEPLOY', 'RELEASE' or 'TEAMFORGE'.
|
|
9104
9178
|
* @param biType String match on Dashboard bi type - 'MICROSTRATEGY'.
|
|
9105
9179
|
* @param isOotbDashboard Boolean match on Dashboard OOTB status.
|
|
9106
9180
|
* @param lifecycleState String match on Dashboard lifecycle state - 'DRAFT' or 'PUBLISHED'.
|
|
9107
|
-
* @param targetApp String match on the Dashboard target application - 'AGILITY', 'CONTINUOUSTEST', 'DEPLOY' or 'RELEASE'.
|
|
9108
9181
|
* @returns MetadataResponse OK
|
|
9109
9182
|
* @returns Error Default error response
|
|
9110
9183
|
* @throws ApiError
|
|
9111
9184
|
*/
|
|
9112
|
-
static
|
|
9185
|
+
static getDashboardsMetadata(filter, targetApp = null, biType = 'MICROSTRATEGY', isOotbDashboard = null, lifecycleState = null) {
|
|
9113
9186
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9114
9187
|
const result = yield request({
|
|
9115
9188
|
method: 'GET',
|
|
9116
9189
|
path: `/metadata/bi/dashboards/metadata`,
|
|
9117
9190
|
query: {
|
|
9191
|
+
filter: filter,
|
|
9192
|
+
target_app: targetApp,
|
|
9118
9193
|
bi_type: biType,
|
|
9119
9194
|
is_ootb_dashboard: isOotbDashboard,
|
|
9120
|
-
lifecycle_state: lifecycleState
|
|
9121
|
-
target_app: targetApp
|
|
9195
|
+
lifecycle_state: lifecycleState
|
|
9122
9196
|
},
|
|
9123
9197
|
errors: {
|
|
9124
9198
|
400: `Given query params are not valid.`,
|
|
@@ -9269,7 +9343,7 @@ const helpContent = {
|
|
|
9269
9343
|
id: 'test-help-content-1',
|
|
9270
9344
|
content: '<html><h1>Test</h1></html>'
|
|
9271
9345
|
};
|
|
9272
|
-
|
|
9346
|
+
const dashboard1 = {
|
|
9273
9347
|
author_fullname: 'Dashboard1 Author',
|
|
9274
9348
|
author_id: 'id1a',
|
|
9275
9349
|
target_apps: ['AGILITY'],
|
|
@@ -9294,8 +9368,8 @@ const helpContent = {
|
|
|
9294
9368
|
help_content_id: helpContent.id,
|
|
9295
9369
|
filter_configuration: [],
|
|
9296
9370
|
favorite: false
|
|
9297
|
-
}
|
|
9298
|
-
|
|
9371
|
+
};
|
|
9372
|
+
const dashboard2 = {
|
|
9299
9373
|
author_fullname: 'Dashboard2 Author',
|
|
9300
9374
|
author_id: 'id2a',
|
|
9301
9375
|
target_apps: ['AGILITY'],
|
|
@@ -9318,8 +9392,8 @@ const helpContent = {
|
|
|
9318
9392
|
help_content_id: helpContent.id,
|
|
9319
9393
|
filter_configuration: [],
|
|
9320
9394
|
favorite: true
|
|
9321
|
-
}
|
|
9322
|
-
|
|
9395
|
+
};
|
|
9396
|
+
const dashboard3 = {
|
|
9323
9397
|
author_fullname: 'Dashboard3 Author',
|
|
9324
9398
|
author_id: 'id3a',
|
|
9325
9399
|
target_apps: ['AGILITY'],
|
|
@@ -9342,7 +9416,7 @@ const helpContent = {
|
|
|
9342
9416
|
help_content_id: helpContent.id,
|
|
9343
9417
|
filter_configuration: [],
|
|
9344
9418
|
favorite: false
|
|
9345
|
-
}
|
|
9419
|
+
};
|
|
9346
9420
|
const getCategoriesMock = {
|
|
9347
9421
|
categories: {
|
|
9348
9422
|
AGILITY: ['Scrum Master', 'DevOps Manager', 'Release Train Engineer', 'Agility Analytics'],
|
|
@@ -9352,6 +9426,16 @@ const getCategoriesMock = {
|
|
|
9352
9426
|
TEAMFORGE: ['Scrum Master']
|
|
9353
9427
|
}
|
|
9354
9428
|
};
|
|
9429
|
+
const getAuthorsMock = [{
|
|
9430
|
+
id: dashboard1.author_id,
|
|
9431
|
+
full_name: dashboard1.author_fullname
|
|
9432
|
+
}, {
|
|
9433
|
+
id: dashboard2.author_id,
|
|
9434
|
+
full_name: dashboard2.author_fullname
|
|
9435
|
+
}, {
|
|
9436
|
+
id: dashboard3.author_id,
|
|
9437
|
+
full_name: dashboard3.author_fullname
|
|
9438
|
+
}];
|
|
9355
9439
|
const accountId = 'acct1';
|
|
9356
9440
|
const applicationId = 'app1';
|
|
9357
9441
|
const nullStr = null;
|
|
@@ -9412,6 +9496,9 @@ function updateItemInArray(elements, updatedItem, idProp) {
|
|
|
9412
9496
|
}
|
|
9413
9497
|
return elements;
|
|
9414
9498
|
}
|
|
9499
|
+
const authorSort = (a, b) => a.full_name.localeCompare(b.full_name);
|
|
9500
|
+
const categorySort = (a, b) => a.localeCompare(b);
|
|
9501
|
+
const metadataKey = isPublishedOnly => isPublishedOnly ? 'published' : 'all';
|
|
9415
9502
|
const handleUpdateDashboard = (dashboards, updatedDashboard) => {
|
|
9416
9503
|
updateItemInArray(dashboards, updatedDashboard, ID);
|
|
9417
9504
|
return dashboards;
|
|
@@ -9440,18 +9527,37 @@ const DotMetadataApiProvider = ({
|
|
|
9440
9527
|
cancelablePromise
|
|
9441
9528
|
} = useCancelablePromise();
|
|
9442
9529
|
const [accountId, setAccountId] = useState(accountOverrideId);
|
|
9443
|
-
const [categories, setCategories] = useState(null);
|
|
9444
|
-
const [categoriesLoading, setCategoriesLoading] = useState(true);
|
|
9445
9530
|
const [dashboards, setDashboards] = useState();
|
|
9446
9531
|
const [dashboardsLoading, setDashboardsLoading] = useState(true);
|
|
9532
|
+
const [metadata, setMetadata] = useState(null);
|
|
9533
|
+
const [metadataLoading, setMetadataLoading] = useState(true);
|
|
9447
9534
|
const [helpContentLoading, setHelpContentLoading] = useState(true);
|
|
9448
9535
|
const [openedDashboardDetails, setOpenedDashboardDetails] = useState(null);
|
|
9449
9536
|
const [dashboardsError, setDashboardsError] = useState(null);
|
|
9450
9537
|
const [platformConsoleUrl, setPlatformConsoleUrl] = useState(null);
|
|
9451
9538
|
const MOCK_API_URL = 'https://demo-mock-api';
|
|
9539
|
+
const retrieveMetadata = useCallback((appType, isPublishedOnly) => {
|
|
9540
|
+
setMetadataLoading(true);
|
|
9541
|
+
return cancelablePromise(DashboardsService.getDashboardsMetadata(undefined, appType, undefined, undefined, isPublishedOnly ? 'PUBLISHED' : undefined)).then(response => {
|
|
9542
|
+
setMetadataLoading(false);
|
|
9543
|
+
setDashboardsError(null);
|
|
9544
|
+
const key = metadataKey(isPublishedOnly);
|
|
9545
|
+
setMetadata(orig => {
|
|
9546
|
+
const appTypeMetadata = orig && appType in orig ? Object.assign({}, orig[appType]) : {};
|
|
9547
|
+
appTypeMetadata[key] = response;
|
|
9548
|
+
return Object.assign(Object.assign({}, orig), {
|
|
9549
|
+
[appType]: appTypeMetadata
|
|
9550
|
+
});
|
|
9551
|
+
});
|
|
9552
|
+
return response;
|
|
9553
|
+
}).catch(error => {
|
|
9554
|
+
setMetadataLoading(false);
|
|
9555
|
+
setDashboardsError(error);
|
|
9556
|
+
return null;
|
|
9557
|
+
});
|
|
9558
|
+
}, []);
|
|
9452
9559
|
const memoizedValues = useMemo(() => ({
|
|
9453
|
-
|
|
9454
|
-
categoriesLoading,
|
|
9560
|
+
metadataLoading,
|
|
9455
9561
|
dashboardsError,
|
|
9456
9562
|
dashboardsLoading,
|
|
9457
9563
|
helpContentLoading,
|
|
@@ -9547,25 +9653,64 @@ const DotMetadataApiProvider = ({
|
|
|
9547
9653
|
return response;
|
|
9548
9654
|
}).catch(error => setDashboardsError(error));
|
|
9549
9655
|
}),
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
if (
|
|
9656
|
+
getAuthors: (appType, isPublishedOnly = false) => {
|
|
9657
|
+
const key = metadataKey(isPublishedOnly);
|
|
9658
|
+
if (metadata && appType in metadata) {
|
|
9659
|
+
const appTypeMetadata = metadata[appType];
|
|
9660
|
+
if (key in appTypeMetadata) {
|
|
9661
|
+
appTypeMetadata[key]['authors'].sort(authorSort);
|
|
9662
|
+
return Promise.resolve(appTypeMetadata[key]['authors']);
|
|
9663
|
+
}
|
|
9664
|
+
} else if (OpenAPI.BASE === MOCK_API_URL) {
|
|
9553
9665
|
setDashboardsError(null);
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
9666
|
+
setMetadataLoading(false);
|
|
9667
|
+
return Promise.resolve(appType == 'AGILITY' ? getAuthorsMock : []);
|
|
9668
|
+
}
|
|
9669
|
+
return cancelablePromise(retrieveMetadata(appType, isPublishedOnly)).then(response => {
|
|
9670
|
+
response.authors.sort(authorSort);
|
|
9671
|
+
return response.authors;
|
|
9672
|
+
});
|
|
9673
|
+
},
|
|
9674
|
+
getCategories: (appType, isPublishedOnly = false) => __awaiter(void 0, void 0, void 0, function* () {
|
|
9675
|
+
const key = metadataKey(isPublishedOnly);
|
|
9676
|
+
if (metadata && appType in metadata) {
|
|
9677
|
+
const appTypeMetadata = metadata[appType];
|
|
9678
|
+
if (key in appTypeMetadata) {
|
|
9679
|
+
appTypeMetadata[key]['categories'].sort(categorySort);
|
|
9680
|
+
return Promise.resolve(appTypeMetadata[key]['categories']);
|
|
9681
|
+
}
|
|
9682
|
+
} else if (OpenAPI.BASE === MOCK_API_URL) {
|
|
9683
|
+
setDashboardsError(null);
|
|
9684
|
+
setMetadataLoading(false);
|
|
9685
|
+
const categories = getCategoriesMock.categories[appType];
|
|
9686
|
+
setMetadata(orig => {
|
|
9687
|
+
if (orig && appType in orig) {
|
|
9688
|
+
const appTypeCategories = orig[appType];
|
|
9689
|
+
appTypeCategories[key]['categories'] = categories;
|
|
9690
|
+
return Object.assign(Object.assign({}, orig), {
|
|
9691
|
+
[appType]: appTypeCategories
|
|
9692
|
+
});
|
|
9693
|
+
}
|
|
9694
|
+
return orig ? Object.assign(Object.assign({}, orig), {
|
|
9695
|
+
[appType]: {
|
|
9696
|
+
[key]: {
|
|
9697
|
+
categories
|
|
9698
|
+
}
|
|
9699
|
+
}
|
|
9700
|
+
}) : {
|
|
9701
|
+
[appType]: {
|
|
9702
|
+
[key]: {
|
|
9703
|
+
categories
|
|
9704
|
+
}
|
|
9705
|
+
}
|
|
9706
|
+
};
|
|
9567
9707
|
});
|
|
9708
|
+
return Promise.resolve(categories);
|
|
9568
9709
|
}
|
|
9710
|
+
return cancelablePromise(retrieveMetadata(appType, isPublishedOnly)).then(response => {
|
|
9711
|
+
response === null || response === void 0 ? void 0 : response.categories.sort(categorySort);
|
|
9712
|
+
return response === null || response === void 0 ? void 0 : response.categories;
|
|
9713
|
+
});
|
|
9569
9714
|
}),
|
|
9570
9715
|
getDashboardHelpContent: helpContentId => __awaiter(void 0, void 0, void 0, function* () {
|
|
9571
9716
|
setHelpContentLoading(true);
|
|
@@ -9584,7 +9729,7 @@ const DotMetadataApiProvider = ({
|
|
|
9584
9729
|
});
|
|
9585
9730
|
}
|
|
9586
9731
|
})
|
|
9587
|
-
}), [
|
|
9732
|
+
}), [metadata, metadataLoading, dashboardsError, dashboardsLoading, openedDashboardDetails, platformConsoleUrl]);
|
|
9588
9733
|
if (apiUrl && OpenAPI.BASE !== apiUrl) {
|
|
9589
9734
|
OpenAPI.BASE = apiUrl;
|
|
9590
9735
|
}
|
|
@@ -9645,7 +9790,7 @@ const StyledSnackbar = styled(Snackbar)`
|
|
|
9645
9790
|
.MuiAlert-message {
|
|
9646
9791
|
word-break: break-word;
|
|
9647
9792
|
}
|
|
9648
|
-
.${rootClassName$
|
|
9793
|
+
.${rootClassName$1f} {
|
|
9649
9794
|
align-items: flex-start;
|
|
9650
9795
|
}
|
|
9651
9796
|
&.MuiSnackbar-anchorOriginTopLeft,
|
|
@@ -10165,6 +10310,41 @@ const DotDashboardDetails = _a => {
|
|
|
10165
10310
|
return null;
|
|
10166
10311
|
};
|
|
10167
10312
|
|
|
10313
|
+
function DashboardCategoriesAutoComplete(_a) {
|
|
10314
|
+
var {
|
|
10315
|
+
freesolo: _freesolo,
|
|
10316
|
+
actionItem: _actionItem,
|
|
10317
|
+
onInputChange,
|
|
10318
|
+
onNewCategory
|
|
10319
|
+
} = _a,
|
|
10320
|
+
args = __rest(_a, ["freesolo", "actionItem", "onInputChange", "onNewCategory"]);
|
|
10321
|
+
const getActionItemNode = value => {
|
|
10322
|
+
return value ? jsxs("span", {
|
|
10323
|
+
children: ["Create new ", jsx("strong", {
|
|
10324
|
+
children: value
|
|
10325
|
+
}), " category"]
|
|
10326
|
+
}) : 'Enter a label to create new category';
|
|
10327
|
+
};
|
|
10328
|
+
const [actionItemText, setActionItemText] = useState(getActionItemNode(''));
|
|
10329
|
+
const handleActionItemClick = newItem => {
|
|
10330
|
+
if (newItem && onNewCategory) {
|
|
10331
|
+
onNewCategory(newItem);
|
|
10332
|
+
}
|
|
10333
|
+
};
|
|
10334
|
+
const customActionItem = {
|
|
10335
|
+
text: actionItemText,
|
|
10336
|
+
onClick: handleActionItemClick
|
|
10337
|
+
};
|
|
10338
|
+
return jsx(DotAutoComplete, Object.assign({}, args, {
|
|
10339
|
+
freesolo: false,
|
|
10340
|
+
actionItem: customActionItem,
|
|
10341
|
+
onInputChange: (event, value, reason) => {
|
|
10342
|
+
setActionItemText(getActionItemNode(value));
|
|
10343
|
+
onInputChange && onInputChange(event, value, reason);
|
|
10344
|
+
}
|
|
10345
|
+
}));
|
|
10346
|
+
}
|
|
10347
|
+
|
|
10168
10348
|
const DotInputSelect = ({
|
|
10169
10349
|
ariaLabel,
|
|
10170
10350
|
autoFocus,
|
|
@@ -10405,6 +10585,12 @@ function DotDashboardDialog({
|
|
|
10405
10585
|
}));
|
|
10406
10586
|
setIsDirty(true);
|
|
10407
10587
|
}, [formValues]);
|
|
10588
|
+
const handleNewCategory = useCallback(newCategory => {
|
|
10589
|
+
setFormValues(orig => Object.assign(Object.assign({}, orig), {
|
|
10590
|
+
categories: [...categories, newCategory]
|
|
10591
|
+
}));
|
|
10592
|
+
setIsDirty(true);
|
|
10593
|
+
}, [categories]);
|
|
10408
10594
|
const getCategoryValues = useCallback(() => categories.map(category => ({
|
|
10409
10595
|
title: category
|
|
10410
10596
|
})), [categories]);
|
|
@@ -10504,11 +10690,12 @@ function DotDashboardDialog({
|
|
|
10504
10690
|
}), jsx(DotTypography, {
|
|
10505
10691
|
variant: "body2",
|
|
10506
10692
|
children: "Please select the appropriate categories"
|
|
10507
|
-
}), jsx(
|
|
10693
|
+
}), jsx(DashboardCategoriesAutoComplete, {
|
|
10508
10694
|
"data-testid": "dashboard-dialog-categories-input",
|
|
10509
10695
|
filterSelectedOptions: true,
|
|
10510
10696
|
inputId: "dashboard-dialog-categories-input",
|
|
10511
10697
|
onChange: handleChangeCategories,
|
|
10698
|
+
onNewCategory: handleNewCategory,
|
|
10512
10699
|
options: getAvailableCategoryOptions(),
|
|
10513
10700
|
placeholder: "Select categories",
|
|
10514
10701
|
label: "Category",
|
|
@@ -10598,7 +10785,6 @@ const productNameCategoryMap = {
|
|
|
10598
10785
|
*/
|
|
10599
10786
|
function ActivePublishMessage({
|
|
10600
10787
|
applicationList,
|
|
10601
|
-
categories,
|
|
10602
10788
|
dashboardName,
|
|
10603
10789
|
initialCategories,
|
|
10604
10790
|
published,
|
|
@@ -10610,6 +10796,9 @@ function ActivePublishMessage({
|
|
|
10610
10796
|
const [appNameMap, setAppNameMap] = useState({});
|
|
10611
10797
|
const [appNameMapLoading, setAppNameMapLoading] = useState(true);
|
|
10612
10798
|
const [categoryOptions, setCategoryOptions] = useState([]);
|
|
10799
|
+
const {
|
|
10800
|
+
getCategories
|
|
10801
|
+
} = useDotMetadataApiContext();
|
|
10613
10802
|
const appOptions = applicationList.map((application, index) => {
|
|
10614
10803
|
return {
|
|
10615
10804
|
title: application.name,
|
|
@@ -10628,23 +10817,24 @@ function ActivePublishMessage({
|
|
|
10628
10817
|
}
|
|
10629
10818
|
}, [applicationList]);
|
|
10630
10819
|
useEffect(() => {
|
|
10631
|
-
const selectedCategoryOptions = [];
|
|
10632
10820
|
if (selectedApp) {
|
|
10633
10821
|
if (selectedApp.logo_product_name in productNameCategoryMap) {
|
|
10822
|
+
const selectedCategoryOptions = [];
|
|
10634
10823
|
const categoryKey = productNameCategoryMap[selectedApp.logo_product_name];
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10639
|
-
|
|
10640
|
-
|
|
10824
|
+
getCategories(categoryKey).then(appCategories => {
|
|
10825
|
+
const newCategoryOptions = appCategories.map(category => ({
|
|
10826
|
+
title: category
|
|
10827
|
+
}));
|
|
10828
|
+
setCategoryOptions(newCategoryOptions);
|
|
10829
|
+
selectedCategoryOptions.push(...newCategoryOptions.filter(o => initialCategories.includes(o.title)));
|
|
10830
|
+
setSelectedCategories(selectedCategoryOptions);
|
|
10831
|
+
});
|
|
10641
10832
|
} else {
|
|
10642
10833
|
setCategoryOptions([]);
|
|
10643
10834
|
}
|
|
10644
10835
|
} else {
|
|
10645
10836
|
setCategoryOptions([]);
|
|
10646
10837
|
}
|
|
10647
|
-
setSelectedCategories(selectedCategoryOptions);
|
|
10648
10838
|
}, [selectedApp]);
|
|
10649
10839
|
useEffect(() => {
|
|
10650
10840
|
const selectedAppCategories = selectedCategories.map(c => c.title);
|
|
@@ -10669,6 +10859,11 @@ function ActivePublishMessage({
|
|
|
10669
10859
|
const handleChangeCategories = useCallback((_event, options, _reason) => {
|
|
10670
10860
|
setSelectedCategories(options);
|
|
10671
10861
|
}, []);
|
|
10862
|
+
const handleNewCategory = useCallback(newCategory => {
|
|
10863
|
+
setSelectedCategories(orig => [...orig, {
|
|
10864
|
+
title: newCategory
|
|
10865
|
+
}]);
|
|
10866
|
+
}, [selectedCategories]);
|
|
10672
10867
|
if (published) {
|
|
10673
10868
|
return jsxs(StyledPublishConfirmDiv, {
|
|
10674
10869
|
children: [jsxs(DotAlertBanner, {
|
|
@@ -10745,10 +10940,11 @@ function ActivePublishMessage({
|
|
|
10745
10940
|
variant: "circular",
|
|
10746
10941
|
size: "large"
|
|
10747
10942
|
})]
|
|
10748
|
-
}), (
|
|
10943
|
+
}), (categoryOptions === null || categoryOptions === void 0 ? void 0 : categoryOptions.length) > 0 && jsx(DashboardCategoriesAutoComplete, {
|
|
10749
10944
|
"data-testid": "publish-categories-input",
|
|
10750
10945
|
inputId: "publish-categories-input",
|
|
10751
10946
|
onChange: handleChangeCategories,
|
|
10947
|
+
onNewCategory: handleNewCategory,
|
|
10752
10948
|
options: categoryOptions,
|
|
10753
10949
|
placeholder: "Select categories",
|
|
10754
10950
|
value: selectedCategories,
|
|
@@ -10809,7 +11005,6 @@ function ActiveUnpublishMessage({
|
|
|
10809
11005
|
}
|
|
10810
11006
|
function DotDashboardPublishConfirm({
|
|
10811
11007
|
applicationList,
|
|
10812
|
-
categories,
|
|
10813
11008
|
dashboardToPublish,
|
|
10814
11009
|
dashboardToUnpublish,
|
|
10815
11010
|
onClose,
|
|
@@ -10890,6 +11085,7 @@ function DotDashboardPublishConfirm({
|
|
|
10890
11085
|
setPublishAppInstance(selectedApplication);
|
|
10891
11086
|
setPublishCategories(selectedCategories);
|
|
10892
11087
|
}, []);
|
|
11088
|
+
const canSubmit = publishAppInstance && !((publishAppInstance === null || publishAppInstance === void 0 ? void 0 : publishAppInstance.logo_product_name) && publishAppInstance.logo_product_name in productNameCategoryMap && publishCategories.length === 0);
|
|
10893
11089
|
return jsxs(Fragment, {
|
|
10894
11090
|
children: [dashboardToPublish !== null && jsx(DotDialog, {
|
|
10895
11091
|
cancelButtonVisible: !published,
|
|
@@ -10899,14 +11095,13 @@ function DotDashboardPublishConfirm({
|
|
|
10899
11095
|
title: "Publish to application",
|
|
10900
11096
|
submitButtonProps: {
|
|
10901
11097
|
'data-testid': 'publish-confirm-button',
|
|
10902
|
-
disabled:
|
|
11098
|
+
disabled: !canSubmit,
|
|
10903
11099
|
label: published ? 'Got it' : 'Publish'
|
|
10904
11100
|
},
|
|
10905
11101
|
onCancel: handleCancelPublish,
|
|
10906
11102
|
onSubmit: published ? handleCancelPublish : handlePublish,
|
|
10907
11103
|
children: jsx(ActivePublishMessage, {
|
|
10908
11104
|
applicationList: filteredApplications,
|
|
10909
|
-
categories: categories,
|
|
10910
11105
|
dashboardName: dashboardToPublish === null || dashboardToPublish === void 0 ? void 0 : dashboardToPublish.name,
|
|
10911
11106
|
initialCategories: publishCategories,
|
|
10912
11107
|
published: published,
|
|
@@ -11139,7 +11334,6 @@ function CloseButton({
|
|
|
11139
11334
|
}
|
|
11140
11335
|
function DotDashboardActions({
|
|
11141
11336
|
applications,
|
|
11142
|
-
categories,
|
|
11143
11337
|
dashboard,
|
|
11144
11338
|
isEdit = false,
|
|
11145
11339
|
canEdit = false,
|
|
@@ -11147,8 +11341,7 @@ function DotDashboardActions({
|
|
|
11147
11341
|
onFavorite,
|
|
11148
11342
|
onStatusChanged,
|
|
11149
11343
|
onDuplicated,
|
|
11150
|
-
onViewMode
|
|
11151
|
-
onDetails
|
|
11344
|
+
onViewMode
|
|
11152
11345
|
}) {
|
|
11153
11346
|
// NOTE: useState functions need to stay at the top of the file so that
|
|
11154
11347
|
// they are evaluated before any context imports. If they are evaluated
|
|
@@ -11156,10 +11349,20 @@ function DotDashboardActions({
|
|
|
11156
11349
|
const [dashboardToCopy, setDashboardToCopy] = useState(null);
|
|
11157
11350
|
const [dashboardToPublish, setDashboardToPublish] = useState(null);
|
|
11158
11351
|
const [dashboardToUnpublish, setDashboardToUnpublish] = useState(null);
|
|
11352
|
+
const [appCategories, setAppCategories] = useState(null);
|
|
11159
11353
|
const {
|
|
11160
11354
|
duplicateDashboard,
|
|
11355
|
+
getCategories,
|
|
11161
11356
|
setOpenedDashboardDetails
|
|
11162
11357
|
} = useDotMetadataApiContext();
|
|
11358
|
+
useEffect(() => {
|
|
11359
|
+
var _a;
|
|
11360
|
+
if (dashboard && ((_a = dashboard.target_apps) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
11361
|
+
getCategories(dashboard.target_apps[0]).then(categories => {
|
|
11362
|
+
setAppCategories(categories);
|
|
11363
|
+
});
|
|
11364
|
+
}
|
|
11365
|
+
}, [dashboard]);
|
|
11163
11366
|
const handlePublishConfirm = useCallback(publishedDashboard => {
|
|
11164
11367
|
setDashboardToPublish(null);
|
|
11165
11368
|
setDashboardToUnpublish(null);
|
|
@@ -11198,14 +11401,13 @@ function DotDashboardActions({
|
|
|
11198
11401
|
"data-testid": "dot-dashboard-actions",
|
|
11199
11402
|
children: [jsx(DotDashboardPublishConfirm, {
|
|
11200
11403
|
applicationList: applications,
|
|
11201
|
-
categories: categories,
|
|
11202
11404
|
dashboardToPublish: dashboardToPublish,
|
|
11203
11405
|
dashboardToUnpublish: dashboardToUnpublish,
|
|
11204
11406
|
onClose: handlePublishConfirmClose,
|
|
11205
11407
|
onStatusChanged: handlePublishConfirm
|
|
11206
|
-
}),
|
|
11408
|
+
}), appCategories && dashboardToCopy && jsx(DotDashboardDialog, {
|
|
11207
11409
|
title: "Duplicate dashboard",
|
|
11208
|
-
availableCategories:
|
|
11410
|
+
availableCategories: appCategories,
|
|
11209
11411
|
copyDashboard: dashboardToCopy,
|
|
11210
11412
|
open: true,
|
|
11211
11413
|
onClose: handleDuplicateClose,
|
|
@@ -11258,16 +11460,13 @@ function DotDashboardHeader({
|
|
|
11258
11460
|
loadApplications
|
|
11259
11461
|
} = useDotCoreApiContext();
|
|
11260
11462
|
const {
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
-
dashboardsError,
|
|
11264
|
-
getCategories
|
|
11463
|
+
metadataLoading,
|
|
11464
|
+
dashboardsError
|
|
11265
11465
|
} = useDotMetadataApiContext();
|
|
11266
11466
|
useEnqueueErrorMessage(!applicationsLoading && applicationsError);
|
|
11267
|
-
useEnqueueErrorMessage(!
|
|
11467
|
+
useEnqueueErrorMessage(!metadataLoading && dashboardsError);
|
|
11268
11468
|
useEffect(() => {
|
|
11269
11469
|
loadApplications(accountId);
|
|
11270
|
-
getCategories();
|
|
11271
11470
|
}, []);
|
|
11272
11471
|
return jsxs(StyledDashboardHeader, {
|
|
11273
11472
|
children: [jsx(DotTypography, {
|
|
@@ -11276,7 +11475,6 @@ function DotDashboardHeader({
|
|
|
11276
11475
|
children: dashboard === null || dashboard === void 0 ? void 0 : dashboard.name
|
|
11277
11476
|
}), jsx(DotDashboardActions, {
|
|
11278
11477
|
applications: applications,
|
|
11279
|
-
categories: categories,
|
|
11280
11478
|
dashboard: dashboard,
|
|
11281
11479
|
isEdit: isEdit,
|
|
11282
11480
|
canEdit: canEdit,
|
|
@@ -11620,7 +11818,7 @@ const StyledFormContainer = styled.div`
|
|
|
11620
11818
|
|
|
11621
11819
|
.${rootClassName$M},
|
|
11622
11820
|
.${rootClassName$O},
|
|
11623
|
-
.${rootClassName$
|
|
11821
|
+
.${rootClassName$1h},
|
|
11624
11822
|
.${rootSelectClassName},
|
|
11625
11823
|
.${rootClassName$A},
|
|
11626
11824
|
.${rootClassName$z} {
|
|
@@ -11628,7 +11826,7 @@ const StyledFormContainer = styled.div`
|
|
|
11628
11826
|
}
|
|
11629
11827
|
|
|
11630
11828
|
label
|
|
11631
|
-
+ .${rootClassName$
|
|
11829
|
+
+ .${rootClassName$1h},
|
|
11632
11830
|
label
|
|
11633
11831
|
+ .${rootSelectClassName},
|
|
11634
11832
|
label
|
|
@@ -16192,25 +16390,34 @@ const DotPopper = ({
|
|
|
16192
16390
|
className,
|
|
16193
16391
|
'data-testid': dataTestId,
|
|
16194
16392
|
disablePortal,
|
|
16393
|
+
hasArrow = false,
|
|
16195
16394
|
modifiers,
|
|
16196
16395
|
onClickAway,
|
|
16197
16396
|
open,
|
|
16198
16397
|
placement
|
|
16199
16398
|
}) => {
|
|
16200
|
-
const
|
|
16399
|
+
const [arrowRef, setArrowRef] = useState(null);
|
|
16400
|
+
const rootClasses = useStylesWithRootClass(rootClassName$19, className);
|
|
16201
16401
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16202
16402
|
const handleClickAway = event => {
|
|
16203
16403
|
if (onClickAway && (!anchorEl || !anchorEl.contains(event.currentTarget))) {
|
|
16204
16404
|
onClickAway(event);
|
|
16205
16405
|
}
|
|
16206
16406
|
};
|
|
16407
|
+
const arrowModifier = {
|
|
16408
|
+
name: 'arrow',
|
|
16409
|
+
enabled: true,
|
|
16410
|
+
options: {
|
|
16411
|
+
element: arrowRef
|
|
16412
|
+
}
|
|
16413
|
+
};
|
|
16207
16414
|
return jsx(StyledPopper$1, {
|
|
16208
16415
|
anchorEl: anchorEl,
|
|
16209
16416
|
"aria-label": ariaLabel,
|
|
16210
16417
|
className: rootClasses,
|
|
16211
16418
|
"data-testid": dataTestId,
|
|
16212
16419
|
disablePortal: disablePortal,
|
|
16213
|
-
modifiers: modifiers,
|
|
16420
|
+
modifiers: [...(modifiers || []), ...(hasArrow ? [arrowModifier] : [])],
|
|
16214
16421
|
open: open,
|
|
16215
16422
|
placement: placement,
|
|
16216
16423
|
role: "presentation",
|
|
@@ -16218,16 +16425,20 @@ const DotPopper = ({
|
|
|
16218
16425
|
children: ({
|
|
16219
16426
|
TransitionProps
|
|
16220
16427
|
}) => jsx(Fade, Object.assign({}, TransitionProps, {
|
|
16221
|
-
children:
|
|
16428
|
+
children: jsxs(Paper, {
|
|
16222
16429
|
className: "dot-popper-paper",
|
|
16223
|
-
children: jsx(
|
|
16430
|
+
children: [hasArrow && jsx(StyledArrow, {
|
|
16431
|
+
className: arrowClassName,
|
|
16432
|
+
"data-testid": "popper-arrow",
|
|
16433
|
+
ref: setArrowRef
|
|
16434
|
+
}), jsx(ClickAwayListener, {
|
|
16224
16435
|
onClickAway: handleClickAway,
|
|
16225
16436
|
children: jsx("div", {
|
|
16226
16437
|
className: "dot-popper-content-wrapper",
|
|
16227
16438
|
"data-testid": dataTestId && `${dataTestId}-content-wrapper`,
|
|
16228
16439
|
children: children
|
|
16229
16440
|
})
|
|
16230
|
-
})
|
|
16441
|
+
})]
|
|
16231
16442
|
})
|
|
16232
16443
|
}))
|
|
16233
16444
|
});
|