blue-react 9.12.0 → 9.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/A.d.ts +9 -0
- package/dist/components/ActionMenu.d.ts +25 -0
- package/dist/components/Body.d.ts +21 -0
- package/dist/components/Chevron.d.ts +17 -0
- package/dist/components/Chevron.js +2 -1
- package/dist/components/HashRouter.d.ts +76 -0
- package/dist/components/HashRouter.js +176 -0
- package/dist/components/Header.d.ts +9 -0
- package/dist/components/HeaderTitle.d.ts +40 -0
- package/dist/components/IconMenuItem.d.ts +18 -0
- package/dist/components/Intro.d.ts +22 -0
- package/dist/components/Layout/LayoutHeader.d.ts +4 -0
- package/dist/components/Layout/LayoutHeader.js +25 -0
- package/dist/components/Layout/LayoutMain.d.ts +5 -0
- package/dist/components/Layout/LayoutMain.js +17 -0
- package/dist/components/Layout.d.ts +11 -0
- package/dist/components/MenuItem.d.ts +149 -0
- package/dist/components/Modal.d.ts +30 -0
- package/dist/components/ModalProvider.d.ts +21 -0
- package/dist/components/Outside.d.ts +17 -0
- package/dist/components/Page.d.ts +13 -0
- package/dist/components/Search.d.ts +42 -0
- package/dist/components/SidebarMenu.d.ts +32 -0
- package/dist/components/SidebarToggler.d.ts +11 -0
- package/dist/components/SimpleLayout.d.ts +10 -0
- package/dist/components/SimpleLayout.js +23 -0
- package/dist/components/SlimContainer.d.ts +10 -0
- package/dist/components/Status.d.ts +12 -0
- package/dist/components/StatusProvider.d.ts +15 -0
- package/dist/components/Tab.d.ts +12 -0
- package/dist/components/Tab.js +36 -0
- package/dist/components/Tabs.d.ts +16 -0
- package/dist/components/Tabs.js +18 -0
- package/dist/components/ToastProvider.d.ts +22 -0
- package/dist/components/Utilities.d.ts +41 -0
- package/dist/components/shared.d.ts +15 -0
- package/dist/docs/App.d.ts +3 -0
- package/dist/docs/Global.d.ts +2 -0
- package/dist/docs/components/ColorModeSwitch.d.ts +1 -0
- package/dist/docs/components/ComponentDocs.d.ts +20 -0
- package/dist/docs/components/DemoApp.d.ts +1 -0
- package/dist/docs/components/Footer.d.ts +5 -0
- package/dist/docs/components/HashLink.d.ts +6 -0
- package/dist/docs/components/IntroductionSections.d.ts +1 -0
- package/dist/docs/components/Markdown.d.ts +4 -0
- package/dist/docs/components/NeumorphismExperiments.d.ts +1 -0
- package/dist/docs/components/ReactIcon.d.ts +1 -0
- package/dist/docs/components/StackblitzEmbed.d.ts +1 -0
- package/dist/docs/components/TestCssVars.d.ts +1 -0
- package/dist/docs/components/VersionToggle.d.ts +1 -0
- package/dist/docs/examples/ActionMenu.d.ts +1 -0
- package/dist/docs/examples/ActionMenuItem/Usage.d.ts +1 -0
- package/dist/docs/examples/Chevron/Basic usage.d.ts +1 -0
- package/dist/docs/examples/HeaderTitle/Breadcrumb.d.ts +1 -0
- package/dist/docs/examples/IconMenuItem.d.ts +1 -0
- package/dist/docs/examples/MenuItem/Draggable.d.ts +1 -0
- package/dist/docs/examples/MenuItem/Horizontal layout in sidebar.d.ts +1 -0
- package/dist/docs/examples/MenuItem/Horizontal layout with dropdown.d.ts +1 -0
- package/dist/docs/examples/MenuItem/Sidebar.d.ts +1 -0
- package/dist/docs/examples/MenuItem/Usage in body.d.ts +1 -0
- package/dist/docs/examples/ModalProvider/Custom button text.d.ts +5 -0
- package/dist/docs/examples/ModalProvider.d.ts +5 -0
- package/dist/docs/examples/Search.d.ts +1 -0
- package/dist/docs/examples/SidebarMenuItem.d.ts +1 -0
- package/dist/docs/examples/SimpleLayout/Usage.d.ts +1 -0
- package/dist/docs/examples/SlimContainer.d.ts +1 -0
- package/dist/docs/examples/StatusProvider.d.ts +1 -0
- package/dist/docs/examples/Tabs/Basic usage.d.ts +1 -0
- package/dist/docs/examples/Tabs/BasicUsage.d.ts +1 -0
- package/dist/docs/examples/Tabs/LongTabTitles.d.ts +1 -0
- package/dist/docs/examples/Tabs/Underline.d.ts +1 -0
- package/dist/docs/examples/ToastProvider/Usage.d.ts +1 -0
- package/dist/docs/examples/ToastProvider/Use of custom icons.d.ts +1 -0
- package/dist/docs/examples/css/ButtonsExample.d.ts +3 -0
- package/dist/docs/gitHubApiTypes.d.ts +38 -0
- package/dist/docs/pages/ActionMenuExamplePage.d.ts +1 -0
- package/dist/docs/pages/ComponentPage.d.ts +1 -0
- package/dist/docs/pages/HomePage.d.ts +1 -0
- package/dist/docs/pages/LicenseReportPage.d.ts +1 -0
- package/dist/docs/types.d.ts +10 -0
- package/dist/main.d.ts +1 -0
- package/dist/style.css +9564 -5847
- package/dist/style.css.map +1 -0
- package/dist/style.min.css +12 -16
- package/dist/style.scss +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface AProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* The `<a>` element automatically sets `rel="noreferrer"` for external links with `target="_blank"`.\
|
|
6
|
+
* `A` allows all props of the `<a>` element.\
|
|
7
|
+
* `<A href="https://example.com" target="_blank">Example</A>` ➡️ `<a href="https://example.com" target="_blank" rel="noreferrer">Example</a>`
|
|
8
|
+
*/
|
|
9
|
+
export default function A({ children, rel, ...rest }: AProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { breakOption } from "./shared";
|
|
3
|
+
export declare const ActionMenuContext: React.Context<{
|
|
4
|
+
breakOption: breakOption | "none";
|
|
5
|
+
}>;
|
|
6
|
+
export interface ActionMenuProps {
|
|
7
|
+
/**
|
|
8
|
+
* Hides the toggle button in mobile view. Can be useful when using multiple ActionMenus and not show the toggle button for each menu.
|
|
9
|
+
*/
|
|
10
|
+
hideToggleAction?: boolean;
|
|
11
|
+
children?: any;
|
|
12
|
+
/**
|
|
13
|
+
* Icon component for the toggle icon.
|
|
14
|
+
*/
|
|
15
|
+
toggleIcon?: any;
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* "sm" | "md" | "lg" | "xl" | "none". Default is "lg". The responsive breakpoint at which the menu will be shown as a dropdown.
|
|
19
|
+
*/
|
|
20
|
+
break?: breakOption | "none";
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The Action Menu on the top right of a page. You can place Actions here which are in context of the current page.
|
|
24
|
+
*/
|
|
25
|
+
export default function ActionMenu(props: ActionMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { breakOption } from "./shared";
|
|
2
|
+
export interface BodyProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Class name for the container. More info: https://getbootstrap.com/docs/4.0/layout/overview/#containers
|
|
7
|
+
*/
|
|
8
|
+
containerClass?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Set `true` if this page uses `<Actions />`, so this component will get enough padding to avoid overlapping of the content.
|
|
11
|
+
*/
|
|
12
|
+
hasActions?: boolean;
|
|
13
|
+
break?: breakOption;
|
|
14
|
+
onClick?: (event: any) => void;
|
|
15
|
+
children?: any;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated With the new layout design, you don't need this anymore.
|
|
19
|
+
* Contains the content of the page.
|
|
20
|
+
*/
|
|
21
|
+
export default function Body({ id, className, containerClass, hasActions, onClick, children, ...rest }: BodyProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CSSProperties } from "react";
|
|
2
|
+
export interface ChevronProps {
|
|
3
|
+
/**
|
|
4
|
+
* Indicates if open or not.
|
|
5
|
+
*/
|
|
6
|
+
open?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* By default the chevron points to the right when closed. Set mirrored and it will point to the left.
|
|
9
|
+
*/
|
|
10
|
+
mirrored?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: CSSProperties;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Chevron icon component with open state.
|
|
16
|
+
*/
|
|
17
|
+
export default function Chevron({ open, mirrored, className, style }: ChevronProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -23,6 +23,7 @@ function Chevron(_ref) {
|
|
|
23
23
|
mirrored = _ref.mirrored,
|
|
24
24
|
className = _ref.className,
|
|
25
25
|
style = _ref.style;
|
|
26
|
+
var prefersReducedMotion = window.matchMedia("(prefers-reduced-motion)").matches;
|
|
26
27
|
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
27
28
|
xmlns: "http://www.w3.org/2000/svg",
|
|
28
29
|
width: "1em",
|
|
@@ -33,7 +34,7 @@ function Chevron(_ref) {
|
|
|
33
34
|
display: "inline-block",
|
|
34
35
|
verticalAlign: "-0.125em",
|
|
35
36
|
transform: "rotate(".concat(open && mirrored ? -90 : open ? 90 : 0, "deg)"),
|
|
36
|
-
transition: "transform 0.2s"
|
|
37
|
+
transition: prefersReducedMotion ? "none" : "transform 0.2s"
|
|
37
38
|
}),
|
|
38
39
|
viewBox: "0 0 16 16"
|
|
39
40
|
}, mirrored ? /*#__PURE__*/_react.default.createElement("path", {
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Component, ReactNode } from "react";
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
blueHashRouterRef: any;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export interface HashRouterProps {
|
|
8
|
+
/**
|
|
9
|
+
* Registers pages for the built-in routing system. Example: `[{name: "home", component: <HomePage />}]`
|
|
10
|
+
*/
|
|
11
|
+
pages?: {
|
|
12
|
+
name: string;
|
|
13
|
+
component: ReactNode;
|
|
14
|
+
}[];
|
|
15
|
+
/**
|
|
16
|
+
* When `true`, always the "home" route will be rendered.
|
|
17
|
+
*/
|
|
18
|
+
unrouteable?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* By default, the document title will automatically set. Set this prop to `true` to disable this behaviour.
|
|
21
|
+
*/
|
|
22
|
+
disableTitleSet?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Define a function, that will be fired when switching routes. When your function returns `true`, the default route behaviour will be blocked.
|
|
25
|
+
* You can use something like `window.blueHashRouterRef.setState({ blockRouting: onHashChange })` globally to set the value from anywhere in your app.
|
|
26
|
+
*/
|
|
27
|
+
blockRouting?: (newMatch: string[], currentMatch: string[]) => void | boolean;
|
|
28
|
+
children?: any;
|
|
29
|
+
}
|
|
30
|
+
export interface HashRouterState {
|
|
31
|
+
match: any;
|
|
32
|
+
history: string[];
|
|
33
|
+
hash: string;
|
|
34
|
+
hashHistory: string[];
|
|
35
|
+
blockRouting?: (newMatch: string[], currentMatch: string[]) => void | boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Component for simple hash routing. It's recommended to use solutions like `react-router-dom` for more complex routing.
|
|
39
|
+
*
|
|
40
|
+
* As soon this component is mounted, it is globally available under `window.blueHashRouterRef`.
|
|
41
|
+
* You can also append your own event listeners.
|
|
42
|
+
*
|
|
43
|
+
* Allowed events:
|
|
44
|
+
*
|
|
45
|
+
* * **componentDidUpdate** - Component was updated.
|
|
46
|
+
* Example: `window.blueHashRouterRef.addEventListener("componentDidUpdate", (prevProps, prevState) => { })`
|
|
47
|
+
* * **pageDidShowAgain** - Page appeared again with the same old state. In the callback function you can reinitialize things.
|
|
48
|
+
* Example: `window.blueHashRouterRef.addEventListener("pageDidShowAgain", "home", (prevProps, prevState) => { })`
|
|
49
|
+
* * **pageDidHide** - This page disappeared and another page appears instead.
|
|
50
|
+
* Example: `window.blueHashRouterRef.addEventListener("pageDidHide", "home", (prevProps, prevState) => { })`
|
|
51
|
+
*
|
|
52
|
+
* Method to add event listeners:
|
|
53
|
+
* * `window.blueHashRouterRef.`**addEventListener**`(eventName: string, param2: any, param3: any, listenerId?: string)`
|
|
54
|
+
*
|
|
55
|
+
* Methods to remove event listeners:
|
|
56
|
+
* * `window.blueHashRouterRef.`**removeEventListener**`(eventName: string, listenerId: string)`
|
|
57
|
+
* * `window.blueHashRouterRef.`**removeDuplicatedEventListeners**`()` - Will automatically be called when running `addEventListener`
|
|
58
|
+
*/
|
|
59
|
+
export default class HashRouter extends Component<HashRouterProps, HashRouterState> {
|
|
60
|
+
defaultMatch: string[];
|
|
61
|
+
eventListeners: any[];
|
|
62
|
+
constructor(props: HashRouterProps);
|
|
63
|
+
onHashChange(): void;
|
|
64
|
+
static get defaultProps(): {
|
|
65
|
+
unrouteable: boolean;
|
|
66
|
+
disableTitleSet: boolean;
|
|
67
|
+
};
|
|
68
|
+
componentDidMount(): void;
|
|
69
|
+
componentWillUnmount(): void;
|
|
70
|
+
componentDidUpdate(prevProps: HashRouterProps, prevState: HashRouterState): void;
|
|
71
|
+
initMatch(): void;
|
|
72
|
+
addEventListener(param1: any, param2: any, param3: any, listenerId?: string): void;
|
|
73
|
+
removeEventListener(type: string, listenerId: string): void;
|
|
74
|
+
removeDuplicatedEventListeners(): void;
|
|
75
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
76
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
9
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
12
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
13
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
14
|
+
import React, { Component } from "react";
|
|
15
|
+
/**
|
|
16
|
+
* Component for simple hash routing. It's recommended to use solutions like `react-router-dom` for more complex routing.
|
|
17
|
+
*
|
|
18
|
+
* As soon this component is mounted, it is globally available under `window.blueHashRouterRef`.
|
|
19
|
+
* You can also append your own event listeners.
|
|
20
|
+
*
|
|
21
|
+
* Allowed events:
|
|
22
|
+
*
|
|
23
|
+
* * **componentDidUpdate** - Component was updated.
|
|
24
|
+
* Example: `window.blueHashRouterRef.addEventListener("componentDidUpdate", (prevProps, prevState) => { })`
|
|
25
|
+
* * **pageDidShowAgain** - Page appeared again with the same old state. In the callback function you can reinitialize things.
|
|
26
|
+
* Example: `window.blueHashRouterRef.addEventListener("pageDidShowAgain", "home", (prevProps, prevState) => { })`
|
|
27
|
+
* * **pageDidHide** - This page disappeared and another page appears instead.
|
|
28
|
+
* Example: `window.blueHashRouterRef.addEventListener("pageDidHide", "home", (prevProps, prevState) => { })`
|
|
29
|
+
*
|
|
30
|
+
* Method to add event listeners:
|
|
31
|
+
* * `window.blueHashRouterRef.`**addEventListener**`(eventName: string, param2: any, param3: any, listenerId?: string)`
|
|
32
|
+
*
|
|
33
|
+
* Methods to remove event listeners:
|
|
34
|
+
* * `window.blueHashRouterRef.`**removeEventListener**`(eventName: string, listenerId: string)`
|
|
35
|
+
* * `window.blueHashRouterRef.`**removeDuplicatedEventListeners**`()` - Will automatically be called when running `addEventListener`
|
|
36
|
+
*/
|
|
37
|
+
var HashRouter = /*#__PURE__*/function (_Component) {
|
|
38
|
+
function HashRouter(props) {
|
|
39
|
+
var _this;
|
|
40
|
+
_classCallCheck(this, HashRouter);
|
|
41
|
+
_this = _callSuper(this, HashRouter, [props]);
|
|
42
|
+
window.blueHashRouterRef = _this;
|
|
43
|
+
_this.defaultMatch = ["home"];
|
|
44
|
+
_this.state = {
|
|
45
|
+
match: null,
|
|
46
|
+
history: [],
|
|
47
|
+
hash: window.location.hash,
|
|
48
|
+
hashHistory: [],
|
|
49
|
+
blockRouting: props.blockRouting || undefined
|
|
50
|
+
};
|
|
51
|
+
_this.eventListeners = [];
|
|
52
|
+
return _this;
|
|
53
|
+
}
|
|
54
|
+
_inherits(HashRouter, _Component);
|
|
55
|
+
return _createClass(HashRouter, [{
|
|
56
|
+
key: "onHashChange",
|
|
57
|
+
value: function onHashChange() {
|
|
58
|
+
window.blueHashRouterRef.initMatch();
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "componentDidMount",
|
|
62
|
+
value: function componentDidMount() {
|
|
63
|
+
this.initMatch();
|
|
64
|
+
window.addEventListener("hashchange", this.onHashChange);
|
|
65
|
+
}
|
|
66
|
+
}, {
|
|
67
|
+
key: "componentWillUnmount",
|
|
68
|
+
value: function componentWillUnmount() {
|
|
69
|
+
window.removeEventListener("hashchange", this.onHashChange);
|
|
70
|
+
}
|
|
71
|
+
}, {
|
|
72
|
+
key: "componentDidUpdate",
|
|
73
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
74
|
+
var _this2 = this;
|
|
75
|
+
if (prevProps.blockRouting !== this.props.blockRouting && this.props.blockRouting !== this.state.blockRouting) {
|
|
76
|
+
this.setState({
|
|
77
|
+
blockRouting: this.props.blockRouting
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
this.eventListeners.forEach(function (eventListener) {
|
|
81
|
+
if (eventListener[0] === "componentDidUpdate") {
|
|
82
|
+
eventListener[1](prevProps, prevState);
|
|
83
|
+
}
|
|
84
|
+
if (eventListener[0] === "pageDidShowAgain") {
|
|
85
|
+
var pageId = eventListener[1];
|
|
86
|
+
var callback = eventListener[2];
|
|
87
|
+
if (prevState.hash !== _this2.state.hash && _this2.state.match[0] === pageId) {
|
|
88
|
+
callback(prevProps, prevState);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (eventListener[0] === "pageDidHide") {
|
|
92
|
+
var _pageId = eventListener[1];
|
|
93
|
+
var _callback = eventListener[2];
|
|
94
|
+
if (prevState.hash !== _this2.state.hash && prevState.match[0] === _pageId) {
|
|
95
|
+
_callback(prevProps, prevState);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
key: "initMatch",
|
|
102
|
+
value: function initMatch() {
|
|
103
|
+
var newMatch;
|
|
104
|
+
if (window.location.hash && window.location.hash !== "" && window.location.hash !== "#/") {
|
|
105
|
+
newMatch = window.location.hash.replace("#", "").split("/").filter(function (n) {
|
|
106
|
+
return n !== "";
|
|
107
|
+
});
|
|
108
|
+
} else {
|
|
109
|
+
newMatch = this.defaultMatch;
|
|
110
|
+
}
|
|
111
|
+
if (this.props.unrouteable) {
|
|
112
|
+
newMatch = this.defaultMatch;
|
|
113
|
+
}
|
|
114
|
+
if (this.state.blockRouting && this.state.blockRouting(newMatch, this.state.match) === true) {
|
|
115
|
+
window.location.hash = this.state.hash;
|
|
116
|
+
} else {
|
|
117
|
+
if (!(this.state.history.indexOf(newMatch[0]) > -1)) {
|
|
118
|
+
this.state.history.push(newMatch[0]);
|
|
119
|
+
}
|
|
120
|
+
this.setState({
|
|
121
|
+
match: newMatch,
|
|
122
|
+
history: this.state.history,
|
|
123
|
+
hash: window.location.hash,
|
|
124
|
+
hashHistory: this.state.hashHistory.concat([window.location.hash])
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}, {
|
|
129
|
+
key: "addEventListener",
|
|
130
|
+
value: function addEventListener(param1, param2, param3, listenerId) {
|
|
131
|
+
this.eventListeners.push([param1, param2, param3, listenerId]);
|
|
132
|
+
this.removeDuplicatedEventListeners();
|
|
133
|
+
}
|
|
134
|
+
}, {
|
|
135
|
+
key: "removeEventListener",
|
|
136
|
+
value: function removeEventListener(type, listenerId) {
|
|
137
|
+
this.eventListeners = this.eventListeners.filter(function (param) {
|
|
138
|
+
if (param[0] !== type) {
|
|
139
|
+
return param;
|
|
140
|
+
} else if (param[0] === type && param[3] !== listenerId) {
|
|
141
|
+
return param;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
key: "removeDuplicatedEventListeners",
|
|
147
|
+
value: function removeDuplicatedEventListeners() {
|
|
148
|
+
this.eventListeners = this.eventListeners.filter(function (value, index, self) {
|
|
149
|
+
return index === self.findIndex(function (t) {
|
|
150
|
+
return t[3] === value[3] && t[0] === value[0];
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}, {
|
|
155
|
+
key: "render",
|
|
156
|
+
value: function render() {
|
|
157
|
+
var _this$props$pages,
|
|
158
|
+
_this3 = this;
|
|
159
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, (_this$props$pages = this.props.pages) === null || _this$props$pages === void 0 ? void 0 : _this$props$pages.map(function (page) {
|
|
160
|
+
return _this3.state.history.indexOf(page.name) > -1 && /*#__PURE__*/React.createElement("div", {
|
|
161
|
+
key: page.name,
|
|
162
|
+
className: "router-page " + (_this3.state.match[0] === page.name ? "active" : "d-none")
|
|
163
|
+
}, page.component);
|
|
164
|
+
}));
|
|
165
|
+
}
|
|
166
|
+
}], [{
|
|
167
|
+
key: "defaultProps",
|
|
168
|
+
get: function get() {
|
|
169
|
+
return {
|
|
170
|
+
unrouteable: false,
|
|
171
|
+
disableTitleSet: false
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}]);
|
|
175
|
+
}(Component);
|
|
176
|
+
export { HashRouter as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export interface HeaderProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The top of a page.
|
|
8
|
+
*/
|
|
9
|
+
export default function Header({ children, className }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export interface HeaderTitleProps {
|
|
3
|
+
/**
|
|
4
|
+
* Can be an image. Will be placed inside of the `src` attribute.
|
|
5
|
+
*/
|
|
6
|
+
logo?: string;
|
|
7
|
+
logoAlt?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Text next to the logo.
|
|
10
|
+
*/
|
|
11
|
+
appTitle?: string;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Extends `className` from parent element.
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Is the component used on the sidebar?
|
|
19
|
+
*/
|
|
20
|
+
sidebar?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* By default, MenuItem is a `"a"`.
|
|
23
|
+
* If you want to have it another type, you can pass a component reference with this prop (e.g. `Link`).
|
|
24
|
+
*/
|
|
25
|
+
elementType?: any;
|
|
26
|
+
/**
|
|
27
|
+
* Sets `to` prop, e.g. when you use the `Link` component from React Router.
|
|
28
|
+
*/
|
|
29
|
+
to?: string;
|
|
30
|
+
href?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Breadcrumb items to be shown.
|
|
33
|
+
*/
|
|
34
|
+
breadcrumb?: ReactNode[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The title area at the header bar.
|
|
38
|
+
* Depending on its content, the document's title will be set aswell (what will be shown in the browser title bar).
|
|
39
|
+
*/
|
|
40
|
+
export default function HeaderTitle({ logo, logoAlt, appTitle, children, className, sidebar, elementType, to, href, breadcrumb }: HeaderTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MenuItemProps } from "./MenuItem";
|
|
2
|
+
export interface IconMenuItemProps extends MenuItemProps {
|
|
3
|
+
outerClass?: string;
|
|
4
|
+
/**
|
|
5
|
+
* Tooltip will be placed to the end/right by default. You can change the direction with this prop.
|
|
6
|
+
*/
|
|
7
|
+
tooltipClass?: string;
|
|
8
|
+
/**
|
|
9
|
+
* When used inside of the sidebar: active indicator will be displayed underneath instead of before.
|
|
10
|
+
* The prop to `false` to disable this behavior.
|
|
11
|
+
*/
|
|
12
|
+
horizontalOnOpenSidebar?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Variant of `MenuItem` to primarily display an icon without a label.
|
|
16
|
+
* The label prop will be displayed as a tooltip.
|
|
17
|
+
*/
|
|
18
|
+
export default function IconMenuItem({ label, outerClass, tooltipClass, horizontalOnOpenSidebar, className, ...props }: IconMenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface IntroProps {
|
|
2
|
+
/**
|
|
3
|
+
* Can be an image. Will be placed inside of the `src` attribute.
|
|
4
|
+
*/
|
|
5
|
+
logo?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Max width from the logo.
|
|
8
|
+
*/
|
|
9
|
+
logoMaxWidth?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Text which will be placed under the logo.
|
|
12
|
+
*/
|
|
13
|
+
title?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Content
|
|
16
|
+
*/
|
|
17
|
+
children?: any;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Can be used for a sign-in page.
|
|
21
|
+
*/
|
|
22
|
+
export default function Intro({ logo, logoMaxWidth, title, children }: IntroProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["children", "className"];
|
|
3
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
11
|
+
import React from "react";
|
|
12
|
+
export default function LayoutHeader(_ref) {
|
|
13
|
+
var children = _ref.children,
|
|
14
|
+
className = _ref.className,
|
|
15
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
return /*#__PURE__*/React.createElement("header", _extends({
|
|
17
|
+
className: "d-flex justify-content-between position-relative h-100 ".concat(className),
|
|
18
|
+
style: _objectSpread({
|
|
19
|
+
color: "var(--blue-sidebar-color)",
|
|
20
|
+
background: "var(--blue-sidebar-bg)",
|
|
21
|
+
zIndex: "var(--blue-layout-header-z-index, 4)",
|
|
22
|
+
"--blue-menu-item-dropdown-bg": "var(--blue-sidebar-bg)"
|
|
23
|
+
}, rest.style)
|
|
24
|
+
}, rest), children);
|
|
25
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface LayoutMainProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
noPageBorder?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export default function LayoutMain({ children, className, noPageBorder, ...rest }: LayoutMainProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var _excluded = ["children", "className", "noPageBorder"];
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
5
|
+
import React from "react";
|
|
6
|
+
export default function LayoutMain(_ref) {
|
|
7
|
+
var children = _ref.children,
|
|
8
|
+
className = _ref.className,
|
|
9
|
+
_ref$noPageBorder = _ref.noPageBorder,
|
|
10
|
+
noPageBorder = _ref$noPageBorder === void 0 ? false : _ref$noPageBorder,
|
|
11
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
13
|
+
className: "w-100 h-100 p-1 pt-0 ".concat(className)
|
|
14
|
+
}, rest), /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: "\"w-100 h-100 overflow-auto rounded-3 ".concat(noPageBorder ? "" : "border ", "bg-body shadow-sm\"")
|
|
16
|
+
}, children));
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface LayoutProps {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
header?: React.ReactNode;
|
|
5
|
+
side?: React.ReactNode;
|
|
6
|
+
noPageBorder?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A layout with header, side and main content area. Side is collapsible.
|
|
10
|
+
*/
|
|
11
|
+
export default function Layout({ children, header, side, noPageBorder }: LayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import React, { CSSProperties } from "react";
|
|
2
|
+
export interface MenuItemProps {
|
|
3
|
+
/**
|
|
4
|
+
* Sets `to` prop, e.g. when you use the `NavLink` component from React Router.
|
|
5
|
+
*/
|
|
6
|
+
to?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Prop for components by React Router.
|
|
9
|
+
*/
|
|
10
|
+
exact?: boolean;
|
|
11
|
+
href?: string;
|
|
12
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Will be fired after `onClick`
|
|
15
|
+
*/
|
|
16
|
+
onClickAttached?: (event: React.MouseEvent) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Icon component or a class name.
|
|
19
|
+
*/
|
|
20
|
+
icon?: any;
|
|
21
|
+
/**
|
|
22
|
+
* Addition to class name of icon wrapper element
|
|
23
|
+
*/
|
|
24
|
+
iconClassName?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Icon component or a class name when the MenuItem is active.
|
|
27
|
+
*/
|
|
28
|
+
iconForActive?: any;
|
|
29
|
+
/**
|
|
30
|
+
* Label of the link.
|
|
31
|
+
*/
|
|
32
|
+
label?: any;
|
|
33
|
+
/**
|
|
34
|
+
* Addition to class name of label wrapper element
|
|
35
|
+
*/
|
|
36
|
+
labelClassName?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Addition to class name of caret
|
|
39
|
+
*/
|
|
40
|
+
caretClassName?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Addition to style of caret
|
|
43
|
+
*/
|
|
44
|
+
caretStyle?: CSSProperties;
|
|
45
|
+
/**
|
|
46
|
+
* Should be set as active.
|
|
47
|
+
*/
|
|
48
|
+
isActive?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Set true to highlight the current menu item.
|
|
51
|
+
*/
|
|
52
|
+
highlighted?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* When using Blue React's routing system: define this link as home page link.
|
|
55
|
+
*/
|
|
56
|
+
isHome?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Extends class name of the dropdown menu.
|
|
59
|
+
*/
|
|
60
|
+
dropdownClassName?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Extends style of the dropdown menu.
|
|
63
|
+
*/
|
|
64
|
+
dropdownStyle?: CSSProperties;
|
|
65
|
+
/**
|
|
66
|
+
* Set children to create a nested `MenuItem` as a dropdown.
|
|
67
|
+
*/
|
|
68
|
+
children?: any;
|
|
69
|
+
/**
|
|
70
|
+
* Defines class name.
|
|
71
|
+
*/
|
|
72
|
+
className?: any;
|
|
73
|
+
/**
|
|
74
|
+
* Defines dropdown status from outside.
|
|
75
|
+
*/
|
|
76
|
+
showDropdown?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Callback when `showDropdown` changes.
|
|
79
|
+
*/
|
|
80
|
+
onShowDropdown?: (showDropdown: boolean) => void;
|
|
81
|
+
/**
|
|
82
|
+
* Close on click outside.
|
|
83
|
+
*/
|
|
84
|
+
supportOutside?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Overrides default class list to be ignored on click outside.
|
|
87
|
+
* Hint: If you want this menu item to stay open when others will open, set:
|
|
88
|
+
* `outsideIgnoreClasses={["blue-menu-item-wrapper"]}`.
|
|
89
|
+
*/
|
|
90
|
+
outsideIgnoreClasses?: string[];
|
|
91
|
+
/**
|
|
92
|
+
* By default, MenuItem is a `"button"`. If you set a `href`, it's a `"a"`.
|
|
93
|
+
* If you want to have it another type, you can pass a component reference with this prop (e.g. `Link`).
|
|
94
|
+
*/
|
|
95
|
+
elementType?: any;
|
|
96
|
+
target?: string;
|
|
97
|
+
rel?: string;
|
|
98
|
+
title?: string;
|
|
99
|
+
type?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Fired on the draggable target (the source element): occurs when the user starts to drag an element
|
|
102
|
+
*/
|
|
103
|
+
onDragStart?: (event: React.DragEvent) => void | React.DragEventHandler;
|
|
104
|
+
/**
|
|
105
|
+
* Fired on the draggable target (the source element): occurs when an element is being dragged
|
|
106
|
+
*/
|
|
107
|
+
onDrag?: (event: React.DragEvent) => void | React.DragEventHandler;
|
|
108
|
+
/**
|
|
109
|
+
* Fired on the draggable target (the source element): occurs when the user has finished dragging the element
|
|
110
|
+
*/
|
|
111
|
+
onDragEnd?: (event: React.DragEvent) => void | React.DragEventHandler;
|
|
112
|
+
/**
|
|
113
|
+
* Fired on the drop target: occurs when the dragged element enters the drop target
|
|
114
|
+
*/
|
|
115
|
+
onDragEnter?: (event: React.DragEvent) => void | React.DragEventHandler;
|
|
116
|
+
/**
|
|
117
|
+
* Fired on the drop target: occurs when the dragged element is over the drop target
|
|
118
|
+
*/
|
|
119
|
+
onDragOver?: (event: React.DragEvent) => void | React.DragEventHandler;
|
|
120
|
+
/**
|
|
121
|
+
* Fired on the drop target: occurs when the dragged element leaves the drop target
|
|
122
|
+
*/
|
|
123
|
+
onDragLeave?: (event: React.DragEvent) => void | React.DragEventHandler;
|
|
124
|
+
/**
|
|
125
|
+
* Fired on the drop target: occurs when the dragged element is dropped on the drop target
|
|
126
|
+
*/
|
|
127
|
+
onDrop?: (event: React.DragEvent) => void | React.DragEventHandler;
|
|
128
|
+
/**
|
|
129
|
+
* Specifies whether an element is draggable or not.
|
|
130
|
+
*
|
|
131
|
+
* **Important:** To make draggable menu items work in Firefox, the elementType must not be `"button"`. Set it to something else, like `"div"`.
|
|
132
|
+
*/
|
|
133
|
+
draggable?: boolean;
|
|
134
|
+
hideDraggableIcon?: boolean;
|
|
135
|
+
"data-tooltip"?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Specifies whether an element is disabled or not.
|
|
138
|
+
*/
|
|
139
|
+
disabled?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Specifies style of an element.
|
|
142
|
+
*/
|
|
143
|
+
style?: React.CSSProperties;
|
|
144
|
+
id?: string;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Link, button or custom component for Sidebar, Actions or ActionMenu
|
|
148
|
+
*/
|
|
149
|
+
export default function MenuItem(props: MenuItemProps): import("react/jsx-runtime").JSX.Element;
|