blue-react 6.9.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/README.md +36 -0
- package/dist/ActionMenu.js +122 -0
- package/dist/ActionMenuItem.js +110 -0
- package/dist/ActionMenuSwitch.js +98 -0
- package/dist/Actions.js +178 -0
- package/dist/Body.js +89 -0
- package/dist/Caret.js +71 -0
- package/dist/DocumentView.js +138 -0
- package/dist/FluentBtn.js +100 -0
- package/dist/FormSwitch.js +75 -0
- package/dist/Grid.js +341 -0
- package/dist/Header.js +66 -0
- package/dist/HeaderActions.js +75 -0
- package/dist/HeaderTitle.js +137 -0
- package/dist/Intro.js +108 -0
- package/dist/MenuItem.js +204 -0
- package/dist/Page.js +64 -0
- package/dist/Search.js +203 -0
- package/dist/SidebarMenu.js +153 -0
- package/dist/Switch.js +89 -0
- package/dist/SwitchMenuItem.js +65 -0
- package/dist/Utilities.js +173 -0
- package/dist/style/_actions.scss +109 -0
- package/dist/style/_actions_deprecated.scss +58 -0
- package/dist/style/_bootstrap-mixins_overwritten.scss +54 -0
- package/dist/style/_bootstrap-optimizations.scss +28 -0
- package/dist/style/_bootstrap.scss +45 -0
- package/dist/style/_caret.scss +50 -0
- package/dist/style/_document-view.scss +5 -0
- package/dist/style/_fluent.scss +38 -0
- package/dist/style/_form-switch.scss +74 -0
- package/dist/style/_general.scss +154 -0
- package/dist/style/_grid.scss +316 -0
- package/dist/style/_keyframes.scss +68 -0
- package/dist/style/_mixins.scss +7 -0
- package/dist/style/_ripple.scss +26 -0
- package/dist/style/_router.scss +18 -0
- package/dist/style/_search.scss +48 -0
- package/dist/style/_status.scss +138 -0
- package/dist/style/_switch.scss +22 -0
- package/dist/style/_variables.scss +91 -0
- package/dist/style/mixins/_actions.scss +59 -0
- package/dist/style/mixins/_actions_deprecated.scss +54 -0
- package/dist/style/mixins/_custom-property.scss +10 -0
- package/dist/style/mixins/_misc.scss +28 -0
- package/dist/style/mixins/_scroll-shadow.scss +10 -0
- package/dist/style/mixins/_sidebar.scss +114 -0
- package/dist/style/mixins/_switch.scss +77 -0
- package/dist/style.css +8518 -0
- package/dist/style.scss +36 -0
- package/dist/types/ActionMenu.d.ts +15 -0
- package/dist/types/ActionMenuItem.d.ts +33 -0
- package/dist/types/ActionMenuSwitch.d.ts +19 -0
- package/dist/types/Actions.d.ts +35 -0
- package/dist/types/Body.d.ts +24 -0
- package/dist/types/Caret.d.ts +21 -0
- package/dist/types/DocumentView.d.ts +30 -0
- package/dist/types/FluentBtn.d.ts +29 -0
- package/dist/types/Grid.d.ts +49 -0
- package/dist/types/Header.d.ts +6 -0
- package/dist/types/HeaderActions.d.ts +16 -0
- package/dist/types/HeaderTitle.d.ts +25 -0
- package/dist/types/Intro.d.ts +29 -0
- package/dist/types/MenuItem.d.ts +54 -0
- package/dist/types/Page.d.ts +8 -0
- package/dist/types/Search.d.ts +30 -0
- package/dist/types/SidebarMenu.d.ts +39 -0
- package/dist/types/Switch.d.ts +26 -0
- package/dist/types/SwitchMenuItem.d.ts +15 -0
- package/dist/types/Utilities.d.ts +55 -0
- package/dist/types/shared.d.ts +1 -0
- package/index.d.ts +62 -0
- package/index.js +20 -0
- package/package.json +56 -0
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
|
|
12
|
+
## Developing
|
|
13
|
+
|
|
14
|
+
This project is built with [CRA](https://create-react-app.dev/). To start developing, just and install everything with `npm i` and run:
|
|
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
|
+
npm publish --tag v6.9
|
|
25
|
+
```
|
|
26
|
+
the missing files in `./dist` will be created, the docs will be generated and the NPM package will be released.
|
|
27
|
+
|
|
28
|
+
To publish changes on the documentary, run:
|
|
29
|
+
```
|
|
30
|
+
npm run deploy
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
To run both of them:
|
|
34
|
+
```
|
|
35
|
+
npm run release
|
|
36
|
+
```
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
8
|
+
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
|
|
11
|
+
var _react2 = _interopRequireDefault(_react);
|
|
12
|
+
|
|
13
|
+
var _propTypes = require("prop-types");
|
|
14
|
+
|
|
15
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
16
|
+
|
|
17
|
+
var _Utilities = require("./Utilities.js");
|
|
18
|
+
|
|
19
|
+
var _Utilities2 = _interopRequireDefault(_Utilities);
|
|
20
|
+
|
|
21
|
+
var _ActionMenuItem = require("./ActionMenuItem.js");
|
|
22
|
+
|
|
23
|
+
var _ActionMenuItem2 = _interopRequireDefault(_ActionMenuItem);
|
|
24
|
+
|
|
25
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
+
|
|
27
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
28
|
+
|
|
29
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
30
|
+
|
|
31
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* <span class="badge badge-secondary">Deprecated</span> Use <strong>Actions</strong> instead.<br>
|
|
35
|
+
* Das Action-Menü an der oberen rechten Ecke einer Seite. Hier können Aktionen platziert werden, die im Kontext der aktuellen Seite stehen.
|
|
36
|
+
*/
|
|
37
|
+
var ActionMenu = function (_React$Component) {
|
|
38
|
+
_inherits(ActionMenu, _React$Component);
|
|
39
|
+
|
|
40
|
+
function ActionMenu() {
|
|
41
|
+
_classCallCheck(this, ActionMenu);
|
|
42
|
+
|
|
43
|
+
var _this = _possibleConstructorReturn(this, (ActionMenu.__proto__ || Object.getPrototypeOf(ActionMenu)).call(this));
|
|
44
|
+
|
|
45
|
+
_this.state = {
|
|
46
|
+
actionsToggledIn: null
|
|
47
|
+
};
|
|
48
|
+
return _this;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
_createClass(ActionMenu, [{
|
|
52
|
+
key: "componentDidMount",
|
|
53
|
+
value: function componentDidMount() {
|
|
54
|
+
var _this2 = this;
|
|
55
|
+
|
|
56
|
+
this.initToggleStatus();
|
|
57
|
+
|
|
58
|
+
document.querySelector(".blue-app-wrapper").onclick = function (event) {
|
|
59
|
+
_this2.toggleActions();
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
document.querySelectorAll(".blue-app-actions-menu .nav-link").forEach(function (link) {
|
|
63
|
+
link.addEventListener("click", function () {
|
|
64
|
+
if (_this2.state.actionsToggledIn) {
|
|
65
|
+
_this2.toggleActions();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
71
|
+
key: "toggleActions",
|
|
72
|
+
value: function toggleActions() {
|
|
73
|
+
_Utilities2.default.toggleActions();
|
|
74
|
+
this.initToggleStatus();
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
key: "initToggleStatus",
|
|
78
|
+
value: function initToggleStatus() {
|
|
79
|
+
this.setState({
|
|
80
|
+
actionsToggledIn: _Utilities2.default.hasClass(document.querySelector(".blue-app-actions"), "open")
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
key: "render",
|
|
85
|
+
value: function render() {
|
|
86
|
+
var _this3 = this;
|
|
87
|
+
|
|
88
|
+
return _react2.default.createElement(
|
|
89
|
+
"ul",
|
|
90
|
+
{ className: "blue-app-actions-menu nav navbar-nav navbar-right fluent-btn" },
|
|
91
|
+
_react2.default.createElement("div", { className: "fluent-btn-ball" }),
|
|
92
|
+
!this.state.actionsToggledIn && !this.props.hideToggleAction ? _react2.default.createElement(_ActionMenuItem2.default, {
|
|
93
|
+
className: "blue-app-actions-menu-toggle p-3",
|
|
94
|
+
onClick: function onClick() {
|
|
95
|
+
return _this3.toggleActions();
|
|
96
|
+
},
|
|
97
|
+
icon: this.state.actionsToggledIn ? "bi-navigate_cross" : "bi-iconmonstr-menu-7"
|
|
98
|
+
}) : "",
|
|
99
|
+
this.props.children
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
}], [{
|
|
103
|
+
key: "defaultProps",
|
|
104
|
+
get: function get() {
|
|
105
|
+
return {
|
|
106
|
+
hideToggleAction: false
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}]);
|
|
110
|
+
|
|
111
|
+
return ActionMenu;
|
|
112
|
+
}(_react2.default.Component);
|
|
113
|
+
|
|
114
|
+
ActionMenu.propTypes = {
|
|
115
|
+
/**
|
|
116
|
+
* Versteckt die drei Punkte in mobiler Ansicht.
|
|
117
|
+
* Das kann nützlich sein, wenn mehrere ActionMenus genutzt werden, aber nicht überall der Toggle angezeigt werden soll.
|
|
118
|
+
*/
|
|
119
|
+
hideToggleAction: _propTypes2.default.bool
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
exports.default = ActionMenu;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _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; };
|
|
8
|
+
|
|
9
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
10
|
+
|
|
11
|
+
var _react = require("react");
|
|
12
|
+
|
|
13
|
+
var _react2 = _interopRequireDefault(_react);
|
|
14
|
+
|
|
15
|
+
var _propTypes = require("prop-types");
|
|
16
|
+
|
|
17
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
18
|
+
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
|
|
21
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
22
|
+
|
|
23
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
24
|
+
|
|
25
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* List-Item und Link für das Action-Menü.
|
|
29
|
+
*/
|
|
30
|
+
var ActionMenuItem = function (_React$Component) {
|
|
31
|
+
_inherits(ActionMenuItem, _React$Component);
|
|
32
|
+
|
|
33
|
+
function ActionMenuItem() {
|
|
34
|
+
_classCallCheck(this, ActionMenuItem);
|
|
35
|
+
|
|
36
|
+
return _possibleConstructorReturn(this, (ActionMenuItem.__proto__ || Object.getPrototypeOf(ActionMenuItem)).apply(this, arguments));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
_createClass(ActionMenuItem, [{
|
|
40
|
+
key: "render",
|
|
41
|
+
value: function render() {
|
|
42
|
+
var _this2 = this;
|
|
43
|
+
|
|
44
|
+
var props = {};
|
|
45
|
+
|
|
46
|
+
Object.keys(this.props).map(function (key) {
|
|
47
|
+
if (key != "navItemClassName" && key != "icon" && key != "label") {
|
|
48
|
+
props[key] = _this2.props[key];
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return _react2.default.createElement(
|
|
53
|
+
"li",
|
|
54
|
+
{ className: "nav-item " + this.props.navItemClassName },
|
|
55
|
+
_react2.default.createElement(
|
|
56
|
+
"a",
|
|
57
|
+
_extends({}, props, { href: this.props.href, className: "nav-link blue-app-actions-menu-item " + this.props.className }),
|
|
58
|
+
_react2.default.createElement("span", { className: this.props.icon }),
|
|
59
|
+
this.props.label && _react2.default.createElement(
|
|
60
|
+
"span",
|
|
61
|
+
{ className: "blue-app-actions-label" },
|
|
62
|
+
this.props.icon && _react2.default.createElement(
|
|
63
|
+
"span",
|
|
64
|
+
null,
|
|
65
|
+
"\xA0"
|
|
66
|
+
),
|
|
67
|
+
this.props.label
|
|
68
|
+
)
|
|
69
|
+
)
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
}], [{
|
|
73
|
+
key: "defaultProps",
|
|
74
|
+
get: function get() {
|
|
75
|
+
return {
|
|
76
|
+
navItemClassName: "",
|
|
77
|
+
className: "",
|
|
78
|
+
href: "javascript:void(0)"
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}]);
|
|
82
|
+
|
|
83
|
+
return ActionMenuItem;
|
|
84
|
+
}(_react2.default.Component);
|
|
85
|
+
|
|
86
|
+
ActionMenuItem.propTypes = {
|
|
87
|
+
/**
|
|
88
|
+
* Extends className of the <code>.nav-item</code> element.
|
|
89
|
+
*/
|
|
90
|
+
navItemClassName: _propTypes2.default.string,
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Extends className of the <code>.nav-link</code> element.
|
|
94
|
+
*/
|
|
95
|
+
className: _propTypes2.default.string,
|
|
96
|
+
|
|
97
|
+
href: _propTypes2.default.string,
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* className for the icon.
|
|
101
|
+
*/
|
|
102
|
+
icon: _propTypes2.default.string,
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Label for the link.
|
|
106
|
+
*/
|
|
107
|
+
label: _propTypes2.default.any
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
exports.default = ActionMenuItem;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _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; };
|
|
8
|
+
|
|
9
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
10
|
+
|
|
11
|
+
var _react = require("react");
|
|
12
|
+
|
|
13
|
+
var _react2 = _interopRequireDefault(_react);
|
|
14
|
+
|
|
15
|
+
var _propTypes = require("prop-types");
|
|
16
|
+
|
|
17
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
18
|
+
|
|
19
|
+
var _Switch = require("./Switch");
|
|
20
|
+
|
|
21
|
+
var _Switch2 = _interopRequireDefault(_Switch);
|
|
22
|
+
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
+
|
|
25
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
26
|
+
|
|
27
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
28
|
+
|
|
29
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* <span class="badge badge-secondary">Deprecated</span> When using <strong>Actions</strong>, please use <strong>SwitchMenuItem</strong> instead.<br>
|
|
33
|
+
* Switch für das Action-Menü.
|
|
34
|
+
*/
|
|
35
|
+
var ActionMenuSwitch = function (_React$Component) {
|
|
36
|
+
_inherits(ActionMenuSwitch, _React$Component);
|
|
37
|
+
|
|
38
|
+
function ActionMenuSwitch() {
|
|
39
|
+
_classCallCheck(this, ActionMenuSwitch);
|
|
40
|
+
|
|
41
|
+
return _possibleConstructorReturn(this, (ActionMenuSwitch.__proto__ || Object.getPrototypeOf(ActionMenuSwitch)).apply(this, arguments));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
_createClass(ActionMenuSwitch, [{
|
|
45
|
+
key: "render",
|
|
46
|
+
value: function render() {
|
|
47
|
+
var _this2 = this;
|
|
48
|
+
|
|
49
|
+
return _react2.default.createElement(
|
|
50
|
+
"li",
|
|
51
|
+
{ className: "nav-item" },
|
|
52
|
+
_react2.default.createElement(
|
|
53
|
+
"a",
|
|
54
|
+
{
|
|
55
|
+
href: "javascript:void(0)",
|
|
56
|
+
className: "nav-link blue-app-actions-menu-item",
|
|
57
|
+
onClick: function onClick() {
|
|
58
|
+
console.log("click");
|
|
59
|
+
_this2.props.onChange();
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
_react2.default.createElement(_Switch2.default, _extends({}, this.props, {
|
|
63
|
+
elementType: "span"
|
|
64
|
+
})),
|
|
65
|
+
this.props.label && _react2.default.createElement(
|
|
66
|
+
"span",
|
|
67
|
+
{ className: "blue-app-actions-label" },
|
|
68
|
+
"\xA0",
|
|
69
|
+
this.props.label
|
|
70
|
+
)
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
}], [{
|
|
75
|
+
key: "defaultProps",
|
|
76
|
+
get: function get() {
|
|
77
|
+
return {
|
|
78
|
+
className: "",
|
|
79
|
+
href: "javascript:void(0)"
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}]);
|
|
83
|
+
|
|
84
|
+
return ActionMenuSwitch;
|
|
85
|
+
}(_react2.default.Component);
|
|
86
|
+
|
|
87
|
+
ActionMenuSwitch.propTypes = {
|
|
88
|
+
className: _propTypes2.default.string,
|
|
89
|
+
checked: _propTypes2.default.bool,
|
|
90
|
+
onChange: _propTypes2.default.func,
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Beschriftung des Controls
|
|
94
|
+
*/
|
|
95
|
+
label: _propTypes2.default.any
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
exports.default = ActionMenuSwitch;
|
package/dist/Actions.js
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
8
|
+
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
|
|
11
|
+
var _react2 = _interopRequireDefault(_react);
|
|
12
|
+
|
|
13
|
+
var _Utilities = require("./Utilities.js");
|
|
14
|
+
|
|
15
|
+
var _Utilities2 = _interopRequireDefault(_Utilities);
|
|
16
|
+
|
|
17
|
+
var _propTypes = require("prop-types");
|
|
18
|
+
|
|
19
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
20
|
+
|
|
21
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
+
|
|
23
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
24
|
+
|
|
25
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
26
|
+
|
|
27
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
28
|
+
|
|
29
|
+
function collapseSection(element) {
|
|
30
|
+
/* Source of these functions: https://css-tricks.com/using-css-transitions-auto-dimensions/ */
|
|
31
|
+
var sectionHeight = element.scrollHeight;
|
|
32
|
+
var elementTransition = element.style.transition;
|
|
33
|
+
element.style.transition = '';
|
|
34
|
+
|
|
35
|
+
requestAnimationFrame(function () {
|
|
36
|
+
element.style.height = sectionHeight + 'px';
|
|
37
|
+
element.style.transition = elementTransition;
|
|
38
|
+
requestAnimationFrame(function () {
|
|
39
|
+
element.style.height = 84 + 'px';
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
element.setAttribute('data-collapsed', 'true');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function expandSection(element) {
|
|
46
|
+
var sectionHeight = element.scrollHeight;
|
|
47
|
+
element.style.height = sectionHeight + 'px';
|
|
48
|
+
|
|
49
|
+
var fun = function fun(e) {
|
|
50
|
+
element.removeEventListener('transitionend', fun);
|
|
51
|
+
element.style.height = null;
|
|
52
|
+
};
|
|
53
|
+
element.addEventListener('transitionend', fun);
|
|
54
|
+
element.setAttribute('data-collapsed', 'false');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The new actions menu, better optimized for mobile devices.<br>
|
|
59
|
+
* <strong>Important:</strong> If you use <code><Actions /></code> on a page, make sure also to set <strong>hasActions</strong> prop from
|
|
60
|
+
* <strong>Page</strong> component to <code>true</code>.
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
var Actions = function (_React$Component) {
|
|
64
|
+
_inherits(Actions, _React$Component);
|
|
65
|
+
|
|
66
|
+
function Actions(props) {
|
|
67
|
+
_classCallCheck(this, Actions);
|
|
68
|
+
|
|
69
|
+
var _this = _possibleConstructorReturn(this, (Actions.__proto__ || Object.getPrototypeOf(Actions)).call(this, props));
|
|
70
|
+
|
|
71
|
+
_this.state = {
|
|
72
|
+
open: props.open
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
_this.id = "Actions-" + _Utilities2.default.guid();
|
|
76
|
+
|
|
77
|
+
_this.toggle = _this.toggle.bind(_this);
|
|
78
|
+
return _this;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
_createClass(Actions, [{
|
|
82
|
+
key: "componentDidUpdate",
|
|
83
|
+
value: function componentDidUpdate(prevProps) {
|
|
84
|
+
if (prevProps.open !== this.props.open) {
|
|
85
|
+
this.setState({ open: this.props.open });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
key: "toggle",
|
|
90
|
+
value: function toggle() {
|
|
91
|
+
var open = !this.state.open;
|
|
92
|
+
var element = document.getElementById(this.id);
|
|
93
|
+
|
|
94
|
+
// expandSection(element);
|
|
95
|
+
|
|
96
|
+
this.setState({ open: open }, function () {
|
|
97
|
+
if (open) {
|
|
98
|
+
expandSection(element);
|
|
99
|
+
} else {
|
|
100
|
+
collapseSection(element);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
if (this.props.onToggle) {
|
|
105
|
+
this.props.onToggle(open);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}, {
|
|
109
|
+
key: "render",
|
|
110
|
+
value: function render() {
|
|
111
|
+
return _react2.default.createElement(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
id: this.id,
|
|
115
|
+
className: "blue-actions " + this.props.className + " " + (this.state.open ? "open" : "closed") + (" break-" + this.props.break)
|
|
116
|
+
},
|
|
117
|
+
_react2.default.createElement("div", { className: "blue-actions-indicator d-" + this.props.break + "-none", onClick: this.toggle }),
|
|
118
|
+
_react2.default.createElement(
|
|
119
|
+
"div",
|
|
120
|
+
{ className: "blue-actions-controls" },
|
|
121
|
+
this.props.children
|
|
122
|
+
),
|
|
123
|
+
_react2.default.createElement(
|
|
124
|
+
"div",
|
|
125
|
+
{ className: "blue-actions-featured d-" + this.props.break + "-none" },
|
|
126
|
+
_react2.default.createElement(
|
|
127
|
+
"div",
|
|
128
|
+
{ className: "fluent-btn" },
|
|
129
|
+
_react2.default.createElement("div", { className: "fluent-btn-ball" }),
|
|
130
|
+
this.props.featured
|
|
131
|
+
)
|
|
132
|
+
)
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
}], [{
|
|
136
|
+
key: "defaultProps",
|
|
137
|
+
get: function get() {
|
|
138
|
+
return {
|
|
139
|
+
className: "",
|
|
140
|
+
open: false,
|
|
141
|
+
break: "md"
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
}]);
|
|
145
|
+
|
|
146
|
+
return Actions;
|
|
147
|
+
}(_react2.default.Component);
|
|
148
|
+
|
|
149
|
+
Actions.propTypes = {
|
|
150
|
+
/**
|
|
151
|
+
* Content that will appear on the menu when it's expanded.
|
|
152
|
+
*/
|
|
153
|
+
children: _propTypes2.default.any,
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Extends the <code>className</code> of <code>.blue-actions</code>.
|
|
157
|
+
*/
|
|
158
|
+
className: _propTypes2.default.string,
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Content that will appear when the menu is shrunken.
|
|
162
|
+
*/
|
|
163
|
+
featured: _propTypes2.default.any,
|
|
164
|
+
open: _propTypes2.default.bool,
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Will fire when the state of <code>open</code> will change inside of the component.<br>
|
|
168
|
+
* <strong>Example:</strong> <code>onToggle={open => this.setState({ open })}</code>
|
|
169
|
+
*/
|
|
170
|
+
onToggle: _propTypes2.default.func,
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* <code>sm</code>, <code>md</code>, <code>lg</code> or <code>xl</code>
|
|
174
|
+
*/
|
|
175
|
+
break: _propTypes2.default.string
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
exports.default = Actions;
|
package/dist/Body.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
8
|
+
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
|
|
11
|
+
var _react2 = _interopRequireDefault(_react);
|
|
12
|
+
|
|
13
|
+
var _propTypes = require("prop-types");
|
|
14
|
+
|
|
15
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
16
|
+
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
|
|
19
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
20
|
+
|
|
21
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
22
|
+
|
|
23
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Enthält den Inhalt einer Seite.
|
|
27
|
+
*/
|
|
28
|
+
var Body = function (_React$Component) {
|
|
29
|
+
_inherits(Body, _React$Component);
|
|
30
|
+
|
|
31
|
+
function Body() {
|
|
32
|
+
_classCallCheck(this, Body);
|
|
33
|
+
|
|
34
|
+
return _possibleConstructorReturn(this, (Body.__proto__ || Object.getPrototypeOf(Body)).apply(this, arguments));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_createClass(Body, [{
|
|
38
|
+
key: "render",
|
|
39
|
+
value: function render() {
|
|
40
|
+
var pageBodyClassName = "blue-app-page";
|
|
41
|
+
|
|
42
|
+
return _react2.default.createElement(
|
|
43
|
+
"div",
|
|
44
|
+
{ id: this.props.id,
|
|
45
|
+
className: this.props.className ? pageBodyClassName + " " + this.props.className : pageBodyClassName + (this.props.hasActions ? " has-actions" : "") + (" break-" + this.props.break),
|
|
46
|
+
onClick: this.props.onClick
|
|
47
|
+
},
|
|
48
|
+
_react2.default.createElement(
|
|
49
|
+
"div",
|
|
50
|
+
{ className: this.props.containerClass },
|
|
51
|
+
this.props.children
|
|
52
|
+
)
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
}], [{
|
|
56
|
+
key: "defaultProps",
|
|
57
|
+
get: function get() {
|
|
58
|
+
return {
|
|
59
|
+
containerClass: "container-fluid",
|
|
60
|
+
hasActions: false,
|
|
61
|
+
break: "md"
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}]);
|
|
65
|
+
|
|
66
|
+
return Body;
|
|
67
|
+
}(_react2.default.Component);
|
|
68
|
+
|
|
69
|
+
Body.propTypes = {
|
|
70
|
+
id: _propTypes2.default.string,
|
|
71
|
+
className: _propTypes2.default.string,
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Setzt die Klasse für den Container. Mehr Infos unter https://getbootstrap.com/docs/4.0/layout/overview/#containers
|
|
75
|
+
*/
|
|
76
|
+
containerClass: _propTypes2.default.string,
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Set <code>true</code> if this page uses <code>/lt;Actions /></code>, so this component will get enough padding to avoid overlapping of the content.
|
|
80
|
+
*/
|
|
81
|
+
hasActions: _propTypes2.default.bool,
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* <code>sm</code>, <code>md</code>, <code>lg</code> or <code>xl</code>
|
|
85
|
+
*/
|
|
86
|
+
break: _propTypes2.default.string
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
exports.default = Body;
|