blue-react 10.2.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -84
- package/dist/components/A.js +13 -6
- package/dist/components/ActionMenu.js +27 -22
- package/dist/components/Actions.js +30 -22
- package/dist/components/Button.d.ts +31 -0
- package/dist/components/Button.js +119 -0
- package/dist/components/Chevron.js +11 -9
- package/dist/components/HashRouter.js +9 -6
- package/dist/components/Header.js +5 -3
- package/dist/components/HeaderTitle.js +31 -26
- package/dist/components/IconMenuItem.d.ts +2 -2
- package/dist/components/IconMenuItem.js +17 -10
- package/dist/components/Intro.js +23 -17
- package/dist/components/Layout.js +79 -71
- package/dist/{types/components/MenuItem.d.ts → components/LegacyMenuItem.d.ts} +150 -149
- package/dist/components/LegacyMenuItem.js +170 -0
- package/dist/components/MenuItem.d.ts +13 -149
- package/dist/components/MenuItem.js +168 -153
- package/dist/components/Modal.js +62 -49
- package/dist/components/ModalProvider.js +43 -35
- package/dist/components/Outside.js +5 -3
- package/dist/components/Search.js +69 -60
- package/dist/components/SidebarMenu.js +9 -6
- package/dist/components/SimpleLayout.js +16 -11
- package/dist/components/SlimContainer.js +8 -5
- package/dist/components/Status.js +56 -40
- package/dist/components/StatusProvider.js +22 -14
- package/dist/components/Tab.js +28 -19
- package/dist/components/Tabs.js +8 -5
- package/dist/components/ToastProvider.js +55 -44
- package/dist/components/shared.js +4 -1
- package/index.d.ts +5 -5
- package/index.js +4 -2
- package/package.json +14 -12
- package/dist/components/ActionMenuItem.js +0 -73
- package/dist/components/ActionMenuSwitch.js +0 -44
- package/dist/components/Body.d.ts +0 -21
- package/dist/components/Body.js +0 -25
- package/dist/components/Caret.js +0 -25
- package/dist/components/Layout/LayoutHeader.d.ts +0 -4
- package/dist/components/Layout/LayoutHeader.js +0 -25
- package/dist/components/Layout/LayoutMain.d.ts +0 -5
- package/dist/components/Layout/LayoutMain.js +0 -17
- package/dist/components/Page.d.ts +0 -13
- package/dist/components/Page.js +0 -39
- package/dist/components/SidebarMenuItem.js +0 -115
- package/dist/components/SidebarToggler.d.ts +0 -11
- package/dist/components/SidebarToggler.js +0 -24
- package/dist/components/Switch.js +0 -65
- package/dist/types/components/A.d.ts +0 -9
- package/dist/types/components/ActionMenu.d.ts +0 -25
- package/dist/types/components/ActionMenuItem.d.ts +0 -35
- package/dist/types/components/ActionMenuSwitch.d.ts +0 -12
- package/dist/types/components/Body.d.ts +0 -21
- package/dist/types/components/Caret.d.ts +0 -18
- package/dist/types/components/Chevron.d.ts +0 -17
- package/dist/types/components/Header.d.ts +0 -8
- package/dist/types/components/HeaderTitle.d.ts +0 -40
- package/dist/types/components/IconMenuItem.d.ts +0 -19
- package/dist/types/components/Intro.d.ts +0 -23
- package/dist/types/components/Layout.d.ts +0 -144
- package/dist/types/components/Modal.d.ts +0 -30
- package/dist/types/components/ModalProvider.d.ts +0 -21
- package/dist/types/components/Outside.d.ts +0 -17
- package/dist/types/components/Page.d.ts +0 -12
- package/dist/types/components/Search.d.ts +0 -36
- package/dist/types/components/SidebarMenu.d.ts +0 -32
- package/dist/types/components/SidebarMenuItem.d.ts +0 -22
- package/dist/types/components/SidebarToggler.d.ts +0 -10
- package/dist/types/components/SlimContainer.d.ts +0 -10
- package/dist/types/components/Status.d.ts +0 -12
- package/dist/types/components/StatusProvider.d.ts +0 -15
- package/dist/types/components/Switch.d.ts +0 -33
- package/dist/types/components/ToastProvider.d.ts +0 -22
- package/dist/types/components/Utilities.d.ts +0 -41
- package/dist/types/components/shared.d.ts +0 -15
|
@@ -1,9 +1,15 @@
|
|
|
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); }
|
|
1
2
|
var _excluded = ["label", "outerClass", "tooltipClass", "horizontalOnOpenSidebar", "className"];
|
|
2
|
-
function
|
|
3
|
-
function
|
|
4
|
-
function
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
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); }
|
|
8
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
10
|
import React from "react";
|
|
6
|
-
import MenuItem from "./
|
|
11
|
+
import MenuItem from "./LegacyMenuItem.js";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
13
|
/**
|
|
8
14
|
* Variant of `MenuItem` to primarily display an icon without a label.
|
|
9
15
|
* The label prop will be displayed as a tooltip.
|
|
@@ -19,11 +25,12 @@ export default function IconMenuItem(_ref) {
|
|
|
19
25
|
_ref$className = _ref.className,
|
|
20
26
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
21
27
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
-
return /*#__PURE__*/
|
|
28
|
+
return /*#__PURE__*/_jsx("div", {
|
|
23
29
|
className: "".concat(tooltipClass, " ").concat(horizontalOnOpenSidebar ? "blue-sidebar-menu-horizontal-on-open" : "", " ").concat(outerClass),
|
|
24
|
-
"data-tooltip": label
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
"data-tooltip": label,
|
|
31
|
+
children: /*#__PURE__*/_jsx(MenuItem, _objectSpread(_objectSpread({}, props), {}, {
|
|
32
|
+
className: "".concat(className, " w-100"),
|
|
33
|
+
iconClassName: "w-100"
|
|
34
|
+
}))
|
|
35
|
+
});
|
|
29
36
|
}
|
package/dist/components/Intro.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
/**
|
|
3
4
|
* Can be used for a sign-in page.
|
|
4
5
|
*/
|
|
@@ -8,21 +9,26 @@ export default function Intro(_ref) {
|
|
|
8
9
|
logoMaxWidth = _ref$logoMaxWidth === void 0 ? "100px" : _ref$logoMaxWidth,
|
|
9
10
|
title = _ref.title,
|
|
10
11
|
children = _ref.children;
|
|
11
|
-
return /*#__PURE__*/
|
|
12
|
-
className: "sign-in-screen"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
12
|
+
return /*#__PURE__*/_jsx("div", {
|
|
13
|
+
className: "sign-in-screen",
|
|
14
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
15
|
+
className: "sign-in-container mx-1",
|
|
16
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
17
|
+
className: "bg-body rounded-3 shadow-lg px-4 py-5",
|
|
18
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
19
|
+
className: "text-center",
|
|
20
|
+
children: [/*#__PURE__*/_jsx("img", {
|
|
21
|
+
style: {
|
|
22
|
+
maxWidth: logoMaxWidth
|
|
23
|
+
},
|
|
24
|
+
src: logo,
|
|
25
|
+
alt: ""
|
|
26
|
+
}), /*#__PURE__*/_jsx("h2", {
|
|
27
|
+
className: "mt-4 mb-3",
|
|
28
|
+
children: title
|
|
29
|
+
})]
|
|
30
|
+
}), children]
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
});
|
|
28
34
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { getPhrase } from "./shared.js";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
5
|
/**
|
|
5
6
|
* A layout with header, side and main content area. Side is collapsible.
|
|
6
7
|
*/
|
|
@@ -12,76 +13,83 @@ export default function Layout(_ref) {
|
|
|
12
13
|
side = _ref.side,
|
|
13
14
|
_ref$noPageBorder = _ref.noPageBorder,
|
|
14
15
|
noPageBorder = _ref$noPageBorder === void 0 ? false : _ref$noPageBorder;
|
|
15
|
-
return /*#__PURE__*/
|
|
16
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
16
17
|
className: clsx("blue-layout", className),
|
|
17
|
-
style: style
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
18
|
+
style: style,
|
|
19
|
+
children: [/*#__PURE__*/_jsx("input", {
|
|
20
|
+
id: "layout-expand",
|
|
21
|
+
type: "checkbox",
|
|
22
|
+
className: "blue-layout-state blue-layout-state-expand",
|
|
23
|
+
defaultChecked: true
|
|
24
|
+
}), /*#__PURE__*/_jsx("label", {
|
|
25
|
+
className: "blue-layout-toggle blue-layout-toggle-expand",
|
|
26
|
+
htmlFor: "layout-expand",
|
|
27
|
+
title: getPhrase("Toggle menu"),
|
|
28
|
+
"aria-label": getPhrase("Toggle menu"),
|
|
29
|
+
role: "button",
|
|
30
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
31
|
+
className: "btn blue-menu-item w-100 h-100 d-flex align-items-center justify-content-center p-0",
|
|
32
|
+
children: /*#__PURE__*/_jsx("svg", {
|
|
33
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34
|
+
viewBox: "0 0 16 16",
|
|
35
|
+
"aria-hidden": "true",
|
|
36
|
+
width: "1em",
|
|
37
|
+
height: "1em",
|
|
38
|
+
fill: "currentColor",
|
|
39
|
+
className: "bi bi-layout-sidebar",
|
|
40
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
41
|
+
d: "M0 3a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm5-1v12h9a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1zM4 2H2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h2z"
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
}), /*#__PURE__*/_jsx("input", {
|
|
46
|
+
id: "layout-drawer",
|
|
47
|
+
type: "checkbox",
|
|
48
|
+
className: "blue-layout-state blue-layout-state-drawer"
|
|
49
|
+
}), /*#__PURE__*/_jsx("label", {
|
|
50
|
+
className: "blue-layout-toggle blue-layout-toggle-drawer",
|
|
51
|
+
htmlFor: "layout-drawer",
|
|
52
|
+
title: getPhrase("Toggle menu"),
|
|
53
|
+
"aria-label": getPhrase("Toggle menu"),
|
|
54
|
+
role: "button",
|
|
55
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
56
|
+
className: "btn blue-menu-item w-100 h-100 d-flex align-items-center justify-content-center p-0",
|
|
57
|
+
children: /*#__PURE__*/_jsxs("svg", {
|
|
58
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
59
|
+
viewBox: "0 0 16 16",
|
|
60
|
+
"aria-hidden": "true",
|
|
61
|
+
width: "1em",
|
|
62
|
+
height: "1em",
|
|
63
|
+
fill: "currentColor",
|
|
64
|
+
className: "bi bi-layout-sidebar-inset",
|
|
65
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
66
|
+
d: "M14 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM2 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2z"
|
|
67
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
68
|
+
d: "M3 4a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z"
|
|
69
|
+
})]
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
}), /*#__PURE__*/_jsx("header", {
|
|
73
|
+
className: "blue-layout-header",
|
|
74
|
+
children: header
|
|
75
|
+
}), /*#__PURE__*/_jsx("aside", {
|
|
76
|
+
className: "blue-layout-side",
|
|
77
|
+
children: side
|
|
78
|
+
}), /*#__PURE__*/_jsx("main", {
|
|
79
|
+
className: "blue-layout-main",
|
|
80
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
81
|
+
className: clsx("blue-layout-body", {
|
|
82
|
+
"border-0": noPageBorder
|
|
83
|
+
}),
|
|
84
|
+
children: children
|
|
85
|
+
})
|
|
86
|
+
}), /*#__PURE__*/_jsx("label", {
|
|
87
|
+
"aria-label": "Close sidebar",
|
|
88
|
+
htmlFor: "layout-drawer",
|
|
89
|
+
className: "blue-layout-overlay bg-dark w-100 h-100",
|
|
90
|
+
style: {
|
|
91
|
+
"--bs-bg-opacity": 0.5
|
|
92
|
+
}
|
|
93
|
+
})]
|
|
94
|
+
});
|
|
87
95
|
}
|
|
@@ -1,149 +1,150 @@
|
|
|
1
|
-
import React, { CSSProperties } from "react";
|
|
2
|
-
export interface
|
|
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
|
-
*
|
|
148
|
-
|
|
149
|
-
|
|
1
|
+
import React, { CSSProperties } from "react";
|
|
2
|
+
export interface LegacyMenuItemProps {
|
|
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
|
+
* @deprecated
|
|
148
|
+
* Link, button or custom component for Sidebar, Actions or ActionMenu
|
|
149
|
+
*/
|
|
150
|
+
export default function LegacyMenuItem(props: LegacyMenuItemProps): import("react/jsx-runtime").JSX.Element;
|