blue-react 7.8.0 → 7.9.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 +40 -40
- package/dist/components/ActionMenuItem.js +4 -4
- package/dist/components/ActionMenuSwitch.js +2 -2
- package/dist/components/Caret.js +2 -2
- package/dist/components/DocumentView.js +3 -3
- package/dist/components/Grid.js +10 -2
- package/dist/components/Header.js +2 -2
- package/dist/components/HeaderActions.js +2 -2
- package/dist/components/HeaderTitle.js +3 -3
- package/dist/components/Intro.js +2 -2
- package/dist/components/Outside.js +6 -6
- package/dist/components/Page.js +2 -2
- package/dist/components/SidebarMenu.js +3 -3
- package/dist/components/Switch.js +2 -2
- package/dist/style.css +10 -10
- package/dist/style.min.css +8 -8
- package/dist/style.scss +1 -1
- package/dist/styles/_action-menu.scss +81 -81
- package/dist/styles/_actions.scss +137 -137
- package/dist/styles/_bootstrap-mixins_overwritten.scss +106 -106
- package/dist/styles/_bootstrap-optimizations.scss +13 -13
- package/dist/styles/_bootstrap-variables.scss +13 -13
- 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/_hover.scss +42 -42
- package/dist/styles/_keyframes.scss +73 -73
- package/dist/styles/_mixins.scss +7 -7
- package/dist/styles/_ripple.scss +30 -30
- package/dist/styles/_router.scss +18 -18
- package/dist/styles/_search.scss +1 -1
- package/dist/styles/_switch.scss +21 -21
- package/dist/styles/mixins/_action-menu.scss +68 -68
- package/dist/styles/mixins/_actions.scss +55 -55
- 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 +142 -142
- package/dist/styles/mixins/_switch.scss +85 -85
- package/dist/types/components/Grid.d.ts +3 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/bruegmann/blue-react/master/public/logo192.png" alt="Blue Icon" width="64px" height="64px">
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
|
-
# Blue React
|
|
6
|
-
|
|
7
|
-
[](https://www.npmjs.com/package/blue-react)
|
|
8
|
-
|
|
9
|
-
[Checkout the docs](https://bruegmann.github.io/blue-react) to find out how to use Blue React.
|
|
10
|
-
|
|
11
|
-
## Developing
|
|
12
|
-
|
|
13
|
-
This project is built with [CRA](https://create-react-app.dev/). To start developing, just and install everything with `npm i` and run:
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
npm start
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Create a new release
|
|
20
|
-
|
|
21
|
-
This is how to manually create a release:\
|
|
22
|
-
By running
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
npm publish
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
the missing files in `./dist` will be created, the docs will be generated and the NPM package will be released.
|
|
29
|
-
|
|
30
|
-
To publish changes on the documentary, run:
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
npm run deploy
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
To run both of them:
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
npm run release
|
|
40
|
-
```
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/bruegmann/blue-react/master/public/logo192.png" alt="Blue Icon" width="64px" height="64px">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# Blue React
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/blue-react)
|
|
8
|
+
|
|
9
|
+
[Checkout the docs](https://bruegmann.github.io/blue-react) to find out how to use Blue React.
|
|
10
|
+
|
|
11
|
+
## Developing
|
|
12
|
+
|
|
13
|
+
This project is built with [CRA](https://create-react-app.dev/). To start developing, just and install everything with `npm i` and run:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
npm start
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Create a new release
|
|
20
|
+
|
|
21
|
+
This is how to manually create a release:\
|
|
22
|
+
By running
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
npm publish
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
the missing files in `./dist` will be created, the docs will be generated and the NPM package will be released.
|
|
29
|
+
|
|
30
|
+
To publish changes on the documentary, run:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
npm run deploy
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
To run both of them:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
npm run release
|
|
40
|
+
```
|
|
@@ -13,10 +13,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
13
13
|
|
|
14
14
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
15
|
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated This is just an alias for `MenuItem`, so you should use that component instead.
|
|
18
|
-
* If you need the older `ActionMenuItem`, make sure to the prop `useDeprecated`.
|
|
19
|
-
* List Item and Link for the current Action Menu.
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated This is just an alias for `MenuItem`, so you should use that component instead.
|
|
18
|
+
* If you need the older `ActionMenuItem`, make sure to the prop `useDeprecated`.
|
|
19
|
+
* List Item and Link for the current Action Menu.
|
|
20
20
|
*/
|
|
21
21
|
function ActionMenuItem(props) {
|
|
22
22
|
if (props.useDeprecated) {
|
|
@@ -13,8 +13,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
13
13
|
|
|
14
14
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
15
|
|
|
16
|
-
/**
|
|
17
|
-
* Switch for the Action Menu.
|
|
16
|
+
/**
|
|
17
|
+
* Switch for the Action Menu.
|
|
18
18
|
*/
|
|
19
19
|
function ActionMenuSwitch(props) {
|
|
20
20
|
return /*#__PURE__*/_react.default.createElement("li", {
|
package/dist/components/Caret.js
CHANGED
|
@@ -9,8 +9,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* Caret icon component.
|
|
12
|
+
/**
|
|
13
|
+
* Caret icon component.
|
|
14
14
|
*/
|
|
15
15
|
function Caret(_ref) {
|
|
16
16
|
var open = _ref.open,
|
|
@@ -17,8 +17,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
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.
|
|
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
22
|
*/
|
|
23
23
|
function DocumentView(_ref) {
|
|
24
24
|
var content = _ref.content,
|
|
@@ -31,7 +31,7 @@ function DocumentView(_ref) {
|
|
|
31
31
|
var uniqueId = "document-view-" + _Utilities.default.guid();
|
|
32
32
|
|
|
33
33
|
var supportsIframe = function supportsIframe() {
|
|
34
|
-
return mimeType === "application/pdf" || mimeType === "image/png" || mimeType === "image/jpeg" || mimeType === "image/gif" || mimeType === "image/tiff" || mimeType === "text/plain" || mimeType === "text/html";
|
|
34
|
+
return mimeType === "application/pdf" || mimeType === "image/png" || mimeType === "image/jpeg" || mimeType === "image/gif" || mimeType === "image/tiff" || mimeType === "image/bmp" || mimeType === "image/x-bmp" || mimeType === "image/x-ms-bmp" || mimeType === "text/plain" || mimeType === "text/html";
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
(0, _react.useEffect)(function () {
|
package/dist/components/Grid.js
CHANGED
|
@@ -41,7 +41,8 @@ window.toggleSidebarEvent = new CustomEvent("toggleSidebar");
|
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* The main component. As soon this component is mounted, it is globally available under `window.blueGridRef`.
|
|
44
|
-
* Also you can append your own event listeners with `blueGridRef.addEventListener(eventName, (prevProps, prevState) => { })
|
|
44
|
+
* Also you can append your own event listeners with `blueGridRef.addEventListener(eventName, (prevProps, prevState) => { })`
|
|
45
|
+
* and remove it with `blueGridRef.removeEventListener(eventName, listener)`.
|
|
45
46
|
*
|
|
46
47
|
* Allowed event listeners:
|
|
47
48
|
*
|
|
@@ -161,7 +162,7 @@ var Grid = /*#__PURE__*/function (_Component) {
|
|
|
161
162
|
}, {
|
|
162
163
|
key: "hideSidebar",
|
|
163
164
|
value: function hideSidebar(e) {
|
|
164
|
-
if (!(_Utilities.default.hasClass(e.target, "blue-app-open-menu") || _Utilities.default.hasClass(e.target, "bi-menu") || _Utilities.default.hasClass(e.target, "blue-app-search") || _Utilities.default.hasClass(e.target, "blue-app-search-control") || _Utilities.default.hasClass(e.target, "blue-app-search-btn") || _Utilities.default.hasClass(e.target, "blue-app-search-btn-icon") || _Utilities.default.hasClass(e.target, "blue-app-sidebar-dropdown-toggle") || _Utilities.default.hasClass(e.target, "blue-app-sidebar-dropdown-caret") || _Utilities.default.hasClass(e.target, "blue-app-sidebar-dropdown-icon") || _Utilities.default.hasClass(e.target, "blue-app-sidebar-exception"))) {
|
|
165
|
+
if (!(_Utilities.default.hasClass(e.target, "blue-app-open-menu") || _Utilities.default.hasClass(e.target, "bi-menu") || _Utilities.default.hasClass(e.target, "blue-app-search") || _Utilities.default.hasClass(e.target, "blue-app-search-control") || _Utilities.default.hasClass(e.target, "blue-app-search-btn") || _Utilities.default.hasClass(e.target, "blue-app-search-btn-icon") || _Utilities.default.hasClass(e.target, "blue-app-sidebar-label") || _Utilities.default.hasClass(e.target, "blue-app-sidebar-dropdown-toggle") || _Utilities.default.hasClass(e.target, "blue-app-sidebar-dropdown-caret") || _Utilities.default.hasClass(e.target, "blue-app-sidebar-dropdown-icon") || _Utilities.default.hasClass(e.target, "blue-app-sidebar-exception"))) {
|
|
165
166
|
this.setState({
|
|
166
167
|
sidebarIn: false
|
|
167
168
|
});
|
|
@@ -204,6 +205,13 @@ var Grid = /*#__PURE__*/function (_Component) {
|
|
|
204
205
|
value: function addEventListener(param1, param2, param3) {
|
|
205
206
|
this.eventListeners.push([param1, param2, param3]);
|
|
206
207
|
}
|
|
208
|
+
}, {
|
|
209
|
+
key: "removeEventListener",
|
|
210
|
+
value: function removeEventListener(type, listener) {
|
|
211
|
+
this.eventListeners = this.eventListeners.filter(function (param) {
|
|
212
|
+
return param[0] !== type && param[2].toString() !== listener.toString();
|
|
213
|
+
});
|
|
214
|
+
}
|
|
207
215
|
}, {
|
|
208
216
|
key: "render",
|
|
209
217
|
value: function render() {
|
|
@@ -11,8 +11,8 @@ var _Utilities = _interopRequireDefault(require("./Utilities"));
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* The top of a page.
|
|
14
|
+
/**
|
|
15
|
+
* The top of a page.
|
|
16
16
|
*/
|
|
17
17
|
function Header(_ref) {
|
|
18
18
|
var children = _ref.children;
|
|
@@ -9,8 +9,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated This component isn't neccessary anymore. Just use `ActionMenu` directly in `Header`.
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated This component isn't neccessary anymore. Just use `ActionMenu` directly in `Header`.
|
|
14
14
|
*/
|
|
15
15
|
function HeaderActions(props) {
|
|
16
16
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, props.children);
|
|
@@ -17,9 +17,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* The title area at the header bar.
|
|
22
|
-
* Depending on its content, the document's title will be set aswell (what will be shown in the browser title bar).
|
|
20
|
+
/**
|
|
21
|
+
* The title area at the header bar.
|
|
22
|
+
* Depending on its content, the document's title will be set aswell (what will be shown in the browser title bar).
|
|
23
23
|
*/
|
|
24
24
|
function HeaderTitle(_ref) {
|
|
25
25
|
var logo = _ref.logo,
|
package/dist/components/Intro.js
CHANGED
|
@@ -17,8 +17,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* Can be used for a sign-in page.
|
|
20
|
+
/**
|
|
21
|
+
* Can be used for a sign-in page.
|
|
22
22
|
*/
|
|
23
23
|
function Intro(_ref) {
|
|
24
24
|
var logo = _ref.logo,
|
|
@@ -14,13 +14,13 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
14
14
|
|
|
15
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
16
|
|
|
17
|
-
/**
|
|
18
|
-
* Hook that alerts clicks outside of the passed ref
|
|
17
|
+
/**
|
|
18
|
+
* Hook that alerts clicks outside of the passed ref
|
|
19
19
|
*/
|
|
20
20
|
function useOutside(ref, callback) {
|
|
21
21
|
(0, _react.useEffect)(function () {
|
|
22
|
-
/**
|
|
23
|
-
* Alert if clicked on outside of element
|
|
22
|
+
/**
|
|
23
|
+
* Alert if clicked on outside of element
|
|
24
24
|
*/
|
|
25
25
|
function handleClickOutside(event) {
|
|
26
26
|
console.log({
|
|
@@ -41,8 +41,8 @@ function useOutside(ref, callback) {
|
|
|
41
41
|
}, [ref]);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
/**
|
|
45
|
-
* Component that fires an event if you click outside of it
|
|
44
|
+
/**
|
|
45
|
+
* Component that fires an event if you click outside of it
|
|
46
46
|
*/
|
|
47
47
|
function Outside(_ref) {
|
|
48
48
|
var children = _ref.children,
|
package/dist/components/Page.js
CHANGED
|
@@ -31,8 +31,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
31
31
|
|
|
32
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
33
|
|
|
34
|
-
/**
|
|
35
|
-
* Main component for each page.
|
|
34
|
+
/**
|
|
35
|
+
* Main component for each page.
|
|
36
36
|
*/
|
|
37
37
|
function Page(_ref) {
|
|
38
38
|
var children = _ref.children,
|
|
@@ -25,12 +25,12 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
25
25
|
|
|
26
26
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
* Sidebar for the `Grid` component.
|
|
28
|
+
/**
|
|
29
|
+
* Sidebar for the `Grid` component.
|
|
30
30
|
*/
|
|
31
31
|
function SidebarMenu(props) {
|
|
32
32
|
var _props$fluent = props.fluent,
|
|
33
|
-
fluent = _props$fluent === void 0 ?
|
|
33
|
+
fluent = _props$fluent === void 0 ? false : _props$fluent;
|
|
34
34
|
|
|
35
35
|
var _useState = (0, _react.useState)(false),
|
|
36
36
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -13,8 +13,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
15
|
|
|
16
|
-
/**
|
|
17
|
-
* Switch.
|
|
16
|
+
/**
|
|
17
|
+
* Switch.
|
|
18
18
|
*/
|
|
19
19
|
function Switch(_ref) {
|
|
20
20
|
var className = _ref.className,
|