blue-react 8.1.7 → 8.3.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/LICENSE +164 -164
- package/README.md +59 -59
- package/dist/components/ActionMenu.js +2 -2
- package/dist/components/ActionMenuSwitch.js +2 -2
- package/dist/components/Body.js +2 -2
- package/dist/components/BodyRounded.js +2 -2
- package/dist/components/Caret.js +2 -2
- package/dist/components/DocumentView.js +2 -2
- package/dist/components/Grid.js +287 -287
- package/dist/components/Header.js +2 -2
- package/dist/components/HeaderTitle.js +3 -3
- package/dist/components/Intro.js +2 -2
- package/dist/components/Layout.js +19 -19
- package/dist/components/MenuItem.js +11 -20
- package/dist/components/Modal.js +11 -7
- package/dist/components/ModalProvider.js +18 -9
- package/dist/components/Outside.js +6 -6
- package/dist/components/Page.js +2 -2
- package/dist/components/Search.js +2 -2
- package/dist/components/SidebarMenu.js +2 -2
- package/dist/components/Switch.js +2 -2
- package/dist/style.css +8701 -4960
- package/dist/style.css.map +1 -0
- package/dist/style.min.css +10 -12
- package/dist/style.scss +28 -28
- package/dist/styles/_action-menu.scss +81 -81
- package/dist/styles/_bootstrap-mixins_overwritten.scss +106 -106
- package/dist/styles/_bootstrap-optimizations.scss +13 -13
- package/dist/styles/_bootstrap-variables.scss +15 -15
- package/dist/styles/_bootstrap.scss +56 -56
- package/dist/styles/_caret.scss +50 -50
- package/dist/styles/_document-view.scss +6 -6
- package/dist/styles/_general.scss +177 -177
- package/dist/styles/_grid.scss +381 -381
- package/dist/styles/_hover.scss +42 -42
- package/dist/styles/_keyframes.scss +73 -73
- package/dist/styles/_mixins.scss +6 -6
- package/dist/styles/_router.scss +18 -18
- package/dist/styles/_search.scss +61 -61
- package/dist/styles/_status.scss +149 -149
- package/dist/styles/_switch.scss +21 -21
- package/dist/styles/_tooltips.scss +189 -189
- package/dist/styles/_variables.scss +97 -97
- package/dist/styles/mixins/_action-menu.scss +68 -68
- package/dist/styles/mixins/_custom-property.scss +10 -10
- package/dist/styles/mixins/_misc.scss +33 -33
- package/dist/styles/mixins/_scroll-shadow.scss +9 -9
- package/dist/styles/mixins/_sidebar.scss +156 -156
- package/dist/styles/mixins/_switch.scss +85 -85
- package/dist/types/components/ActionMenu.d.ts +22 -22
- package/dist/types/components/ActionMenuSwitch.d.ts +11 -11
- package/dist/types/components/Body.d.ts +21 -21
- package/dist/types/components/BodyRounded.d.ts +10 -10
- package/dist/types/components/Caret.d.ts +16 -16
- package/dist/types/components/DocumentView.d.ts +23 -23
- package/dist/types/components/Grid.d.ts +110 -110
- package/dist/types/components/Header.d.ts +8 -8
- package/dist/types/components/HeaderTitle.d.ts +29 -29
- package/dist/types/components/Intro.d.ts +23 -23
- package/dist/types/components/Layout.d.ts +120 -120
- package/dist/types/components/MenuItem.d.ts +69 -69
- package/dist/types/components/Modal.d.ts +25 -24
- package/dist/types/components/ModalProvider.d.ts +11 -11
- package/dist/types/components/Outside.d.ts +14 -14
- package/dist/types/components/Page.d.ts +12 -12
- package/dist/types/components/Search.d.ts +30 -30
- package/dist/types/components/SidebarMenu.d.ts +32 -32
- package/dist/types/components/Status.d.ts +12 -12
- package/dist/types/components/StatusProvider.d.ts +15 -15
- package/dist/types/components/Switch.d.ts +21 -21
- package/dist/types/components/Utilities.d.ts +17 -17
- package/dist/types/components/shared.d.ts +15 -15
- package/index.d.ts +65 -65
- package/index.js +27 -27
- package/package.json +88 -88
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
@mixin switch(
|
|
2
|
-
$width: 35px,
|
|
3
|
-
$height: 20px,
|
|
4
|
-
$padding: 3px,
|
|
5
|
-
$color: $body-color,
|
|
6
|
-
$color-active: $success
|
|
7
|
-
) {
|
|
8
|
-
$slider-size: $height - ($padding * 2);
|
|
9
|
-
|
|
10
|
-
& {
|
|
11
|
-
position: relative;
|
|
12
|
-
display: inline-block;
|
|
13
|
-
width: $width;
|
|
14
|
-
height: $height;
|
|
15
|
-
|
|
16
|
-
input {
|
|
17
|
-
display: none;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&.disabled {
|
|
21
|
-
opacity: 0.8;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&:not(.disabled) {
|
|
25
|
-
.slider {
|
|
26
|
-
cursor: pointer;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.slider {
|
|
31
|
-
position: absolute;
|
|
32
|
-
top: 0;
|
|
33
|
-
left: 0;
|
|
34
|
-
right: 0;
|
|
35
|
-
bottom: 0;
|
|
36
|
-
background-color: $input-group-addon-bg;
|
|
37
|
-
transition: 0.4s;
|
|
38
|
-
box-shadow: inset 0 0 0 1px rgba($color, 0.5);
|
|
39
|
-
|
|
40
|
-
&::before {
|
|
41
|
-
content: "";
|
|
42
|
-
position: absolute;
|
|
43
|
-
height: $slider-size;
|
|
44
|
-
width: $slider-size;
|
|
45
|
-
left: $padding;
|
|
46
|
-
bottom: $padding;
|
|
47
|
-
background-color: $color;
|
|
48
|
-
transition: 0.4s;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&::after {
|
|
52
|
-
content: attr(data-label);
|
|
53
|
-
position: absolute;
|
|
54
|
-
top: 50%;
|
|
55
|
-
left: 50%;
|
|
56
|
-
transform: translate(-50%, -50%);
|
|
57
|
-
margin-left: ($slider-size * 0.5);
|
|
58
|
-
transition: margin-left 0.4s;
|
|
59
|
-
color: $color;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
input:checked {
|
|
64
|
-
& + .slider {
|
|
65
|
-
background-color: $color-active;
|
|
66
|
-
box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.3);
|
|
67
|
-
|
|
68
|
-
&::before {
|
|
69
|
-
transform: translateX(
|
|
70
|
-
$width - $slider-size - ($padding * 2)
|
|
71
|
-
);
|
|
72
|
-
background-color: white;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
&::after {
|
|
76
|
-
color: white;
|
|
77
|
-
margin-left: ($slider-size * 0.5) * -1;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
input:focus + .slider {
|
|
82
|
-
box-shadow: 0 0 1px $color-active;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
1
|
+
@mixin switch(
|
|
2
|
+
$width: 35px,
|
|
3
|
+
$height: 20px,
|
|
4
|
+
$padding: 3px,
|
|
5
|
+
$color: $body-color,
|
|
6
|
+
$color-active: $success
|
|
7
|
+
) {
|
|
8
|
+
$slider-size: $height - ($padding * 2);
|
|
9
|
+
|
|
10
|
+
& {
|
|
11
|
+
position: relative;
|
|
12
|
+
display: inline-block;
|
|
13
|
+
width: $width;
|
|
14
|
+
height: $height;
|
|
15
|
+
|
|
16
|
+
input {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&.disabled {
|
|
21
|
+
opacity: 0.8;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:not(.disabled) {
|
|
25
|
+
.slider {
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.slider {
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 0;
|
|
33
|
+
left: 0;
|
|
34
|
+
right: 0;
|
|
35
|
+
bottom: 0;
|
|
36
|
+
background-color: $input-group-addon-bg;
|
|
37
|
+
transition: 0.4s;
|
|
38
|
+
box-shadow: inset 0 0 0 1px rgba($color, 0.5);
|
|
39
|
+
|
|
40
|
+
&::before {
|
|
41
|
+
content: "";
|
|
42
|
+
position: absolute;
|
|
43
|
+
height: $slider-size;
|
|
44
|
+
width: $slider-size;
|
|
45
|
+
left: $padding;
|
|
46
|
+
bottom: $padding;
|
|
47
|
+
background-color: $color;
|
|
48
|
+
transition: 0.4s;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&::after {
|
|
52
|
+
content: attr(data-label);
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 50%;
|
|
55
|
+
left: 50%;
|
|
56
|
+
transform: translate(-50%, -50%);
|
|
57
|
+
margin-left: ($slider-size * 0.5);
|
|
58
|
+
transition: margin-left 0.4s;
|
|
59
|
+
color: $color;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
input:checked {
|
|
64
|
+
& + .slider {
|
|
65
|
+
background-color: $color-active;
|
|
66
|
+
box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.3);
|
|
67
|
+
|
|
68
|
+
&::before {
|
|
69
|
+
transform: translateX(
|
|
70
|
+
$width - $slider-size - ($padding * 2)
|
|
71
|
+
);
|
|
72
|
+
background-color: white;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&::after {
|
|
76
|
+
color: white;
|
|
77
|
+
margin-left: ($slider-size * 0.5) * -1;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
input:focus + .slider {
|
|
82
|
+
box-shadow: 0 0 1px $color-active;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { breakOption } from "./shared";
|
|
3
|
-
export interface ActionMenuProps {
|
|
4
|
-
/**
|
|
5
|
-
* Hides the toggle button in mobile view. Can be useful when using multiple ActionMenus and not show the toggle button for each menu.
|
|
6
|
-
*/
|
|
7
|
-
hideToggleAction?: boolean;
|
|
8
|
-
children?: any;
|
|
9
|
-
/**
|
|
10
|
-
* Icon component for the toggle icon.
|
|
11
|
-
*/
|
|
12
|
-
toggleIcon?: any;
|
|
13
|
-
className?: string;
|
|
14
|
-
/**
|
|
15
|
-
* "sm" | "md" | "lg" | "xl" | "none"
|
|
16
|
-
*/
|
|
17
|
-
break?: breakOption | "none";
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* The Action Menu on the top right of a page. You can place Actions here which are in context of the current page.
|
|
21
|
-
*/
|
|
22
|
-
export default function ActionMenu(props: ActionMenuProps): JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { breakOption } from "./shared";
|
|
3
|
+
export interface ActionMenuProps {
|
|
4
|
+
/**
|
|
5
|
+
* Hides the toggle button in mobile view. Can be useful when using multiple ActionMenus and not show the toggle button for each menu.
|
|
6
|
+
*/
|
|
7
|
+
hideToggleAction?: boolean;
|
|
8
|
+
children?: any;
|
|
9
|
+
/**
|
|
10
|
+
* Icon component for the toggle icon.
|
|
11
|
+
*/
|
|
12
|
+
toggleIcon?: any;
|
|
13
|
+
className?: string;
|
|
14
|
+
/**
|
|
15
|
+
* "sm" | "md" | "lg" | "xl" | "none"
|
|
16
|
+
*/
|
|
17
|
+
break?: breakOption | "none";
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The Action Menu on the top right of a page. You can place Actions here which are in context of the current page.
|
|
21
|
+
*/
|
|
22
|
+
export default function ActionMenu(props: ActionMenuProps): JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface ActionMenuSwitchProps {
|
|
3
|
-
className?: string;
|
|
4
|
-
checked?: boolean;
|
|
5
|
-
onChange?: () => void;
|
|
6
|
-
label?: any;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Switch for the Action Menu.
|
|
10
|
-
*/
|
|
11
|
-
export default function ActionMenuSwitch(props: ActionMenuSwitchProps): JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface ActionMenuSwitchProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
onChange?: () => void;
|
|
6
|
+
label?: any;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Switch for the Action Menu.
|
|
10
|
+
*/
|
|
11
|
+
export default function ActionMenuSwitch(props: ActionMenuSwitchProps): JSX.Element;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { breakOption } from "./shared";
|
|
3
|
-
export interface BodyProps {
|
|
4
|
-
id?: string;
|
|
5
|
-
className?: string;
|
|
6
|
-
/**
|
|
7
|
-
* Class name for the container. More info: https://getbootstrap.com/docs/4.0/layout/overview/#containers
|
|
8
|
-
*/
|
|
9
|
-
containerClass?: string;
|
|
10
|
-
/**
|
|
11
|
-
* Set `true` if this page uses `<Actions />`, so this component will get enough padding to avoid overlapping of the content.
|
|
12
|
-
*/
|
|
13
|
-
hasActions?: boolean;
|
|
14
|
-
break?: breakOption;
|
|
15
|
-
onClick?: (event: any) => void;
|
|
16
|
-
children?: any;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Contains the content of the page.
|
|
20
|
-
*/
|
|
21
|
-
export default function Body({ id, className, containerClass, hasActions, onClick, children, ...rest }: BodyProps): JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { breakOption } from "./shared";
|
|
3
|
+
export interface BodyProps {
|
|
4
|
+
id?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Class name for the container. More info: https://getbootstrap.com/docs/4.0/layout/overview/#containers
|
|
8
|
+
*/
|
|
9
|
+
containerClass?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Set `true` if this page uses `<Actions />`, so this component will get enough padding to avoid overlapping of the content.
|
|
12
|
+
*/
|
|
13
|
+
hasActions?: boolean;
|
|
14
|
+
break?: breakOption;
|
|
15
|
+
onClick?: (event: any) => void;
|
|
16
|
+
children?: any;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Contains the content of the page.
|
|
20
|
+
*/
|
|
21
|
+
export default function Body({ id, className, containerClass, hasActions, onClick, children, ...rest }: BodyProps): JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { BodyProps } from "./Body";
|
|
3
|
-
export interface BodyRoundedProps extends BodyProps {
|
|
4
|
-
classNameTop?: string;
|
|
5
|
-
classNameBottom?: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Extended variation of `Body` with rounded elements on top and bottom of the page.
|
|
9
|
-
*/
|
|
10
|
-
export default function BodyRounded({ classNameTop, classNameBottom, children, ...bodyProps }: BodyRoundedProps): JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BodyProps } from "./Body";
|
|
3
|
+
export interface BodyRoundedProps extends BodyProps {
|
|
4
|
+
classNameTop?: string;
|
|
5
|
+
classNameBottom?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Extended variation of `Body` with rounded elements on top and bottom of the page.
|
|
9
|
+
*/
|
|
10
|
+
export default function BodyRounded({ classNameTop, classNameBottom, children, ...bodyProps }: BodyRoundedProps): JSX.Element;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface CaretProps {
|
|
3
|
-
/**
|
|
4
|
-
* Indicates if open or not.
|
|
5
|
-
*/
|
|
6
|
-
open?: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* By default the caret points to the right when closed. Set mirrored and it will point to the left.
|
|
9
|
-
*/
|
|
10
|
-
mirrored?: boolean;
|
|
11
|
-
className?: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Caret icon component.
|
|
15
|
-
*/
|
|
16
|
-
export default function Caret({ open, mirrored, className }: CaretProps): JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface CaretProps {
|
|
3
|
+
/**
|
|
4
|
+
* Indicates if open or not.
|
|
5
|
+
*/
|
|
6
|
+
open?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* By default the caret points to the right when closed. Set mirrored and it will point to the left.
|
|
9
|
+
*/
|
|
10
|
+
mirrored?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Caret icon component.
|
|
15
|
+
*/
|
|
16
|
+
export default function Caret({ open, mirrored, className }: CaretProps): JSX.Element;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface DocumentViewProps {
|
|
3
|
-
/**
|
|
4
|
-
* Source of the content (URL)
|
|
5
|
-
*/
|
|
6
|
-
src?: string;
|
|
7
|
-
/**
|
|
8
|
-
* Instead of a source, you can also set the content directly (HTML)
|
|
9
|
-
*/
|
|
10
|
-
content?: string;
|
|
11
|
-
/**
|
|
12
|
-
* MIME type of the content (e.g. "application/pdf")
|
|
13
|
-
*/
|
|
14
|
-
mimeType: string;
|
|
15
|
-
/**
|
|
16
|
-
* Label for the button to display
|
|
17
|
-
*/
|
|
18
|
-
showDocumentLabel: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Tries to display content in an iframe. When the content can't displayed in an iframe, it will show a download button instead.
|
|
22
|
-
*/
|
|
23
|
-
export default function DocumentView({ content, mimeType, src, showDocumentLabel }: DocumentViewProps): JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface DocumentViewProps {
|
|
3
|
+
/**
|
|
4
|
+
* Source of the content (URL)
|
|
5
|
+
*/
|
|
6
|
+
src?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Instead of a source, you can also set the content directly (HTML)
|
|
9
|
+
*/
|
|
10
|
+
content?: string;
|
|
11
|
+
/**
|
|
12
|
+
* MIME type of the content (e.g. "application/pdf")
|
|
13
|
+
*/
|
|
14
|
+
mimeType: string;
|
|
15
|
+
/**
|
|
16
|
+
* Label for the button to display
|
|
17
|
+
*/
|
|
18
|
+
showDocumentLabel: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Tries to display content in an iframe. When the content can't displayed in an iframe, it will show a download button instead.
|
|
22
|
+
*/
|
|
23
|
+
export default function DocumentView({ content, mimeType, src, showDocumentLabel }: DocumentViewProps): JSX.Element;
|
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
import { Component, CSSProperties } from "react";
|
|
2
|
-
declare global {
|
|
3
|
-
interface Window {
|
|
4
|
-
blueLayoutRef: any;
|
|
5
|
-
toggleSidebarEvent: any;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
export interface LayoutProps {
|
|
9
|
-
id?: string;
|
|
10
|
-
sidebarIn?: boolean;
|
|
11
|
-
style?: CSSProperties;
|
|
12
|
-
/**
|
|
13
|
-
* Sidebar is automatically expanded on wider views.
|
|
14
|
-
*/
|
|
15
|
-
expandSidebar?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Disables sidebar.
|
|
18
|
-
*/
|
|
19
|
-
hideSidebarMenu?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Registers pages for the built-in routing system. Example: `[{name: "home", component: <HomePage />}]`
|
|
22
|
-
*/
|
|
23
|
-
pages?: {
|
|
24
|
-
name: string;
|
|
25
|
-
component: JSX.Element;
|
|
26
|
-
}[];
|
|
27
|
-
/**
|
|
28
|
-
* When `true`, always the "home" route will be rendered.
|
|
29
|
-
*/
|
|
30
|
-
unrouteable?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Extends `className`.
|
|
33
|
-
*/
|
|
34
|
-
className?: string;
|
|
35
|
-
/**
|
|
36
|
-
* By default, the document title will automatically set. Set this prop to `true` to disable this behaviour.
|
|
37
|
-
*/
|
|
38
|
-
disableTitleSet?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* If you don't use blueicon, you can define another icon element for the sidebar toggle button.
|
|
41
|
-
*/
|
|
42
|
-
sidebarToggleIconComponent?: any;
|
|
43
|
-
/**
|
|
44
|
-
* Will replace status icons with custom ones. This will also overwrite the `useBlueicons` option.
|
|
45
|
-
* This can be a SVG component or a normal element component.
|
|
46
|
-
*/
|
|
47
|
-
statusIcons?: {
|
|
48
|
-
danger: any;
|
|
49
|
-
info: any;
|
|
50
|
-
success: any;
|
|
51
|
-
warning: any;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Disables the header bars on pages.
|
|
55
|
-
*/
|
|
56
|
-
disableHeaders?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Define a function, that will be fired when switching routes. When your function returns `true`, the default route behaviour will be blocked.
|
|
59
|
-
* You can use something like `window.blueLayoutRef.setState({ blockRouting: onHashChange })` globally to set the value from anywhere in your app.
|
|
60
|
-
*/
|
|
61
|
-
blockRouting?: (newMatch: string[], currentMatch: string[]) => void | boolean;
|
|
62
|
-
}
|
|
63
|
-
export interface LayoutState {
|
|
64
|
-
sidebarIn?: boolean;
|
|
65
|
-
match: any;
|
|
66
|
-
history: string[];
|
|
67
|
-
hash: string;
|
|
68
|
-
hashHistory: string[];
|
|
69
|
-
blockRouting?: (newMatch: string[], currentMatch: string[]) => void | boolean;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* The main component. As soon this component is mounted, it is globally available under `window.blueLayoutRef`.
|
|
73
|
-
* Also you can append your own event listeners with `blueLayoutRef.addEventListener(eventName, (prevProps, prevState) => { })`.
|
|
74
|
-
*
|
|
75
|
-
* Allowed event listeners:
|
|
76
|
-
*
|
|
77
|
-
* * **componentDidUpdate** - Component was updated.
|
|
78
|
-
* Example: `blueLayoutRef.addEventListener("componentDidUpdate", (prevProps, prevState) => { })`
|
|
79
|
-
* * **pageDidShowAgain** - Page appeared again with the same old state. In the callback function you can reinitialize things.
|
|
80
|
-
* Example: `blueLayoutRef.addEventListener("pageDidShowAgain", "home", (prevProps, prevState) => { })`
|
|
81
|
-
* * **pageDidHide** - This page disappeared and another page appears instead.
|
|
82
|
-
* Example: `blueLayoutRef.addEventListener("pageDidHide", "home", (prevProps, prevState) => { })`
|
|
83
|
-
*/
|
|
84
|
-
export default class Layout extends Component<LayoutProps, LayoutState> {
|
|
85
|
-
defaultMatch: string[];
|
|
86
|
-
eventListeners: any[];
|
|
87
|
-
constructor(props: LayoutProps);
|
|
88
|
-
onHashChange(event: HashChangeEvent): void;
|
|
89
|
-
static get defaultProps(): {
|
|
90
|
-
expandSidebar: boolean;
|
|
91
|
-
hideSidebarMenu: boolean;
|
|
92
|
-
unrouteable: boolean;
|
|
93
|
-
disableTitleSet: boolean;
|
|
94
|
-
sidebarToggleIconComponent: JSX.Element;
|
|
95
|
-
statusIcons: {
|
|
96
|
-
danger: JSX.Element;
|
|
97
|
-
info: JSX.Element;
|
|
98
|
-
success: JSX.Element;
|
|
99
|
-
warning: JSX.Element;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
componentDidMount(): void;
|
|
103
|
-
componentWillUnmount(): void;
|
|
104
|
-
componentDidUpdate(prevProps: LayoutProps, prevState: LayoutState): void;
|
|
105
|
-
toggleSidebar(event: any): void;
|
|
106
|
-
hideSidebar(e: any): void;
|
|
107
|
-
initMatch(): void;
|
|
108
|
-
addEventListener(param1: any, param2: any, param3: any): void;
|
|
109
|
-
render(): JSX.Element;
|
|
110
|
-
}
|
|
1
|
+
import { Component, CSSProperties } from "react";
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
blueLayoutRef: any;
|
|
5
|
+
toggleSidebarEvent: any;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export interface LayoutProps {
|
|
9
|
+
id?: string;
|
|
10
|
+
sidebarIn?: boolean;
|
|
11
|
+
style?: CSSProperties;
|
|
12
|
+
/**
|
|
13
|
+
* Sidebar is automatically expanded on wider views.
|
|
14
|
+
*/
|
|
15
|
+
expandSidebar?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Disables sidebar.
|
|
18
|
+
*/
|
|
19
|
+
hideSidebarMenu?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Registers pages for the built-in routing system. Example: `[{name: "home", component: <HomePage />}]`
|
|
22
|
+
*/
|
|
23
|
+
pages?: {
|
|
24
|
+
name: string;
|
|
25
|
+
component: JSX.Element;
|
|
26
|
+
}[];
|
|
27
|
+
/**
|
|
28
|
+
* When `true`, always the "home" route will be rendered.
|
|
29
|
+
*/
|
|
30
|
+
unrouteable?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Extends `className`.
|
|
33
|
+
*/
|
|
34
|
+
className?: string;
|
|
35
|
+
/**
|
|
36
|
+
* By default, the document title will automatically set. Set this prop to `true` to disable this behaviour.
|
|
37
|
+
*/
|
|
38
|
+
disableTitleSet?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* If you don't use blueicon, you can define another icon element for the sidebar toggle button.
|
|
41
|
+
*/
|
|
42
|
+
sidebarToggleIconComponent?: any;
|
|
43
|
+
/**
|
|
44
|
+
* Will replace status icons with custom ones. This will also overwrite the `useBlueicons` option.
|
|
45
|
+
* This can be a SVG component or a normal element component.
|
|
46
|
+
*/
|
|
47
|
+
statusIcons?: {
|
|
48
|
+
danger: any;
|
|
49
|
+
info: any;
|
|
50
|
+
success: any;
|
|
51
|
+
warning: any;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Disables the header bars on pages.
|
|
55
|
+
*/
|
|
56
|
+
disableHeaders?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Define a function, that will be fired when switching routes. When your function returns `true`, the default route behaviour will be blocked.
|
|
59
|
+
* You can use something like `window.blueLayoutRef.setState({ blockRouting: onHashChange })` globally to set the value from anywhere in your app.
|
|
60
|
+
*/
|
|
61
|
+
blockRouting?: (newMatch: string[], currentMatch: string[]) => void | boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface LayoutState {
|
|
64
|
+
sidebarIn?: boolean;
|
|
65
|
+
match: any;
|
|
66
|
+
history: string[];
|
|
67
|
+
hash: string;
|
|
68
|
+
hashHistory: string[];
|
|
69
|
+
blockRouting?: (newMatch: string[], currentMatch: string[]) => void | boolean;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The main component. As soon this component is mounted, it is globally available under `window.blueLayoutRef`.
|
|
73
|
+
* Also you can append your own event listeners with `blueLayoutRef.addEventListener(eventName, (prevProps, prevState) => { })`.
|
|
74
|
+
*
|
|
75
|
+
* Allowed event listeners:
|
|
76
|
+
*
|
|
77
|
+
* * **componentDidUpdate** - Component was updated.
|
|
78
|
+
* Example: `blueLayoutRef.addEventListener("componentDidUpdate", (prevProps, prevState) => { })`
|
|
79
|
+
* * **pageDidShowAgain** - Page appeared again with the same old state. In the callback function you can reinitialize things.
|
|
80
|
+
* Example: `blueLayoutRef.addEventListener("pageDidShowAgain", "home", (prevProps, prevState) => { })`
|
|
81
|
+
* * **pageDidHide** - This page disappeared and another page appears instead.
|
|
82
|
+
* Example: `blueLayoutRef.addEventListener("pageDidHide", "home", (prevProps, prevState) => { })`
|
|
83
|
+
*/
|
|
84
|
+
export default class Layout extends Component<LayoutProps, LayoutState> {
|
|
85
|
+
defaultMatch: string[];
|
|
86
|
+
eventListeners: any[];
|
|
87
|
+
constructor(props: LayoutProps);
|
|
88
|
+
onHashChange(event: HashChangeEvent): void;
|
|
89
|
+
static get defaultProps(): {
|
|
90
|
+
expandSidebar: boolean;
|
|
91
|
+
hideSidebarMenu: boolean;
|
|
92
|
+
unrouteable: boolean;
|
|
93
|
+
disableTitleSet: boolean;
|
|
94
|
+
sidebarToggleIconComponent: JSX.Element;
|
|
95
|
+
statusIcons: {
|
|
96
|
+
danger: JSX.Element;
|
|
97
|
+
info: JSX.Element;
|
|
98
|
+
success: JSX.Element;
|
|
99
|
+
warning: JSX.Element;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
componentDidMount(): void;
|
|
103
|
+
componentWillUnmount(): void;
|
|
104
|
+
componentDidUpdate(prevProps: LayoutProps, prevState: LayoutState): void;
|
|
105
|
+
toggleSidebar(event: any): void;
|
|
106
|
+
hideSidebar(e: any): void;
|
|
107
|
+
initMatch(): void;
|
|
108
|
+
addEventListener(param1: any, param2: any, param3: any): void;
|
|
109
|
+
render(): JSX.Element;
|
|
110
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface HeaderProps {
|
|
3
|
-
children?: any;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* The top of a page.
|
|
7
|
-
*/
|
|
8
|
-
export default function Header({ children }: HeaderProps): JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface HeaderProps {
|
|
3
|
+
children?: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The top of a page.
|
|
7
|
+
*/
|
|
8
|
+
export default function Header({ children }: HeaderProps): JSX.Element;
|