@deix/rossini-core 0.3.1 → 0.4.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 +2 -1
- package/lib/src/components/buttons/Avatar/Avatar.d.ts +7 -2
- package/lib/src/components/buttons/Avatar/Avatar.d.ts.map +1 -1
- package/lib/src/components/buttons/Avatar/Avatar.js +2 -2
- package/lib/src/components/buttons/LanguageSelect/LanguageSelect.d.ts +0 -1
- package/lib/src/components/buttons/LanguageSelect/LanguageSelect.d.ts.map +1 -1
- package/lib/src/components/buttons/LanguageSelect/LanguageSelect.js +1 -1
- package/lib/src/components/buttons/ToggleButtonGroup/ToggleButtonGroup.d.ts +4 -5
- package/lib/src/components/buttons/ToggleButtonGroup/ToggleButtonGroup.d.ts.map +1 -1
- package/lib/src/components/buttons/ToggleButtonGroup/ToggleButtonGroup.js +2 -2
- package/lib/src/components/buttons/index.d.ts +3 -3
- package/lib/src/components/buttons/index.d.ts.map +1 -1
- package/lib/src/components/buttons/index.js +3 -3
- package/lib/src/components/display/Accordion/Accordion.d.ts +22 -1
- package/lib/src/components/display/Accordion/Accordion.d.ts.map +1 -1
- package/lib/src/components/layout/MinimalLayout/MinimalLayout.d.ts +17 -2
- package/lib/src/components/layout/MinimalLayout/MinimalLayout.d.ts.map +1 -1
- package/lib/src/components/layout/MinimalLayout/MinimalLayout.js +13 -2
- package/lib/src/components/layout/StandardLayout/StandardLayout.d.ts +24 -0
- package/lib/src/components/layout/StandardLayout/StandardLayout.d.ts.map +1 -1
- package/lib/src/components/layout/components/Sidebar/Sidebar.d.ts +41 -1
- package/lib/src/components/layout/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/lib/src/components/layout/components/Sidebar/Sidebar.js +16 -6
- package/lib/src/components/layout/components/Topbar/Topbar.d.ts +15 -0
- package/lib/src/components/layout/components/Topbar/Topbar.d.ts.map +1 -1
- package/lib/src/components/layout/components/Topbar/Topbar.js +1 -1
- package/lib/src/index.d.ts +1 -1
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/types/languages.d.ts +17 -0
- package/lib/src/types/languages.d.ts.map +1 -1
- package/lib/src/types/languages.js +5 -0
- package/lib/src/utils/helpers/dateHelpers.d.ts +1 -0
- package/lib/src/utils/helpers/dateHelpers.d.ts.map +1 -1
- package/lib/src/utils/helpers/dateHelpers.js +14 -0
- package/lib/src/utils/helpers/index.d.ts +1 -1
- package/lib/src/utils/helpers/index.d.ts.map +1 -1
- package/lib/src/utils/helpers/index.js +1 -1
- package/lib/src/utils/hooks/useAPI.d.ts +6 -0
- package/lib/src/utils/hooks/useAPI.d.ts.map +1 -1
- package/lib/src/utils/hooks/useAPI.js +6 -0
- package/lib/src/utils/hooks/useKeycloak.d.ts +9 -0
- package/lib/src/utils/hooks/useKeycloak.d.ts.map +1 -1
- package/lib/src/utils/hooks/useLocale.d.ts +3 -0
- package/lib/src/utils/hooks/useLocale.d.ts.map +1 -1
- package/lib/src/utils/hooks/useLocale.js +3 -0
- package/lib/src/utils/hooks/usePersistedState.d.ts +6 -0
- package/lib/src/utils/hooks/usePersistedState.d.ts.map +1 -1
- package/lib/src/utils/hooks/usePersistedState.js +6 -0
- package/lib/src/utils/index.d.ts +1 -1
- package/lib/src/utils/index.d.ts.map +1 -1
- package/lib/src/utils/index.js +1 -1
- package/lib/src/utils/theme/typography.d.ts +2 -2
- package/lib/src/utils/theme/typography.d.ts.map +1 -1
- package/lib/src/utils/theme/typography.js +2 -1
- package/lib/tsconfig-lib.tsbuildinfo +1 -1
- package/package.json +2 -1
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deix/rossini-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"main": "lib/src/index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"eslint-plugin-prettier": "^4.2.1",
|
|
44
44
|
"eslint-plugin-storybook": "^0.6.10",
|
|
45
45
|
"react": "18.2.0",
|
|
46
|
+
"react-docgen-typescript-plugin": "^1.0.2",
|
|
46
47
|
"react-dom": "18.2.0",
|
|
47
48
|
"storybook-addon-next-router": "^4.0.2",
|
|
48
49
|
"typescript": "4.9.4"
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface AvatarProps {
|
|
3
|
+
/**
|
|
4
|
+
* URL address for the logout API.
|
|
5
|
+
*/
|
|
3
6
|
logoutUrl?: string;
|
|
7
|
+
/**
|
|
8
|
+
* URL address for the account settings.
|
|
9
|
+
*/
|
|
4
10
|
accountSettingsUrl?: string;
|
|
5
11
|
}
|
|
6
|
-
declare const Avatar: React.FC<AvatarProps>;
|
|
7
|
-
export default Avatar;
|
|
12
|
+
export declare const Avatar: React.FC<AvatarProps>;
|
|
8
13
|
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../../src/components/buttons/Avatar/Avatar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAiBxC,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../../src/components/buttons/Avatar/Avatar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAiBxC,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,CA4ExC,CAAC"}
|
|
@@ -5,7 +5,7 @@ import LogoutIcon from '@mui/icons-material/Logout';
|
|
|
5
5
|
import { Avatar as MUIAvatar, ListItemIcon, ListItemText, Menu, MenuItem, Tooltip, useTheme, } from '@mui/material';
|
|
6
6
|
import { useAPI } from '../../../utils';
|
|
7
7
|
import { useUserInfo } from '../../../utils/hooks/useKeycloak';
|
|
8
|
-
var Avatar = function (_a) {
|
|
8
|
+
export var Avatar = function (_a) {
|
|
9
9
|
var logoutUrl = _a.logoutUrl, accountSettingsUrl = _a.accountSettingsUrl;
|
|
10
10
|
var muiTheme = useTheme();
|
|
11
11
|
// Menu
|
|
@@ -49,4 +49,4 @@ var Avatar = function (_a) {
|
|
|
49
49
|
React.createElement(LogoutIcon, { fontSize: 'small' })),
|
|
50
50
|
React.createElement(ListItemText, null, "Logout")))))));
|
|
51
51
|
};
|
|
52
|
-
export default Avatar;
|
|
52
|
+
// export default Avatar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LanguageSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/buttons/LanguageSelect/LanguageSelect.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAgBjD,OAAO,EAGL,QAAQ,EACR,MAAM,EACP,MAAM,0BAA0B,CAAC;AAGlC,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,CA6EjE,CAAC
|
|
1
|
+
{"version":3,"file":"LanguageSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/buttons/LanguageSelect/LanguageSelect.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAgBjD,OAAO,EAGL,QAAQ,EACR,MAAM,EACP,MAAM,0BAA0B,CAAC;AAGlC,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,CA6EjE,CAAC"}
|
|
@@ -6,15 +6,15 @@ export interface ButtonGroupOption {
|
|
|
6
6
|
*/
|
|
7
7
|
id: string;
|
|
8
8
|
/**
|
|
9
|
-
* The label to be shown
|
|
9
|
+
* The label to be shown.
|
|
10
10
|
*/
|
|
11
11
|
label: StringTranslation;
|
|
12
12
|
/**
|
|
13
|
-
* A description for the option to appear in the tooltip
|
|
13
|
+
* A description for the option to appear in the tooltip.
|
|
14
14
|
*/
|
|
15
15
|
tooltip?: StringTranslation;
|
|
16
16
|
/**
|
|
17
|
-
* Whether the option is disabled
|
|
17
|
+
* Whether the option is disabled.
|
|
18
18
|
*/
|
|
19
19
|
disabled?: boolean;
|
|
20
20
|
}
|
|
@@ -36,6 +36,5 @@ export interface ToggleButtonGroupProps {
|
|
|
36
36
|
*/
|
|
37
37
|
value: string;
|
|
38
38
|
}
|
|
39
|
-
declare const ToggleButtonGroup: React.FC<ToggleButtonGroupProps>;
|
|
40
|
-
export default ToggleButtonGroup;
|
|
39
|
+
export declare const ToggleButtonGroup: React.FC<ToggleButtonGroupProps>;
|
|
41
40
|
//# sourceMappingURL=ToggleButtonGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleButtonGroup.d.ts","sourceRoot":"","sources":["../../../../../src/components/buttons/ToggleButtonGroup/ToggleButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,KAAK,EAAE,iBAAiB,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B;;OAEG;IACH,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,
|
|
1
|
+
{"version":3,"file":"ToggleButtonGroup.d.ts","sourceRoot":"","sources":["../../../../../src/components/buttons/ToggleButtonGroup/ToggleButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,KAAK,EAAE,iBAAiB,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B;;OAEG;IACH,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAoC9D,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { Button, Tooltip } from '@mui/material';
|
|
3
3
|
import { useLocale } from '../../../utils/hooks/useLocale';
|
|
4
|
-
var ToggleButtonGroup = function (_a) {
|
|
4
|
+
export var ToggleButtonGroup = function (_a) {
|
|
5
5
|
var onChange = _a.onChange, options = _a.options, _b = _a.size, size = _b === void 0 ? 'small' : _b, value = _a.value;
|
|
6
6
|
var locale = useLocale();
|
|
7
7
|
// Handle selection
|
|
@@ -17,4 +17,4 @@ var ToggleButtonGroup = function (_a) {
|
|
|
17
17
|
React.createElement(Button, { key: opt.id, size: size, color: 'primary', disabled: opt.disabled, variant: opt.id === selected ? 'contained' : 'outlined', onClick: function () { return onChange(opt.id); } }, opt.label[locale])));
|
|
18
18
|
})));
|
|
19
19
|
};
|
|
20
|
-
export default ToggleButtonGroup;
|
|
20
|
+
// export default ToggleButtonGroup;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Avatar } from './Avatar/Avatar';
|
|
2
2
|
export type { AvatarProps } from './Avatar/Avatar';
|
|
3
|
-
export {
|
|
3
|
+
export { LanguageSelect } from './LanguageSelect/LanguageSelect';
|
|
4
4
|
export type { LanguageSelectProps } from './LanguageSelect/LanguageSelect';
|
|
5
|
-
export {
|
|
5
|
+
export { ToggleButtonGroup } from './ToggleButtonGroup/ToggleButtonGroup';
|
|
6
6
|
export type { ButtonGroupOption, ToggleButtonGroupProps, } from './ToggleButtonGroup/ToggleButtonGroup';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,YAAY,EACV,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,uCAAuC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export { Avatar } from './Avatar/Avatar';
|
|
2
|
+
export { LanguageSelect } from './LanguageSelect/LanguageSelect';
|
|
3
|
+
export { ToggleButtonGroup } from './ToggleButtonGroup/ToggleButtonGroup';
|
|
@@ -2,15 +2,36 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import { AccordionProps as MUIAccordionProps, TypographyProps } from '@mui/material';
|
|
3
3
|
import { StringTranslation } from '../../../types';
|
|
4
4
|
interface RossiniAccordionProps {
|
|
5
|
+
/**
|
|
6
|
+
* The title of the accordion.
|
|
7
|
+
*/
|
|
5
8
|
title: StringTranslation | string;
|
|
9
|
+
/**
|
|
10
|
+
* MUI Typography props for the title.
|
|
11
|
+
*/
|
|
6
12
|
titleProps?: Partial<TypographyProps>;
|
|
13
|
+
/**
|
|
14
|
+
* The subtitle of the accordion.
|
|
15
|
+
*/
|
|
7
16
|
subtitle?: StringTranslation | string;
|
|
17
|
+
/**
|
|
18
|
+
* MUI Typography props for the title.
|
|
19
|
+
*/
|
|
8
20
|
subtitleProps?: Partial<TypographyProps>;
|
|
21
|
+
/**
|
|
22
|
+
* The icon to be shown next to the title.
|
|
23
|
+
*/
|
|
9
24
|
icon?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* The tooltip string to be shown on hover.
|
|
27
|
+
*/
|
|
10
28
|
tooltip?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The icon linked to the Accordion opening and closing.
|
|
31
|
+
*/
|
|
11
32
|
expandIcon?: ReactNode;
|
|
12
33
|
}
|
|
13
|
-
export type AccordionProps = RossiniAccordionProps & MUIAccordionProps
|
|
34
|
+
export type AccordionProps = RossiniAccordionProps & Omit<MUIAccordionProps, 'title'>;
|
|
14
35
|
declare const Accordion: React.FC<AccordionProps>;
|
|
15
36
|
export default Accordion;
|
|
16
37
|
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../../../src/components/display/Accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,OAAO,EAEL,cAAc,IAAI,iBAAiB,EAKnC,eAAe,EAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAuB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxE,UAAU,qBAAqB;IAC7B,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC;IACtC,aAAa,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED,MAAM,MAAM,cAAc,GAAG,qBAAqB,
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../../../src/components/display/Accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,OAAO,EAEL,cAAc,IAAI,iBAAiB,EAKnC,eAAe,EAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAuB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxE,UAAU,qBAAqB;IAC7B;;OAEG;IACH,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAAC;IAClC;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACtC;;OAEG;IACH,QAAQ,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC;IACtC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACzC;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED,MAAM,MAAM,cAAc,GAAG,qBAAqB,GAChD,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAEnC,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAqCvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FooterProps } from '../components/Footer/Footer';
|
|
3
3
|
interface MinimalLayoutProps {
|
|
4
|
+
/**
|
|
5
|
+
* If true the page will show a progress page.
|
|
6
|
+
*/
|
|
4
7
|
isLoading?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* If true the page will show an error page.
|
|
10
|
+
*/
|
|
5
11
|
isError?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The error to be shown in the error page.
|
|
14
|
+
*/
|
|
6
15
|
error?: Error;
|
|
7
|
-
|
|
16
|
+
/**
|
|
17
|
+
* The main content of the layout.
|
|
18
|
+
*/
|
|
8
19
|
children?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* The properties to be passed to the footer component.
|
|
22
|
+
*/
|
|
23
|
+
footer?: FooterProps;
|
|
9
24
|
}
|
|
10
25
|
declare const MinimalLayout: React.FC<MinimalLayoutProps>;
|
|
11
26
|
export default MinimalLayout;
|
|
@@ -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;
|
|
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;AAUzC,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,CAmF/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
import React from 'react';
|
|
2
13
|
import { Box, Typography, useTheme as useMUITheme } from '@mui/material';
|
|
3
14
|
import Image from 'next/image';
|
|
@@ -8,7 +19,7 @@ import Footer from '../components/Footer/Footer';
|
|
|
8
19
|
import TopLine from '../components/Topline/TopLine';
|
|
9
20
|
import t from './translations.json';
|
|
10
21
|
var MinimalLayout = function (_a) {
|
|
11
|
-
var isLoading = _a.isLoading, isError = _a.isError, error = _a.error,
|
|
22
|
+
var isLoading = _a.isLoading, isError = _a.isError, error = _a.error, footer = _a.footer, children = _a.children;
|
|
12
23
|
var theme = useMUITheme();
|
|
13
24
|
var router = useRouter();
|
|
14
25
|
var locale = router.locale || 'en';
|
|
@@ -53,6 +64,6 @@ var MinimalLayout = function (_a) {
|
|
|
53
64
|
paddingLeft: '27px',
|
|
54
65
|
paddingRight: '27px',
|
|
55
66
|
} }, children)),
|
|
56
|
-
React.createElement(Footer, {
|
|
67
|
+
React.createElement(Footer, __assign({}, footer)))));
|
|
57
68
|
};
|
|
58
69
|
export default MinimalLayout;
|
|
@@ -4,13 +4,37 @@ import { FooterProps } from '../components/Footer/Footer';
|
|
|
4
4
|
import { SidebarLink } from '../components/Sidebar/Sidebar';
|
|
5
5
|
import { AvatarProps } from '../../buttons/Avatar/Avatar';
|
|
6
6
|
interface StandardLayoutProps {
|
|
7
|
+
/**
|
|
8
|
+
* If true the page will show a progress page.
|
|
9
|
+
*/
|
|
7
10
|
isLoading?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* If true the page will show an error page.
|
|
13
|
+
*/
|
|
8
14
|
isError?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The error to be shown in the error page.
|
|
17
|
+
*/
|
|
9
18
|
error?: Error;
|
|
19
|
+
/**
|
|
20
|
+
* The main content of the layout.
|
|
21
|
+
*/
|
|
10
22
|
children?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* The props to be passed to the Avatar button component.
|
|
25
|
+
*/
|
|
11
26
|
avatar?: AvatarProps;
|
|
27
|
+
/**
|
|
28
|
+
* The list of sidebar links.
|
|
29
|
+
*/
|
|
12
30
|
sidebarLinks?: SidebarLink[];
|
|
31
|
+
/**
|
|
32
|
+
* The properties to be used for the construction of the app logo in the sidebar.
|
|
33
|
+
*/
|
|
13
34
|
appLogo?: AppLogoInfo;
|
|
35
|
+
/**
|
|
36
|
+
* The properties to be passed to the footer component.
|
|
37
|
+
*/
|
|
14
38
|
footer?: FooterProps;
|
|
15
39
|
}
|
|
16
40
|
declare const StandardLayout: React.FC<StandardLayoutProps>;
|
|
@@ -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;AAazC,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;AAMrE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D,UAAU,mBAAmB;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA8GjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
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;AAazC,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;AAMrE,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;CACtB;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA8GjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -2,19 +2,59 @@ import React, { ReactElement } from 'react';
|
|
|
2
2
|
import { Variant } from '@mui/material/styles/createTypography';
|
|
3
3
|
import { Locale, StringTranslation } from '../../../../types/languages';
|
|
4
4
|
export interface SidebarLink {
|
|
5
|
+
/**
|
|
6
|
+
* Unique identifier of the link.
|
|
7
|
+
*/
|
|
5
8
|
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* The path to be rerouted to onClick.
|
|
11
|
+
*
|
|
12
|
+
* The path is an absolute path and should start with '/'
|
|
13
|
+
*/
|
|
6
14
|
path: string;
|
|
7
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The link label
|
|
17
|
+
*/
|
|
18
|
+
label: StringTranslation | string;
|
|
19
|
+
/**
|
|
20
|
+
* The MUI Typography variant for the link label.
|
|
21
|
+
*/
|
|
8
22
|
labelVariant?: Variant;
|
|
23
|
+
/**
|
|
24
|
+
* An integer used for sorting the sidebar links.
|
|
25
|
+
*/
|
|
9
26
|
sidebarOrder: number;
|
|
27
|
+
/**
|
|
28
|
+
* A functio returing an icon for the link
|
|
29
|
+
*
|
|
30
|
+
* @param {string} color The htmlColor of the icon
|
|
31
|
+
*/
|
|
10
32
|
sidebarIcon?: (color: string) => ReactElement;
|
|
33
|
+
/**
|
|
34
|
+
* A list of nested links
|
|
35
|
+
*/
|
|
11
36
|
subPages?: SidebarLink[];
|
|
12
37
|
}
|
|
13
38
|
export interface SidebarProps {
|
|
39
|
+
/**
|
|
40
|
+
* A list of links to be added to the sidebar.
|
|
41
|
+
*/
|
|
14
42
|
links: SidebarLink[];
|
|
43
|
+
/**
|
|
44
|
+
* If true the sidebar is open.
|
|
45
|
+
*/
|
|
15
46
|
open: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* If true the sidebar is shown as a temporary drawer.
|
|
49
|
+
*/
|
|
16
50
|
isMobile: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* A React.Element for the logo.
|
|
53
|
+
*/
|
|
17
54
|
logo?: ReactElement;
|
|
55
|
+
/**
|
|
56
|
+
* Internationalization locale.
|
|
57
|
+
*/
|
|
18
58
|
locale: Locale;
|
|
19
59
|
onClose: () => void;
|
|
20
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../../../../src/components/layout/components/Sidebar/Sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAuBtD,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAChE,OAAO,
|
|
1
|
+
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../../../../src/components/layout/components/Sidebar/Sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAuBtD,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAChE,OAAO,EAEL,MAAM,EACN,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAGrC,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAAC;IAClC;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,YAAY,CAAC;IAC9C;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B;AACD,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAyVnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -17,6 +17,7 @@ import { Collapse, Drawer, IconButton, List, ListItemButton, ListItemIcon, ListI
|
|
|
17
17
|
import { useTheme as useMUITheme } from '@mui/material/styles';
|
|
18
18
|
import Link from 'next/link';
|
|
19
19
|
import { useRouter } from 'next/router';
|
|
20
|
+
import { isStringTranslation, } from '../../../../types/languages';
|
|
20
21
|
import { usePersistedState } from '../../../../utils';
|
|
21
22
|
var Sidebar = function (_a) {
|
|
22
23
|
var links = _a.links, open = _a.open, isMobile = _a.isMobile, logo = _a.logo, locale = _a.locale, onClose = _a.onClose;
|
|
@@ -81,7 +82,9 @@ var Sidebar = function (_a) {
|
|
|
81
82
|
visibility: 'visible',
|
|
82
83
|
}, disableTypography: true, primary: React.createElement(Typography, { variant: link.labelVariant || 'h6', style: selected
|
|
83
84
|
? { color: muiTheme.palette.primary.main }
|
|
84
|
-
: { color: muiTheme.palette.linkNotActive.main } }, link.label
|
|
85
|
+
: { color: muiTheme.palette.linkNotActive.main } }, isStringTranslation(link.label)
|
|
86
|
+
? link.label[locale]
|
|
87
|
+
: link.label) }))));
|
|
85
88
|
}
|
|
86
89
|
return (React.createElement("div", { key: link.id },
|
|
87
90
|
React.createElement(Link, { href: link.path },
|
|
@@ -105,7 +108,9 @@ var Sidebar = function (_a) {
|
|
|
105
108
|
visibility: 'visible',
|
|
106
109
|
}, disableTypography: true, primary: React.createElement(Typography, { variant: link.labelVariant || 'h6', style: selected
|
|
107
110
|
? { color: muiTheme.palette.primary.main }
|
|
108
|
-
: { color: muiTheme.palette.linkNotActive.main } }, link.label
|
|
111
|
+
: { color: muiTheme.palette.linkNotActive.main } }, isStringTranslation(link.label)
|
|
112
|
+
? link.label[locale]
|
|
113
|
+
: link.label) }),
|
|
109
114
|
sidebarItemOpen[link.id] ? (React.createElement(IconButton, { onClick: function (e) {
|
|
110
115
|
e.stopPropagation();
|
|
111
116
|
handleOpenSidebarItem(link.id);
|
|
@@ -131,7 +136,6 @@ var Sidebar = function (_a) {
|
|
|
131
136
|
})
|
|
132
137
|
// .filter((l) => l.id !== 'settings')
|
|
133
138
|
.map(function (link) {
|
|
134
|
-
var _a, _b;
|
|
135
139
|
var selected = link.path === '/'
|
|
136
140
|
? pathname === '/'
|
|
137
141
|
: pathname.slice(1).startsWith(link.path.slice(1));
|
|
@@ -144,7 +148,9 @@ var Sidebar = function (_a) {
|
|
|
144
148
|
borderTopRightRadius: '20px',
|
|
145
149
|
borderBottomRightRadius: '20px',
|
|
146
150
|
}, onClick: function (evt) { return handleOpenSidebarMenu(link.id, evt); } },
|
|
147
|
-
React.createElement(Tooltip, { title: (
|
|
151
|
+
React.createElement(Tooltip, { title: isStringTranslation(link.label)
|
|
152
|
+
? link.label[locale]
|
|
153
|
+
: link.label, placement: 'right', enterDelay: 600, enterNextDelay: 600, arrow: true }, icons(link, selected))),
|
|
148
154
|
React.createElement(Menu, { id: "".concat(link.id, "-subpages-menu"), anchorEl: subPagesMenuAnchorEl[link.id], open: Boolean(subPagesMenuAnchorEl[link.id]), onClose: function (_evt) { return handleCloseSidebarMenu(link.id); }, anchorOrigin: {
|
|
149
155
|
vertical: 'top',
|
|
150
156
|
horizontal: 'right',
|
|
@@ -164,7 +170,9 @@ var Sidebar = function (_a) {
|
|
|
164
170
|
color: selected
|
|
165
171
|
? "".concat(muiTheme.palette.primary.main, " !important")
|
|
166
172
|
: "".concat(muiTheme.palette.linkNotActive.main, " !important"),
|
|
167
|
-
} }, subPage.label
|
|
173
|
+
} }, isStringTranslation(subPage.label)
|
|
174
|
+
? subPage.label[locale]
|
|
175
|
+
: subPage.label)))); }))));
|
|
168
176
|
}
|
|
169
177
|
else {
|
|
170
178
|
return (React.createElement(Link, { key: link.id, href: link.path },
|
|
@@ -175,7 +183,9 @@ var Sidebar = function (_a) {
|
|
|
175
183
|
borderTopRightRadius: '20px',
|
|
176
184
|
borderBottomRightRadius: '20px',
|
|
177
185
|
} },
|
|
178
|
-
React.createElement(Tooltip, { title: (
|
|
186
|
+
React.createElement(Tooltip, { title: isStringTranslation(link.label)
|
|
187
|
+
? link.label[locale]
|
|
188
|
+
: link.label, placement: 'right', enterDelay: 600, enterNextDelay: 600, arrow: true }, icons(link, selected)))));
|
|
179
189
|
}
|
|
180
190
|
}));
|
|
181
191
|
}
|
|
@@ -2,10 +2,25 @@ import React from 'react';
|
|
|
2
2
|
import { Locale } from '../../../../types/languages';
|
|
3
3
|
import { AvatarProps } from '../../../buttons/Avatar/Avatar';
|
|
4
4
|
interface TopbarProps {
|
|
5
|
+
/**
|
|
6
|
+
* If true the sidebar is open.
|
|
7
|
+
*/
|
|
5
8
|
open: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Internationalization locale.
|
|
11
|
+
*/
|
|
6
12
|
locale: Locale;
|
|
13
|
+
/**
|
|
14
|
+
* Function to call when closing the sidebar
|
|
15
|
+
*/
|
|
7
16
|
onSidebarClose: () => void;
|
|
17
|
+
/**
|
|
18
|
+
* Function to call when opening the sidebar
|
|
19
|
+
*/
|
|
8
20
|
onSidebarOpen: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* The props to be passed to the Avatar button component.
|
|
23
|
+
*/
|
|
9
24
|
avatar?: AvatarProps;
|
|
10
25
|
}
|
|
11
26
|
declare const Topbar: React.FC<TopbarProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Topbar.d.ts","sourceRoot":"","sources":["../../../../../../src/components/layout/components/Topbar/Topbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,
|
|
1
|
+
{"version":3,"file":"Topbar.d.ts","sourceRoot":"","sources":["../../../../../../src/components/layout/components/Topbar/Topbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAU,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAIrE,UAAU,WAAW;IACnB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B;;OAEG;IACH,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAsDjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -16,7 +16,7 @@ import MenuTwoToneIcon from '@mui/icons-material/MenuTwoTone';
|
|
|
16
16
|
import ModeNightIcon from '@mui/icons-material/ModeNight';
|
|
17
17
|
import { IconButton, Toolbar, Tooltip, useTheme as useMUITheme, } from '@mui/material';
|
|
18
18
|
import { LanguageSelect } from '../../../buttons';
|
|
19
|
-
import Avatar from '../../../buttons/Avatar/Avatar';
|
|
19
|
+
import { Avatar } from '../../../buttons/Avatar/Avatar';
|
|
20
20
|
import ElevationScroll from './ElevationScroll';
|
|
21
21
|
import * as S from './Topbar.styles';
|
|
22
22
|
import t from './translations.json';
|
package/lib/src/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export { Accordion, Avatar, CircularLoading, DotWaveLoading, LanguageSelect, Min
|
|
|
2
2
|
export type { AccordionProps, AppLogoInfo, AvatarProps, ButtonGroupOption, FooterProps, LanguageSelectProps, LoaderProps, SidebarLink, SidebarProps, ToggleButtonGroupProps, } from './components';
|
|
3
3
|
export { isStringTranslation } from './types';
|
|
4
4
|
export type { DBRow, DBRows, Locale, PaginatedResponse, Query, StringTranslation, } from './types';
|
|
5
|
-
export { camelToSnake, colorToRgb, commonStart, dateDiff, getTextColor, getTimeStr, hexToRgb, isValidDate, PageProvider, stringToColor, toTitleCase, useAPI, useLocale, usePersistedState, useUserInfo, } from './utils';
|
|
5
|
+
export { camelToSnake, colorToRgb, commonStart, dateDiff, getTextColor, getTimeStr, hexToRgb, isValidDate, PageProvider, stringToColor, toLocalStandardDateString, toTitleCase, useAPI, useLocale, usePersistedState, useUserInfo, } from './utils';
|
|
6
6
|
export type { UserInfo } from './utils';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,cAAc,EACd,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,cAAc,EACd,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,YAAY,EACV,KAAK,EACL,MAAM,EACN,MAAM,EACN,iBAAiB,EACjB,KAAK,EACL,iBAAiB,GAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,aAAa,EACb,WAAW,EACX,MAAM,EACN,SAAS,EACT,iBAAiB,EACjB,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,cAAc,EACd,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,cAAc,EACd,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,YAAY,EACV,KAAK,EACL,MAAM,EACN,MAAM,EACN,iBAAiB,EACjB,KAAK,EACL,iBAAiB,GAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,aAAa,EACb,yBAAyB,EACzB,WAAW,EACX,MAAM,EACN,SAAS,EACT,iBAAiB,EACjB,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC"}
|
package/lib/src/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Accordion, Avatar, CircularLoading, DotWaveLoading, LanguageSelect, MinimalLayout, StandardLayout, ToggleButtonGroup, } from './components';
|
|
2
2
|
export { isStringTranslation } from './types';
|
|
3
|
-
export { camelToSnake, colorToRgb, commonStart, dateDiff, getTextColor, getTimeStr, hexToRgb, isValidDate, PageProvider, stringToColor, toTitleCase, useAPI, useLocale, usePersistedState, useUserInfo, } from './utils';
|
|
3
|
+
export { camelToSnake, colorToRgb, commonStart, dateDiff, getTextColor, getTimeStr, hexToRgb, isValidDate, PageProvider, stringToColor, toLocalStandardDateString, toTitleCase, useAPI, useLocale, usePersistedState, useUserInfo, } from './utils';
|
|
@@ -4,11 +4,28 @@ export type StringTranslation = {
|
|
|
4
4
|
[key in Locale]?: string;
|
|
5
5
|
};
|
|
6
6
|
export interface Language {
|
|
7
|
+
/**
|
|
8
|
+
* Language unique identifier.
|
|
9
|
+
*/
|
|
7
10
|
id: Locale;
|
|
11
|
+
/**
|
|
12
|
+
* Language label.
|
|
13
|
+
*/
|
|
8
14
|
label: string;
|
|
15
|
+
/**
|
|
16
|
+
* Language corresponding country code (used for flag association)
|
|
17
|
+
*/
|
|
9
18
|
countryCode: CountryCode;
|
|
19
|
+
/**
|
|
20
|
+
* Language corresponding locale for Material UI (e.g. 'enUS', 'itIT, ecc...)
|
|
21
|
+
*/
|
|
10
22
|
MUILocale: string;
|
|
11
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Type guard for StringTranslation type.
|
|
26
|
+
*
|
|
27
|
+
* @param {unknown} value the value whose type needs checking.
|
|
28
|
+
*/
|
|
12
29
|
export declare const isStringTranslation: (value: unknown) => value is StringTranslation;
|
|
13
30
|
export declare const flagIcons: {
|
|
14
31
|
[key in CountryCode]: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../../src/types/languages.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC/C,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG;KAC7B,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,MAAM;CACzB,CAAC;AAEF,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,WAAW,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,mBAAmB,UACvB,OAAO,+BAGf,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE;KAAG,GAAG,IAAI,WAAW,GAAG,MAAM;CAKrD,CAAC"}
|
|
1
|
+
{"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../../src/types/languages.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC/C,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG;KAC7B,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,MAAM;CACzB,CAAC;AAEF,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,UACvB,OAAO,+BAGf,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE;KAAG,GAAG,IAAI,WAAW,GAAG,MAAM;CAKrD,CAAC"}
|
|
@@ -6,4 +6,5 @@ export declare const dateDiff: (date1: Date, date2: Date) => {
|
|
|
6
6
|
};
|
|
7
7
|
export declare const getTimeStr: (value: number) => string;
|
|
8
8
|
export declare const isValidDate: (d: string | Date) => d is Date;
|
|
9
|
+
export declare const toLocalStandardDateString: (d: string | Date) => string | undefined;
|
|
9
10
|
//# sourceMappingURL=dateHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateHelpers.d.ts","sourceRoot":"","sources":["../../../../src/utils/helpers/dateHelpers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,UAAW,IAAI,SAAS,IAAI;;;;;CAkBhD,CAAC;AAEF,eAAO,MAAM,UAAU,UAAW,MAAM,WASvC,CAAC;AAEF,eAAO,MAAM,WAAW,MAAO,MAAM,GAAG,IAAI,cAG3C,CAAC"}
|
|
1
|
+
{"version":3,"file":"dateHelpers.d.ts","sourceRoot":"","sources":["../../../../src/utils/helpers/dateHelpers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,UAAW,IAAI,SAAS,IAAI;;;;;CAkBhD,CAAC;AAEF,eAAO,MAAM,UAAU,UAAW,MAAM,WASvC,CAAC;AAEF,eAAO,MAAM,WAAW,MAAO,MAAM,GAAG,IAAI,cAG3C,CAAC;AAEF,eAAO,MAAM,yBAAyB,MAAO,MAAM,GAAG,IAAI,uBAczD,CAAC"}
|
|
@@ -27,3 +27,17 @@ export var isValidDate = function (d) {
|
|
|
27
27
|
var date = new Date(d);
|
|
28
28
|
return date instanceof Date && !isNaN(date.getDate());
|
|
29
29
|
};
|
|
30
|
+
export var toLocalStandardDateString = function (d) {
|
|
31
|
+
// converts date to locale YYYY/MM/DD format
|
|
32
|
+
if (isValidDate(d)) {
|
|
33
|
+
var date = new Date(d);
|
|
34
|
+
var isoDateTime = new Date(date.getTime() - date.getTimezoneOffset() * 60000)
|
|
35
|
+
.toISOString()
|
|
36
|
+
.split('T')[0];
|
|
37
|
+
return isoDateTime;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
console.error('Input is not a Date!');
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { colorToRgb, getTextColor, hexToRgb } from './colorHelpers';
|
|
2
|
-
export { dateDiff, getTimeStr, isValidDate } from './dateHelpers';
|
|
2
|
+
export { dateDiff, getTimeStr, isValidDate, toLocalStandardDateString, } from './dateHelpers';
|
|
3
3
|
export { camelToSnake, commonStart, stringToColor, toTitleCase, } from './stringHelpers';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EACL,QAAQ,EACR,UAAU,EACV,WAAW,EACX,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,EACZ,WAAW,EACX,aAAa,EACb,WAAW,GACZ,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { colorToRgb, getTextColor, hexToRgb } from './colorHelpers';
|
|
2
|
-
export { dateDiff, getTimeStr, isValidDate } from './dateHelpers';
|
|
2
|
+
export { dateDiff, getTimeStr, isValidDate, toLocalStandardDateString, } from './dateHelpers';
|
|
3
3
|
export { camelToSnake, commonStart, stringToColor, toTitleCase, } from './stringHelpers';
|