@deix/rossini-core 0.6.2 → 1.0.1
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/lib/package.json +1 -1
- package/lib/src/components/buttons/Avatar/Avatar.d.ts +1 -1
- package/lib/src/components/buttons/Avatar/Avatar.d.ts.map +1 -1
- package/lib/src/components/buttons/Avatar/Avatar.js +9 -11
- package/lib/src/components/buttons/LanguageSelect/LanguageSelect.d.ts +2 -2
- package/lib/src/components/buttons/LanguageSelect/LanguageSelect.js +11 -11
- package/lib/src/components/display/StyledValue/ImprovementChip.d.ts +4 -3
- package/lib/src/components/display/StyledValue/ImprovementChip.d.ts.map +1 -1
- package/lib/src/components/display/StyledValue/ImprovementChip.js +41 -19
- package/lib/src/components/display/StyledValue/StyledValue.d.ts +2 -1
- package/lib/src/components/display/StyledValue/StyledValue.d.ts.map +1 -1
- package/lib/src/components/display/StyledValue/StyledValue.js +17 -8
- package/lib/src/components/display/StyledValue/translations.json +9 -0
- package/lib/src/components/layout/MinimalLayout/MinimalLayout.d.ts.map +1 -1
- package/lib/src/components/layout/MinimalLayout/MinimalLayout.js +3 -0
- package/lib/src/components/layout/StandardLayout/StandardLayout.d.ts.map +1 -1
- package/lib/src/components/layout/StandardLayout/StandardLayout.js +4 -1
- package/lib/src/components/layout/components/Sidebar/Sidebar.d.ts +3 -3
- package/lib/src/components/layout/components/Sidebar/Sidebar.js +40 -40
- package/lib/src/components/layout/components/Topbar/Topbar.d.ts +3 -3
- package/lib/src/components/layout/components/Topbar/Topbar.js +5 -5
- package/lib/src/utils/hooks/index.d.ts +2 -2
- package/lib/src/utils/hooks/index.js +2 -2
- package/lib/src/utils/hooks/{useKeycloak.d.ts → useUserInfo.d.ts} +2 -3
- package/lib/src/utils/hooks/useUserInfo.d.ts.map +1 -0
- package/lib/src/utils/hooks/useUserInfo.js +32 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/lib/src/utils/hooks/useKeycloak.d.ts.map +0 -1
- package/lib/src/utils/hooks/useKeycloak.js +0 -30
package/lib/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../../src/components/buttons/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAmBxC,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../../src/components/buttons/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAmBxC,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA2ExC,CAAC"}
|
|
@@ -32,8 +32,7 @@ const link_1 = __importDefault(require("next/link"));
|
|
|
32
32
|
const Face_1 = __importDefault(require("@mui/icons-material/Face"));
|
|
33
33
|
const Logout_1 = __importDefault(require("@mui/icons-material/Logout"));
|
|
34
34
|
const material_1 = require("@mui/material");
|
|
35
|
-
const
|
|
36
|
-
const useKeycloak_1 = require("../../../utils/hooks/useKeycloak");
|
|
35
|
+
const useUserInfo_1 = require("../../../utils/hooks/useUserInfo");
|
|
37
36
|
const Avatar = ({ logoutUrl, accountSettingsUrl, }) => {
|
|
38
37
|
const muiTheme = (0, material_1.useTheme)();
|
|
39
38
|
// Menu
|
|
@@ -46,24 +45,23 @@ const Avatar = ({ logoutUrl, accountSettingsUrl, }) => {
|
|
|
46
45
|
setAnchorEl(null);
|
|
47
46
|
};
|
|
48
47
|
// User data
|
|
49
|
-
const
|
|
50
|
-
const { data: userInfo } = (0, useKeycloak_1.useUserInfo)(apiClient);
|
|
48
|
+
const { data: userInfo } = (0, useUserInfo_1.useUserInfo)();
|
|
51
49
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
52
|
-
react_1.default.createElement(material_1.Tooltip, { title: userInfo?.preferredUserName ||
|
|
53
|
-
react_1.default.createElement(material_1.Avatar, { alt: userInfo?.preferredUserName ||
|
|
50
|
+
react_1.default.createElement(material_1.Tooltip, { title: userInfo?.preferredUserName || 'Anonymous User' },
|
|
51
|
+
react_1.default.createElement(material_1.Avatar, { alt: userInfo?.preferredUserName || 'user-name', sx: {
|
|
54
52
|
width: 24,
|
|
55
53
|
height: 24,
|
|
56
54
|
bgcolor: muiTheme.palette.topbar.contrastText,
|
|
57
55
|
}, onClick: handleClick })),
|
|
58
56
|
react_1.default.createElement(material_1.Menu, { anchorEl: anchorEl, open: open, onClose: handleClose, anchorOrigin: {
|
|
59
|
-
vertical:
|
|
60
|
-
horizontal:
|
|
57
|
+
vertical: 'bottom',
|
|
58
|
+
horizontal: 'right',
|
|
61
59
|
}, transformOrigin: {
|
|
62
|
-
vertical:
|
|
63
|
-
horizontal:
|
|
60
|
+
vertical: 'top',
|
|
61
|
+
horizontal: 'right',
|
|
64
62
|
}, PaperProps: {
|
|
65
63
|
sx: {
|
|
66
|
-
padding:
|
|
64
|
+
padding: '4px',
|
|
67
65
|
},
|
|
68
66
|
} },
|
|
69
67
|
accountSettingsUrl && (react_1.default.createElement(link_1.default, { href: accountSettingsUrl },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FunctionComponent } from
|
|
2
|
-
import { Language, Locale } from
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { Language, Locale } from '../../../types/languages';
|
|
3
3
|
export interface LanguageSelectProps {
|
|
4
4
|
/**
|
|
5
5
|
* Internationalization locale.
|
|
@@ -11,12 +11,12 @@ const Language_1 = __importDefault(require("@mui/icons-material/Language"));
|
|
|
11
11
|
const material_1 = require("@mui/material");
|
|
12
12
|
const languages_1 = require("../../../types/languages");
|
|
13
13
|
const translations_json_1 = __importDefault(require("./translations.json"));
|
|
14
|
-
const LanguageSelect = ({ locale =
|
|
14
|
+
const LanguageSelect = ({ locale = 'en', languages = [
|
|
15
15
|
{
|
|
16
|
-
id:
|
|
17
|
-
label:
|
|
18
|
-
countryCode:
|
|
19
|
-
MUILocale:
|
|
16
|
+
id: 'en',
|
|
17
|
+
label: 'English',
|
|
18
|
+
countryCode: 'us',
|
|
19
|
+
MUILocale: 'enUS',
|
|
20
20
|
},
|
|
21
21
|
], }) => {
|
|
22
22
|
const muiTheme = (0, material_1.useTheme)();
|
|
@@ -35,18 +35,18 @@ const LanguageSelect = ({ locale = "en", languages = [
|
|
|
35
35
|
};
|
|
36
36
|
const router = (0, router_1.useRouter)();
|
|
37
37
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
38
|
-
react_1.default.createElement(material_1.Tooltip, { title: translations_json_1.default[
|
|
38
|
+
react_1.default.createElement(material_1.Tooltip, { title: translations_json_1.default['tooltip'][locale] },
|
|
39
39
|
react_1.default.createElement(material_1.IconButton, { component: 'span', "aria-label": 'language', onClick: openOptions },
|
|
40
40
|
react_1.default.createElement(Language_1.default, { htmlColor: muiTheme.palette.topbar.contrastText }))),
|
|
41
41
|
react_1.default.createElement(material_1.Menu, { anchorEl: anchorEl, id: 'language-menu', open: open, onClose: closeOptions, onClick: closeOptions, anchorOrigin: {
|
|
42
|
-
vertical:
|
|
43
|
-
horizontal:
|
|
42
|
+
vertical: 'bottom',
|
|
43
|
+
horizontal: 'right',
|
|
44
44
|
}, transformOrigin: {
|
|
45
|
-
vertical:
|
|
46
|
-
horizontal:
|
|
45
|
+
vertical: 'top',
|
|
46
|
+
horizontal: 'right',
|
|
47
47
|
}, PaperProps: {
|
|
48
48
|
sx: {
|
|
49
|
-
padding:
|
|
49
|
+
padding: '4px',
|
|
50
50
|
},
|
|
51
51
|
} },
|
|
52
52
|
react_1.default.createElement(material_1.MenuList, { dense: true }, languages?.map((lang) => (react_1.default.createElement(link_1.default, { key: lang.id, href: router.asPath, locale: lang.id },
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ChipProps } from '@mui/material';
|
|
3
3
|
import { StringTranslation } from '../../../types';
|
|
4
|
-
type DeltaType = 'decrease' | 'moderateDecrease' | 'unchanged' | 'moderateIncrease' | 'increase';
|
|
5
4
|
export interface ImprovementChipProps extends ChipProps {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
currentValue: number;
|
|
6
|
+
previousValue: number;
|
|
7
|
+
stationaryTolerance?: number;
|
|
8
|
+
percentageFormatOptions?: Partial<Intl.NumberFormatOptions>;
|
|
8
9
|
isIncreasePositive?: boolean;
|
|
9
10
|
tooltip?: StringTranslation | string;
|
|
10
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImprovementChip.d.ts","sourceRoot":"","sources":["../../../../../src/components/display/StyledValue/ImprovementChip.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ImprovementChip.d.ts","sourceRoot":"","sources":["../../../../../src/components/display/StyledValue/ImprovementChip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAQ,SAAS,EAAW,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAuB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxE,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,uBAAuB,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC5D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC;CACtC;AAoCD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAkCnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -6,28 +6,50 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const icons_material_1 = require("@mui/icons-material");
|
|
8
8
|
const material_1 = require("@mui/material");
|
|
9
|
-
const utils_1 = require("../../../utils");
|
|
10
9
|
const types_1 = require("../../../types");
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
10
|
+
const utils_1 = require("../../../utils");
|
|
11
|
+
const getColor = (delta, tol, isIncreasePositive) => {
|
|
12
|
+
if (delta >= tol) {
|
|
13
|
+
switch (isIncreasePositive) {
|
|
14
|
+
case true:
|
|
15
|
+
return 'success';
|
|
16
|
+
case false:
|
|
17
|
+
return 'error';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
else if (delta <= -tol) {
|
|
21
|
+
switch (isIncreasePositive) {
|
|
22
|
+
case true:
|
|
23
|
+
return 'error';
|
|
24
|
+
case false:
|
|
25
|
+
return 'success';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return 'info';
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const getIcon = (delta, tol, size) => {
|
|
33
|
+
if (delta >= tol) {
|
|
34
|
+
return react_1.default.createElement(icons_material_1.North, { fontSize: size });
|
|
35
|
+
}
|
|
36
|
+
else if (delta <= -tol) {
|
|
37
|
+
return react_1.default.createElement(icons_material_1.South, { fontSize: size });
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return react_1.default.createElement(icons_material_1.East, { fontSize: size });
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const ImprovementChip = ({ currentValue, previousValue, stationaryTolerance = 0.01, percentageFormatOptions = {
|
|
44
|
+
style: 'percent',
|
|
45
|
+
minimumFractionDigits: 0,
|
|
46
|
+
maximumFractionDigits: 1,
|
|
47
|
+
}, isIncreasePositive = true, tooltip, size = 'small', color, }) => {
|
|
26
48
|
const locale = (0, utils_1.useLocale)();
|
|
27
|
-
const colors = colorMap(isIncreasePositive);
|
|
28
|
-
const icons = iconMap(size);
|
|
29
49
|
const tooltipString = tooltip && (0, types_1.isStringTranslation)(tooltip) ? tooltip[locale] : tooltip;
|
|
50
|
+
const delta = (currentValue - previousValue) / previousValue;
|
|
51
|
+
const deltaString = delta.toLocaleString(locale, percentageFormatOptions);
|
|
30
52
|
return (react_1.default.createElement(material_1.Tooltip, { title: tooltipString || '' },
|
|
31
|
-
react_1.default.createElement(material_1.Chip, { icon:
|
|
53
|
+
react_1.default.createElement(material_1.Chip, { icon: getIcon(delta, stationaryTolerance, size), label: deltaString, color: color || getColor(delta, stationaryTolerance, isIncreasePositive), size: size })));
|
|
32
54
|
};
|
|
33
55
|
exports.default = ImprovementChip;
|
|
@@ -10,6 +10,7 @@ export interface FetchedValue {
|
|
|
10
10
|
}
|
|
11
11
|
export interface StyledValueProps {
|
|
12
12
|
value?: number | string | Date | FetchedValue;
|
|
13
|
+
previousValue?: number | string | Date | FetchedValue;
|
|
13
14
|
formatOptions?: Partial<Intl.DateTimeFormatOptions | Intl.NumberFormatOptions>;
|
|
14
15
|
caption: string | StringTranslation;
|
|
15
16
|
details?: string | StringTranslation;
|
|
@@ -23,7 +24,7 @@ export interface StyledValueProps {
|
|
|
23
24
|
cardProps?: CardProps;
|
|
24
25
|
loading?: boolean;
|
|
25
26
|
onCardClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
26
|
-
|
|
27
|
+
improvementChipProps?: Pick<Partial<ImprovementChipProps>, 'isIncreasePositive' | 'stationaryTolerance'>;
|
|
27
28
|
}
|
|
28
29
|
declare const StyledValue: React.FC<StyledValueProps>;
|
|
29
30
|
export default StyledValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledValue.d.ts","sourceRoot":"","sources":["../../../../../src/components/display/StyledValue/StyledValue.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAIL,SAAS,EAIT,eAAe,EAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAuB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxE,OAAwB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"StyledValue.d.ts","sourceRoot":"","sources":["../../../../../src/components/display/StyledValue/StyledValue.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAIL,SAAS,EAIT,eAAe,EAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAuB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxE,OAAwB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAG1E,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAMD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,YAAY,CAAC;IAC9C,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,YAAY,CAAC;IACtD,aAAa,CAAC,EAAE,OAAO,CACrB,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,mBAAmB,CACtD,CAAC;IACF,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAAC;IACrC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,eAAe,CAAC;IACvC,sBAAsB,CAAC,EAAE,eAAe,CAAC;IACzC,sBAAsB,CAAC,EAAE,eAAe,CAAC;IACzC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD,oBAAoB,CAAC,EAAE,IAAI,CACzB,OAAO,CAAC,oBAAoB,CAAC,EAC7B,oBAAoB,GAAG,qBAAqB,CAC7C,CAAC;CACH;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA4I3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -9,6 +9,7 @@ const types_1 = require("../../../types");
|
|
|
9
9
|
const utils_1 = require("../../../utils");
|
|
10
10
|
const hooks_1 = require("./hooks");
|
|
11
11
|
const ImprovementChip_1 = __importDefault(require("./ImprovementChip"));
|
|
12
|
+
const translations_json_1 = __importDefault(require("./translations.json"));
|
|
12
13
|
const isFetchedValue = (value) => {
|
|
13
14
|
return value.endpoint !== undefined;
|
|
14
15
|
};
|
|
@@ -16,17 +17,25 @@ const StyledValue = (props) => {
|
|
|
16
17
|
const { caption, details, formatOptions = {}, icon, raised = false, framed = false, loading = false, backgroundColor, valueTypographyProps = {
|
|
17
18
|
variant: 'h3',
|
|
18
19
|
color: 'primary',
|
|
19
|
-
}, captionTypographyProps = { variant: 'subtitle2', color: 'textPrimary' }, detailsTypographyProps = { variant: 'caption', color: 'textSecondary' }, cardProps, onCardClick,
|
|
20
|
+
}, captionTypographyProps = { variant: 'subtitle2', color: 'textPrimary' }, detailsTypographyProps = { variant: 'caption', color: 'textSecondary' }, cardProps, onCardClick, improvementChipProps = {
|
|
21
|
+
isIncreasePositive: true,
|
|
22
|
+
stationaryTolerance: 0.01,
|
|
23
|
+
}, } = props;
|
|
20
24
|
const locale = (0, utils_1.useLocale)();
|
|
21
25
|
// Value
|
|
22
26
|
const apiClient = (0, utils_1.useAPI)(props.value && isFetchedValue(props.value) ? props.value.baseURL : undefined);
|
|
23
|
-
const { data: value, isLoading } = (0, hooks_1.useValue)(apiClient, props.value);
|
|
24
|
-
const
|
|
25
|
-
const stringValue =
|
|
26
|
-
? value?.toLocaleString(
|
|
27
|
+
const { data: value, isLoading: isLoadingValue } = (0, hooks_1.useValue)(apiClient, props.value);
|
|
28
|
+
const { data: previousValue, isLoading: isLoadingPreviousValue } = (0, hooks_1.useValue)(apiClient, props.previousValue);
|
|
29
|
+
const stringValue = typeof value === 'number'
|
|
30
|
+
? value?.toLocaleString(locale, formatOptions)
|
|
27
31
|
: value && (0, utils_1.isValidDate)(value)
|
|
28
|
-
? new Date(value)?.toLocaleString(
|
|
32
|
+
? new Date(value)?.toLocaleString(locale, formatOptions)
|
|
29
33
|
: value;
|
|
34
|
+
const stringPreviousValue = typeof previousValue === 'number'
|
|
35
|
+
? previousValue?.toLocaleString(locale, formatOptions)
|
|
36
|
+
: previousValue && (0, utils_1.isValidDate)(previousValue)
|
|
37
|
+
? new Date(previousValue)?.toLocaleString(locale, formatOptions)
|
|
38
|
+
: previousValue;
|
|
30
39
|
const captionString = (0, types_1.isStringTranslation)(caption)
|
|
31
40
|
? caption[locale]
|
|
32
41
|
: caption;
|
|
@@ -57,8 +66,8 @@ const StyledValue = (props) => {
|
|
|
57
66
|
react_1.default.createElement(material_1.Grid, { container: true, spacing: 0 },
|
|
58
67
|
react_1.default.createElement(material_1.Grid, { item: true, xs: 12 },
|
|
59
68
|
react_1.default.createElement(material_1.Box, { sx: { display: 'flex', justifyContent: 'space-between' } },
|
|
60
|
-
react_1.default.createElement(material_1.Typography, { ...valueTypographyProps }, loading ||
|
|
61
|
-
|
|
69
|
+
react_1.default.createElement(material_1.Typography, { ...valueTypographyProps }, loading || isLoadingValue || value === undefined ? (react_1.default.createElement(material_1.Skeleton, null)) : (stringValue)),
|
|
70
|
+
previousValue && stringPreviousValue && (react_1.default.createElement(ImprovementChip_1.default, { currentValue: value, previousValue: previousValue, tooltip: `${stringPreviousValue} ${translations_json_1.default['tooltipPreviousPeriod'][locale]}`, ...improvementChipProps })))),
|
|
62
71
|
react_1.default.createElement(material_1.Grid, { item: true, xs: 12 },
|
|
63
72
|
react_1.default.createElement(material_1.Typography, { ...captionTypographyProps }, captionString)),
|
|
64
73
|
details && (react_1.default.createElement(material_1.Grid, { item: true, xs: 12 },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinimalLayout.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/MinimalLayout/MinimalLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASzC,OAAe,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAIlE,UAAU,kBAAkB;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"MinimalLayout.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/MinimalLayout/MinimalLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASzC,OAAe,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAIlE,UAAU,kBAAkB;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAiF/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -49,6 +49,9 @@ const MinimalLayout = ({ isLoading, isError, error, footer, children, }) => {
|
|
|
49
49
|
error.message))))),
|
|
50
50
|
!isLoading && (react_1.default.createElement(material_1.Box, { sx: {
|
|
51
51
|
flexGrow: 1,
|
|
52
|
+
// display: 'flex',
|
|
53
|
+
// flexDirection: 'column',
|
|
54
|
+
// height: '100%',
|
|
52
55
|
maxWidth: '100%',
|
|
53
56
|
overflowX: 'hidden',
|
|
54
57
|
paddingTop: '10px',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardLayout.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/StandardLayout/StandardLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAYzC,OAAgB,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAe,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAgB,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAIrE,OAAO,EAAE,QAAQ,EAAU,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D,UAAU,mBAAmB;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"StandardLayout.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/StandardLayout/StandardLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAYzC,OAAgB,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAe,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAgB,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAIrE,OAAO,EAAE,QAAQ,EAAU,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D,UAAU,mBAAmB;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAiHjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -24,7 +24,6 @@ const StandardLayout = ({ isLoading, isError, error, appLogo, footer, sidebarLin
|
|
|
24
24
|
// Persist user preference about the sidebar
|
|
25
25
|
const [sidebarOpen, setSidebarOpen] = (0, utils_1.usePersistedState)('sidebarOpen', isMobile ? false : true);
|
|
26
26
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
27
|
-
react_1.default.createElement(TopLine_1.default, null),
|
|
28
27
|
sidebarLinks && sidebarLinks.length > 0 && (react_1.default.createElement(Sidebar_1.default, { links: sidebarLinks, onClose: () => setSidebarOpen(false), open: sidebarOpen, isMobile: isMobile, logo: appLogo ? react_1.default.createElement(AppLogo_1.default, { ...appLogo, open: sidebarOpen }) : react_1.default.createElement(react_1.default.Fragment, null), locale: locale })),
|
|
29
28
|
react_1.default.createElement(material_1.Box, { sx: {
|
|
30
29
|
display: 'flex',
|
|
@@ -34,10 +33,14 @@ const StandardLayout = ({ isLoading, isError, error, appLogo, footer, sidebarLin
|
|
|
34
33
|
width: '100%',
|
|
35
34
|
background: theme.palette.background.default,
|
|
36
35
|
} },
|
|
36
|
+
react_1.default.createElement(TopLine_1.default, null),
|
|
37
37
|
react_1.default.createElement(Topbar_1.default, { hasSidebar: sidebarLinks && sidebarLinks.length > 0, onSidebarClose: () => setSidebarOpen(false), onSidebarOpen: () => setSidebarOpen(true), open: sidebarOpen, locale: locale, languages: languages, avatar: avatar }),
|
|
38
38
|
isLoading && react_1.default.createElement(progress_1.CircularLoading, { locale: locale }),
|
|
39
39
|
!isLoading && isError && (react_1.default.createElement(material_1.Box, { sx: {
|
|
40
40
|
flexGrow: 1,
|
|
41
|
+
// display: 'flex',
|
|
42
|
+
// flexDirection: 'column',
|
|
43
|
+
// height: '100%',
|
|
41
44
|
maxWidth: '100%',
|
|
42
45
|
overflowX: 'hidden',
|
|
43
46
|
paddingTop: '10px',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { ReactElement } from
|
|
2
|
-
import { Variant } from
|
|
3
|
-
import { Locale, StringTranslation } from
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import { Variant } from '@mui/material/styles/createTypography';
|
|
3
|
+
import { Locale, StringTranslation } from '../../../../types/languages';
|
|
4
4
|
export interface SidebarLink {
|
|
5
5
|
/**
|
|
6
6
|
* Unique identifier of the link.
|
|
@@ -47,7 +47,7 @@ const Sidebar = ({ links, open, isMobile, logo, locale, onClose, }) => {
|
|
|
47
47
|
return (react_1.default.createElement(material_1.ListItemIcon, { color: color }, link.sidebarIcon ? (link.sidebarIcon(color)) : (react_1.default.createElement(ArrowRightOutlined_1.default, { htmlColor: color }))));
|
|
48
48
|
};
|
|
49
49
|
// Persist which items of the sidebar are open to avoid resetting on page change
|
|
50
|
-
const [sidebarItemOpen, setSidebarItemOpen] = (0, utils_1.usePersistedState)(
|
|
50
|
+
const [sidebarItemOpen, setSidebarItemOpen] = (0, utils_1.usePersistedState)('sidebarItemOpen', {});
|
|
51
51
|
const handleOpenSidebarItem = (item) => {
|
|
52
52
|
const oldOpenState = { ...sidebarItemOpen };
|
|
53
53
|
oldOpenState[item] =
|
|
@@ -81,26 +81,26 @@ const Sidebar = ({ links, open, isMobile, logo, locale, onClose, }) => {
|
|
|
81
81
|
}
|
|
82
82
|
})
|
|
83
83
|
.map((link) => {
|
|
84
|
-
const selected = link.path ===
|
|
85
|
-
? pathname ===
|
|
84
|
+
const selected = link.path === '/'
|
|
85
|
+
? pathname === '/'
|
|
86
86
|
: pathname.slice(1).startsWith(link.path.slice(1));
|
|
87
87
|
if (!link.subPages) {
|
|
88
88
|
return (react_1.default.createElement(link_1.default, { key: link.id, href: link.path },
|
|
89
89
|
react_1.default.createElement(material_1.ListItemButton, { selected: selected, style: {
|
|
90
|
-
paddingLeft: options.level === 1 && open ?
|
|
90
|
+
paddingLeft: options.level === 1 && open ? '32px' : '22px',
|
|
91
91
|
paddingTop: options.level === 1 ? 0 : 8,
|
|
92
92
|
paddingBottom: options.level === 1 ? 0 : 8,
|
|
93
|
-
borderTopRightRadius:
|
|
94
|
-
borderBottomRightRadius:
|
|
93
|
+
borderTopRightRadius: '20px',
|
|
94
|
+
borderBottomRightRadius: '20px',
|
|
95
95
|
} },
|
|
96
96
|
icons(link, selected),
|
|
97
97
|
react_1.default.createElement(material_1.ListItemText, { style: {
|
|
98
98
|
color: selected
|
|
99
99
|
? `${muiTheme.palette.sidebar.contrastText} !important`
|
|
100
100
|
: `${muiTheme.palette.sidebar.light} !important`,
|
|
101
|
-
marginLeft:
|
|
102
|
-
visibility:
|
|
103
|
-
}, disableTypography: true, primary: react_1.default.createElement(material_1.Typography, { variant: link.labelVariant ||
|
|
101
|
+
marginLeft: '-20px',
|
|
102
|
+
visibility: 'visible',
|
|
103
|
+
}, disableTypography: true, primary: react_1.default.createElement(material_1.Typography, { variant: link.labelVariant || 'h6', style: selected
|
|
104
104
|
? { color: muiTheme.palette.sidebar.contrastText }
|
|
105
105
|
: { color: muiTheme.palette.sidebar.light } }, (0, languages_1.isStringTranslation)(link.label)
|
|
106
106
|
? link.label[locale]
|
|
@@ -109,11 +109,11 @@ const Sidebar = ({ links, open, isMobile, logo, locale, onClose, }) => {
|
|
|
109
109
|
return (react_1.default.createElement("div", { key: link.id },
|
|
110
110
|
react_1.default.createElement(link_1.default, { href: link.path },
|
|
111
111
|
react_1.default.createElement(material_1.ListItemButton, { key: link.id, selected: selected, style: {
|
|
112
|
-
paddingLeft:
|
|
112
|
+
paddingLeft: '22px',
|
|
113
113
|
paddingTop: 8,
|
|
114
114
|
paddingBottom: 8,
|
|
115
|
-
borderTopRightRadius:
|
|
116
|
-
borderBottomRightRadius:
|
|
115
|
+
borderTopRightRadius: '20px',
|
|
116
|
+
borderBottomRightRadius: '20px',
|
|
117
117
|
}, onClick: (_evt) => {
|
|
118
118
|
if (!sidebarItemOpen[link.id]) {
|
|
119
119
|
handleOpenSidebarItem(link.id);
|
|
@@ -124,9 +124,9 @@ const Sidebar = ({ links, open, isMobile, logo, locale, onClose, }) => {
|
|
|
124
124
|
color: selected
|
|
125
125
|
? `${muiTheme.palette.sidebar.contrastText} !important`
|
|
126
126
|
: `${muiTheme.palette.sidebar.light} !important`,
|
|
127
|
-
marginLeft:
|
|
128
|
-
visibility:
|
|
129
|
-
}, disableTypography: true, primary: react_1.default.createElement(material_1.Typography, { variant: link.labelVariant ||
|
|
127
|
+
marginLeft: '-20px',
|
|
128
|
+
visibility: 'visible',
|
|
129
|
+
}, disableTypography: true, primary: react_1.default.createElement(material_1.Typography, { variant: link.labelVariant || 'h6', style: selected
|
|
130
130
|
? { color: muiTheme.palette.sidebar.contrastText }
|
|
131
131
|
: { color: muiTheme.palette.sidebar.light } }, (0, languages_1.isStringTranslation)(link.label)
|
|
132
132
|
? link.label[locale]
|
|
@@ -156,32 +156,32 @@ const Sidebar = ({ links, open, isMobile, logo, locale, onClose, }) => {
|
|
|
156
156
|
})
|
|
157
157
|
// .filter((l) => l.id !== 'settings')
|
|
158
158
|
.map((link) => {
|
|
159
|
-
const selected = link.path ===
|
|
160
|
-
? pathname ===
|
|
159
|
+
const selected = link.path === '/'
|
|
160
|
+
? pathname === '/'
|
|
161
161
|
: pathname.slice(1).startsWith(link.path.slice(1));
|
|
162
162
|
if (link.subPages) {
|
|
163
163
|
return (react_1.default.createElement("div", { key: link.id },
|
|
164
164
|
react_1.default.createElement(material_1.ListItemButton, { selected: selected, style: {
|
|
165
|
-
paddingLeft:
|
|
165
|
+
paddingLeft: '22px',
|
|
166
166
|
paddingTop: 8,
|
|
167
167
|
paddingBottom: 8,
|
|
168
|
-
borderTopRightRadius:
|
|
169
|
-
borderBottomRightRadius:
|
|
168
|
+
borderTopRightRadius: '20px',
|
|
169
|
+
borderBottomRightRadius: '20px',
|
|
170
170
|
}, onClick: (evt) => handleOpenSidebarMenu(link.id, evt) },
|
|
171
171
|
react_1.default.createElement(material_1.Tooltip, { title: (0, languages_1.isStringTranslation)(link.label)
|
|
172
172
|
? link.label[locale]
|
|
173
173
|
: link.label, placement: 'right', enterDelay: 600, enterNextDelay: 600, arrow: true }, icons(link, selected))),
|
|
174
174
|
react_1.default.createElement(material_1.Menu, { id: `${link.id}-subpages-menu`, anchorEl: subPagesMenuAnchorEl[link.id], open: Boolean(subPagesMenuAnchorEl[link.id]), onClose: (_evt) => handleCloseSidebarMenu(link.id), anchorOrigin: {
|
|
175
|
-
vertical:
|
|
176
|
-
horizontal:
|
|
175
|
+
vertical: 'top',
|
|
176
|
+
horizontal: 'right',
|
|
177
177
|
}, transformOrigin: {
|
|
178
|
-
vertical:
|
|
179
|
-
horizontal:
|
|
178
|
+
vertical: 'top',
|
|
179
|
+
horizontal: 'left',
|
|
180
180
|
}, PaperProps: {
|
|
181
181
|
sx: {
|
|
182
|
-
borderRadius:
|
|
183
|
-
padding:
|
|
184
|
-
overflow:
|
|
182
|
+
borderRadius: '2px',
|
|
183
|
+
padding: '2px',
|
|
184
|
+
overflow: 'visible',
|
|
185
185
|
},
|
|
186
186
|
} }, link.subPages.map((subPage) => (react_1.default.createElement(link_1.default, { key: subPage.id, href: subPage.path },
|
|
187
187
|
react_1.default.createElement(material_1.MenuItem, null,
|
|
@@ -197,11 +197,11 @@ const Sidebar = ({ links, open, isMobile, logo, locale, onClose, }) => {
|
|
|
197
197
|
else {
|
|
198
198
|
return (react_1.default.createElement(link_1.default, { key: link.id, href: link.path },
|
|
199
199
|
react_1.default.createElement(material_1.ListItemButton, { selected: selected, style: {
|
|
200
|
-
paddingLeft:
|
|
200
|
+
paddingLeft: '22px',
|
|
201
201
|
paddingTop: 8,
|
|
202
202
|
paddingBottom: 8,
|
|
203
|
-
borderTopRightRadius:
|
|
204
|
-
borderBottomRightRadius:
|
|
203
|
+
borderTopRightRadius: '20px',
|
|
204
|
+
borderBottomRightRadius: '20px',
|
|
205
205
|
} },
|
|
206
206
|
react_1.default.createElement(material_1.Tooltip, { title: (0, languages_1.isStringTranslation)(link.label)
|
|
207
207
|
? link.label[locale]
|
|
@@ -210,27 +210,27 @@ const Sidebar = ({ links, open, isMobile, logo, locale, onClose, }) => {
|
|
|
210
210
|
}));
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
|
-
return (react_1.default.createElement(material_1.Drawer, { anchor: 'left', onClose: onClose, open: open, variant: isMobile ?
|
|
213
|
+
return (react_1.default.createElement(material_1.Drawer, { anchor: 'left', onClose: onClose, open: open, variant: isMobile ? 'temporary' : 'permanent', sx: {
|
|
214
214
|
flexShrink: 0,
|
|
215
|
-
whiteSpace:
|
|
216
|
-
height:
|
|
215
|
+
whiteSpace: 'nowrap',
|
|
216
|
+
height: '100%',
|
|
217
217
|
width: {
|
|
218
|
-
xs: open ?
|
|
219
|
-
sm: open ?
|
|
220
|
-
md: open ?
|
|
218
|
+
xs: open ? '65%' : `${parseInt(muiTheme.spacing(10), 10) + 1}px`,
|
|
219
|
+
sm: open ? '50%' : `${parseInt(muiTheme.spacing(10), 10) + 1}px`,
|
|
220
|
+
md: open ? '300px' : `${parseInt(muiTheme.spacing(10), 10) + 1}px`,
|
|
221
221
|
},
|
|
222
222
|
}, PaperProps: {
|
|
223
223
|
sx: {
|
|
224
224
|
// pr: 1,
|
|
225
225
|
width: {
|
|
226
|
-
xs: open ?
|
|
227
|
-
sm: open ?
|
|
228
|
-
md: open ?
|
|
226
|
+
xs: open ? '65%' : `${parseInt(muiTheme.spacing(10), 10) + 1}px`,
|
|
227
|
+
sm: open ? '50%' : `${parseInt(muiTheme.spacing(10), 10) + 1}px`,
|
|
228
|
+
md: open ? '300px' : `${parseInt(muiTheme.spacing(10), 10) + 1}px`,
|
|
229
229
|
},
|
|
230
230
|
background: muiTheme.palette.sidebar.main,
|
|
231
231
|
},
|
|
232
232
|
} },
|
|
233
|
-
react_1.default.createElement(material_1.List, { style: { marginTop:
|
|
233
|
+
react_1.default.createElement(material_1.List, { style: { marginTop: '19px' } }, handler(links, { level: 0 })),
|
|
234
234
|
react_1.default.createElement("div", { style: { flexGrow: 1 } }),
|
|
235
235
|
logo));
|
|
236
236
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Language, Locale } from
|
|
3
|
-
import { AvatarProps } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Language, Locale } from '../../../../types/languages';
|
|
3
|
+
import { AvatarProps } from '../../../buttons/Avatar/Avatar';
|
|
4
4
|
interface TopbarProps {
|
|
5
5
|
/**
|
|
6
6
|
* If true the layout has a sidebar.
|
|
@@ -42,7 +42,7 @@ const Topbar = (props) => {
|
|
|
42
42
|
const { resolvedTheme, setTheme } = (0, next_themes_1.useTheme)();
|
|
43
43
|
const muiTheme = (0, material_1.useTheme)();
|
|
44
44
|
const SidebarIcon = open ? (react_1.default.createElement(MenuOpenTwoTone_1.default, { htmlColor: muiTheme.palette.topbar.contrastText })) : (react_1.default.createElement(MenuTwoTone_1.default, { htmlColor: muiTheme.palette.topbar.contrastText }));
|
|
45
|
-
const menuMessage = open ? translations_json_1.default[
|
|
45
|
+
const menuMessage = open ? translations_json_1.default['menuClose'][locale] : translations_json_1.default['menuOpen'][locale];
|
|
46
46
|
return (react_1.default.createElement(ElevationScroll_1.default, { ...props },
|
|
47
47
|
react_1.default.createElement(S.StyledAppBar, { position: 'static', theme: muiTheme },
|
|
48
48
|
react_1.default.createElement(material_1.Toolbar, null,
|
|
@@ -52,10 +52,10 @@ const Topbar = (props) => {
|
|
|
52
52
|
react_1.default.createElement(index_1.LanguageSelect, { locale: locale, languages: languages }),
|
|
53
53
|
react_1.default.createElement(material_1.IconButton, { component: 'span', "aria-label": 'user options' },
|
|
54
54
|
react_1.default.createElement(Avatar_1.Avatar, { ...avatar })),
|
|
55
|
-
react_1.default.createElement(material_1.Tooltip, { title: resolvedTheme ===
|
|
56
|
-
? translations_json_1.default[
|
|
57
|
-
: translations_json_1.default[
|
|
58
|
-
react_1.default.createElement(material_1.IconButton, { component: 'span', "aria-label": 'toggle dark mode', onClick: () => setTheme(resolvedTheme ===
|
|
55
|
+
react_1.default.createElement(material_1.Tooltip, { title: resolvedTheme === 'light'
|
|
56
|
+
? translations_json_1.default['enableDark'][locale]
|
|
57
|
+
: translations_json_1.default['disableDark'][locale] },
|
|
58
|
+
react_1.default.createElement(material_1.IconButton, { component: 'span', "aria-label": 'toggle dark mode', onClick: () => setTheme(resolvedTheme === 'light' ? 'dark' : 'light') },
|
|
59
59
|
react_1.default.createElement(ModeNight_1.default, { htmlColor: muiTheme.palette.topbar.contrastText })))))));
|
|
60
60
|
};
|
|
61
61
|
exports.default = Topbar;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as useAPI } from './useAPI';
|
|
2
|
-
export { useUserInfo } from './
|
|
3
|
-
export type { UserInfo } from './
|
|
2
|
+
export { useUserInfo } from './useUserInfo';
|
|
3
|
+
export type { UserInfo } from './useUserInfo';
|
|
4
4
|
export { useLocale } from './useLocale';
|
|
5
5
|
export { default as usePersistedState } from './usePersistedState';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.usePersistedState = exports.useLocale = exports.useUserInfo = exports.useAPI = void 0;
|
|
7
7
|
var useAPI_1 = require("./useAPI");
|
|
8
8
|
Object.defineProperty(exports, "useAPI", { enumerable: true, get: function () { return __importDefault(useAPI_1).default; } });
|
|
9
|
-
var
|
|
10
|
-
Object.defineProperty(exports, "useUserInfo", { enumerable: true, get: function () { return
|
|
9
|
+
var useUserInfo_1 = require("./useUserInfo");
|
|
10
|
+
Object.defineProperty(exports, "useUserInfo", { enumerable: true, get: function () { return useUserInfo_1.useUserInfo; } });
|
|
11
11
|
var useLocale_1 = require("./useLocale");
|
|
12
12
|
Object.defineProperty(exports, "useLocale", { enumerable: true, get: function () { return useLocale_1.useLocale; } });
|
|
13
13
|
var usePersistedState_1 = require("./usePersistedState");
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AxiosInstance } from 'axios';
|
|
2
1
|
export interface UserInfo {
|
|
3
2
|
/**
|
|
4
3
|
* The email address of the user.
|
|
@@ -13,5 +12,5 @@ export interface UserInfo {
|
|
|
13
12
|
*/
|
|
14
13
|
preferredUserName: string;
|
|
15
14
|
}
|
|
16
|
-
export declare const useUserInfo: (
|
|
17
|
-
//# sourceMappingURL=
|
|
15
|
+
export declare const useUserInfo: () => import("react-query").UseQueryResult<UserInfo, unknown>;
|
|
16
|
+
//# sourceMappingURL=useUserInfo.d.ts.map
|