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/dist/Intro.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
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
|
+
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
|
+
/**
|
|
30
|
+
* Geeignet als Login-Bildschirm.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
var Intro = function (_React$Component) {
|
|
34
|
+
_inherits(Intro, _React$Component);
|
|
35
|
+
|
|
36
|
+
function Intro() {
|
|
37
|
+
_classCallCheck(this, Intro);
|
|
38
|
+
|
|
39
|
+
return _possibleConstructorReturn(this, (Intro.__proto__ || Object.getPrototypeOf(Intro)).apply(this, arguments));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
_createClass(Intro, [{
|
|
43
|
+
key: "componentDidMount",
|
|
44
|
+
value: function componentDidMount() {
|
|
45
|
+
_Utilities2.default.registerFluentBtns();
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
key: "render",
|
|
49
|
+
value: function render() {
|
|
50
|
+
return _react2.default.createElement(
|
|
51
|
+
"div",
|
|
52
|
+
{ className: "sign-in-screen" },
|
|
53
|
+
_react2.default.createElement(
|
|
54
|
+
"div",
|
|
55
|
+
{ className: "sign-in-container mx-1" },
|
|
56
|
+
_react2.default.createElement(
|
|
57
|
+
"div",
|
|
58
|
+
{ className: "jumbotron" },
|
|
59
|
+
_react2.default.createElement(
|
|
60
|
+
"div",
|
|
61
|
+
{ className: "text-center" },
|
|
62
|
+
_react2.default.createElement("img", { style: { maxWidth: this.props.logoMaxWidth }, src: this.props.logo }),
|
|
63
|
+
_react2.default.createElement(
|
|
64
|
+
"h2",
|
|
65
|
+
{ className: "mt-4 mb-3" },
|
|
66
|
+
this.props.title
|
|
67
|
+
)
|
|
68
|
+
),
|
|
69
|
+
this.props.children
|
|
70
|
+
)
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
}], [{
|
|
75
|
+
key: "defaultProps",
|
|
76
|
+
get: function get() {
|
|
77
|
+
return {
|
|
78
|
+
logoMaxWidth: "100px"
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}]);
|
|
82
|
+
|
|
83
|
+
return Intro;
|
|
84
|
+
}(_react2.default.Component);
|
|
85
|
+
|
|
86
|
+
Intro.propTypes = {
|
|
87
|
+
/**
|
|
88
|
+
* Kann ein Bild sein. Wird im src-Attribute implementiert.
|
|
89
|
+
*/
|
|
90
|
+
logo: _propTypes2.default.string,
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Maximale Breite des Logos.
|
|
94
|
+
*/
|
|
95
|
+
logoMaxWidth: _propTypes2.default.string,
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Der Text, der unter dem Logo erscheint
|
|
99
|
+
*/
|
|
100
|
+
title: _propTypes2.default.string,
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Inhalt
|
|
104
|
+
*/
|
|
105
|
+
children: _propTypes2.default.any
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
exports.default = Intro;
|
package/dist/MenuItem.js
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
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 _Utilities = require("./Utilities.js");
|
|
20
|
+
|
|
21
|
+
var _Utilities2 = _interopRequireDefault(_Utilities);
|
|
22
|
+
|
|
23
|
+
var _Caret = require("./Caret");
|
|
24
|
+
|
|
25
|
+
var _Caret2 = _interopRequireDefault(_Caret);
|
|
26
|
+
|
|
27
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
|
+
|
|
29
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
30
|
+
|
|
31
|
+
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; }
|
|
32
|
+
|
|
33
|
+
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; }
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* List-Item und Link für die Sidebar.
|
|
37
|
+
*/
|
|
38
|
+
var MenuItem = function (_React$Component) {
|
|
39
|
+
_inherits(MenuItem, _React$Component);
|
|
40
|
+
|
|
41
|
+
function MenuItem() {
|
|
42
|
+
_classCallCheck(this, MenuItem);
|
|
43
|
+
|
|
44
|
+
var _this = _possibleConstructorReturn(this, (MenuItem.__proto__ || Object.getPrototypeOf(MenuItem)).call(this));
|
|
45
|
+
|
|
46
|
+
_this.state = {
|
|
47
|
+
showDropdown: false,
|
|
48
|
+
active: false
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
window.addEventListener("hashchange", function (event) {
|
|
52
|
+
_this.checkActive();
|
|
53
|
+
});
|
|
54
|
+
return _this;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
_createClass(MenuItem, [{
|
|
58
|
+
key: "componentWillMount",
|
|
59
|
+
value: function componentWillMount() {
|
|
60
|
+
this.checkActive();
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
key: "onClick",
|
|
64
|
+
value: function onClick(event) {
|
|
65
|
+
if (this.props.onClick) {
|
|
66
|
+
this.props.onClick(event);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (this.props.children) {
|
|
70
|
+
this.setState({ showDropdown: !this.state.showDropdown });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// When user clicks again on active menu item, scroll to top of page
|
|
74
|
+
if (this.props.href && this.props.href == location.hash) {
|
|
75
|
+
_Utilities2.default.scrollToTop();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
key: "checkActive",
|
|
80
|
+
value: function checkActive() {
|
|
81
|
+
this.setState({
|
|
82
|
+
active: location.hash.indexOf(this.props.href) > -1 || (this.props.isHome && (location.hash == "" || location.hash == "#/") ? true : false)
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
key: "render",
|
|
87
|
+
value: function render() {
|
|
88
|
+
var _this2 = this;
|
|
89
|
+
|
|
90
|
+
var className = "blue-app-toggle-page blue-app-sidebar-btn btn" + (this.props.isActive ? " active" : "") + (this.props.className ? " " + this.props.className : "") + (this.props.children ? " blue-app-sidebar-dropdown-toggle" : "");
|
|
91
|
+
|
|
92
|
+
var icon = void 0;
|
|
93
|
+
|
|
94
|
+
if (typeof this.props.icon === "string") {
|
|
95
|
+
// is className
|
|
96
|
+
icon = _react2.default.createElement("span", { className: this.props.icon + (this.props.children ? " blue-app-sidebar-dropdown-icon" : "") });
|
|
97
|
+
} else {
|
|
98
|
+
// is element / component
|
|
99
|
+
icon = this.props.icon;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
var props = {
|
|
103
|
+
id: "blue-action-menu-item-" + _Utilities2.default.guid()
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
Object.keys(this.props).map(function (key) {
|
|
107
|
+
if (key != "isActive" && key != "isHome" && key != "children" && key != "dropdownClassName") {
|
|
108
|
+
props[key] = _this2.props[key];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
return _react2.default.createElement(
|
|
113
|
+
"div",
|
|
114
|
+
null,
|
|
115
|
+
_react2.default.createElement(
|
|
116
|
+
"a",
|
|
117
|
+
_extends({}, props, {
|
|
118
|
+
className: className + (this.props.isActive || this.state.active ? " active" : "") + (this.props.label ? " has-label" : ""),
|
|
119
|
+
onClick: function onClick(event) {
|
|
120
|
+
return _this2.onClick(event);
|
|
121
|
+
}
|
|
122
|
+
}),
|
|
123
|
+
icon,
|
|
124
|
+
" ",
|
|
125
|
+
_react2.default.createElement(
|
|
126
|
+
"span",
|
|
127
|
+
{ className: "blue-app-sidebar-label" },
|
|
128
|
+
this.props.label
|
|
129
|
+
),
|
|
130
|
+
this.props.children && _react2.default.createElement(_Caret2.default, {
|
|
131
|
+
open: this.state.showDropdown,
|
|
132
|
+
mirrored: true,
|
|
133
|
+
className: "blue-app-sidebar-dropdown-caret mt-2"
|
|
134
|
+
})
|
|
135
|
+
),
|
|
136
|
+
this.state.showDropdown && _react2.default.createElement(
|
|
137
|
+
"div",
|
|
138
|
+
{ className: "blue-app-sidebar-dropdown " + this.props.dropdownClassName },
|
|
139
|
+
this.props.children
|
|
140
|
+
)
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
}], [{
|
|
144
|
+
key: "defaultProps",
|
|
145
|
+
get: function get() {
|
|
146
|
+
return {
|
|
147
|
+
href: "javascript:void(0)",
|
|
148
|
+
isActive: false,
|
|
149
|
+
dropdownClassName: ""
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}]);
|
|
153
|
+
|
|
154
|
+
return MenuItem;
|
|
155
|
+
}(_react2.default.Component);
|
|
156
|
+
|
|
157
|
+
MenuItem.propTypes = {
|
|
158
|
+
/**
|
|
159
|
+
* Setzt to-Property der NavLink-Komponente aus React Router.
|
|
160
|
+
*/
|
|
161
|
+
to: _propTypes2.default.string,
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Kann als Alternative zu to benutzt werden.
|
|
165
|
+
*/
|
|
166
|
+
href: _propTypes2.default.string,
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* onClick Event
|
|
170
|
+
*/
|
|
171
|
+
onClick: _propTypes2.default.func,
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Klasse eines Icons oder Element, z.B. von blueicon-colored.
|
|
175
|
+
*/
|
|
176
|
+
icon: _propTypes2.default.any,
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Beschriftung des Links
|
|
180
|
+
*/
|
|
181
|
+
label: _propTypes2.default.any,
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Soll Item als "aktiv" markiert werden? Ist die to-Property gesetzt, wird Item automatisch als "aktiv" markiert, wenn entsprechende Seite aktiv ist.
|
|
185
|
+
*/
|
|
186
|
+
isActive: _propTypes2.default.bool,
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Als MenuItem für Startseite deklariert.
|
|
190
|
+
*/
|
|
191
|
+
isHome: _propTypes2.default.bool,
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Ergänzung der Klasse vom Dropdown-Menü.
|
|
195
|
+
*/
|
|
196
|
+
dropdownClassName: _propTypes2.default.string,
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Werden in einem Dropdown-Menü angezeigt.
|
|
200
|
+
*/
|
|
201
|
+
children: _propTypes2.default.any
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
exports.default = MenuItem;
|
package/dist/Page.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
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 _Header = require("./Header.js");
|
|
14
|
+
|
|
15
|
+
var _Header2 = _interopRequireDefault(_Header);
|
|
16
|
+
|
|
17
|
+
var _Body = require("./Body.js");
|
|
18
|
+
|
|
19
|
+
var _Body2 = _interopRequireDefault(_Body);
|
|
20
|
+
|
|
21
|
+
var _Utilities = require("./Utilities.js");
|
|
22
|
+
|
|
23
|
+
var _Utilities2 = _interopRequireDefault(_Utilities);
|
|
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
|
+
var Page = function (_React$Component) {
|
|
34
|
+
_inherits(Page, _React$Component);
|
|
35
|
+
|
|
36
|
+
function Page() {
|
|
37
|
+
_classCallCheck(this, Page);
|
|
38
|
+
|
|
39
|
+
return _possibleConstructorReturn(this, (Page.__proto__ || Object.getPrototypeOf(Page)).apply(this, arguments));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
_createClass(Page, [{
|
|
43
|
+
key: "componentDidMount",
|
|
44
|
+
value: function componentDidMount() {
|
|
45
|
+
_Utilities2.default.registerFluentBtns();
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
key: "render",
|
|
49
|
+
value: function render() {
|
|
50
|
+
return _react2.default.createElement(
|
|
51
|
+
"div",
|
|
52
|
+
null,
|
|
53
|
+
this.props.children
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
}]);
|
|
57
|
+
|
|
58
|
+
return Page;
|
|
59
|
+
}(_react2.default.Component);
|
|
60
|
+
|
|
61
|
+
Page.Header = _Header2.default;
|
|
62
|
+
Page.Body = _Body2.default;
|
|
63
|
+
|
|
64
|
+
exports.default = Page;
|
package/dist/Search.js
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
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");
|
|
18
|
+
|
|
19
|
+
var _Utilities2 = _interopRequireDefault(_Utilities);
|
|
20
|
+
|
|
21
|
+
var _MenuItem = require("./MenuItem");
|
|
22
|
+
|
|
23
|
+
var _MenuItem2 = _interopRequireDefault(_MenuItem);
|
|
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
|
+
* Eine Suchleiste, die zur Seitenleiste hinzugefügt werden kann.
|
|
35
|
+
*/
|
|
36
|
+
var Search = function (_React$Component) {
|
|
37
|
+
_inherits(Search, _React$Component);
|
|
38
|
+
|
|
39
|
+
function Search() {
|
|
40
|
+
_classCallCheck(this, Search);
|
|
41
|
+
|
|
42
|
+
var _this = _possibleConstructorReturn(this, (Search.__proto__ || Object.getPrototypeOf(Search)).call(this));
|
|
43
|
+
|
|
44
|
+
_this.state = {
|
|
45
|
+
value: "",
|
|
46
|
+
focus: false
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
_this.SearchControlId = "blue-app-search-control-" + _Utilities2.default.guid();
|
|
50
|
+
return _this;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
_createClass(Search, [{
|
|
54
|
+
key: "componentWillMount",
|
|
55
|
+
value: function componentWillMount() {
|
|
56
|
+
this.setState({ value: this.props.value });
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: "componentDidUpdate",
|
|
60
|
+
value: function componentDidUpdate(prevProps) {
|
|
61
|
+
if (prevProps.value !== this.props.value) {
|
|
62
|
+
this.componentWillMount();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
key: "toggleSidebar",
|
|
67
|
+
value: function toggleSidebar() {
|
|
68
|
+
if (this.props.sidebar) {
|
|
69
|
+
document.dispatchEvent(window.toggleSidebarEvent);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
key: "render",
|
|
74
|
+
value: function render() {
|
|
75
|
+
var _this2 = this;
|
|
76
|
+
|
|
77
|
+
return _react2.default.createElement(
|
|
78
|
+
"form",
|
|
79
|
+
{
|
|
80
|
+
className: "blue-app-search " + (this.props.body ? "blue-app-search-body " : "") + (this.state.focus ? "focus" : ""),
|
|
81
|
+
onSubmit: function onSubmit(event) {
|
|
82
|
+
event.preventDefault();
|
|
83
|
+
_this2.toggleSidebar();
|
|
84
|
+
_this2.props.onSubmit(event);
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
_react2.default.createElement(
|
|
88
|
+
"div",
|
|
89
|
+
{ className: "blue-app-search-input-group input-group" },
|
|
90
|
+
_react2.default.createElement(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
className: "input-group-prepend",
|
|
94
|
+
onClick: function onClick() {
|
|
95
|
+
return document.getElementById(_this2.SearchControlId).focus();
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
_react2.default.createElement(
|
|
99
|
+
"span",
|
|
100
|
+
{ className: "input-group-text" },
|
|
101
|
+
_react2.default.createElement("span", { className: "bi-magnifying_glass" })
|
|
102
|
+
)
|
|
103
|
+
),
|
|
104
|
+
_react2.default.createElement("input", {
|
|
105
|
+
type: "search",
|
|
106
|
+
value: this.state.value,
|
|
107
|
+
onChange: function onChange(event) {
|
|
108
|
+
_this2.setState({ value: event.target.value });
|
|
109
|
+
_this2.props.onChange(event);
|
|
110
|
+
},
|
|
111
|
+
id: this.SearchControlId,
|
|
112
|
+
className: "blue-app-search-control form-control default input-lg",
|
|
113
|
+
placeholder: this.props.placeholder,
|
|
114
|
+
autoFocus: this.props.autoFocus,
|
|
115
|
+
style: {
|
|
116
|
+
zIndex: this.props.body ? "0" : ""
|
|
117
|
+
},
|
|
118
|
+
onFocus: function onFocus() {
|
|
119
|
+
return _this2.setState({ focus: true });
|
|
120
|
+
},
|
|
121
|
+
onBlur: function onBlur() {
|
|
122
|
+
return _this2.setState({ focus: false });
|
|
123
|
+
}
|
|
124
|
+
}),
|
|
125
|
+
this.props.reset && this.state.value.length > 0 && _react2.default.createElement(
|
|
126
|
+
"div",
|
|
127
|
+
{ className: "input-group-btn" },
|
|
128
|
+
_react2.default.createElement(
|
|
129
|
+
"button",
|
|
130
|
+
{
|
|
131
|
+
type: "button",
|
|
132
|
+
className: "blue-app-search-reset-btn btn btn-link btn-lg",
|
|
133
|
+
onClick: function onClick() {
|
|
134
|
+
_this2.setState({ value: "" }, function () {
|
|
135
|
+
document.getElementById(_this2.SearchControlId).focus();
|
|
136
|
+
});
|
|
137
|
+
_this2.props.onChange({
|
|
138
|
+
target: {
|
|
139
|
+
value: ""
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
_react2.default.createElement("span", { className: "bi-navigate_cross" })
|
|
145
|
+
)
|
|
146
|
+
)
|
|
147
|
+
),
|
|
148
|
+
this.props.sidebar && _react2.default.createElement(_MenuItem2.default, {
|
|
149
|
+
href: "javascript:void(0)",
|
|
150
|
+
className: "blue-app-search-btn",
|
|
151
|
+
icon: "bi-magnifying_glass blue-app-search-btn-icon",
|
|
152
|
+
onClick: function onClick() {
|
|
153
|
+
_this2.toggleSidebar();
|
|
154
|
+
setTimeout(function () {
|
|
155
|
+
document.querySelector(".blue-app-search-control").select();
|
|
156
|
+
}, 200);
|
|
157
|
+
}
|
|
158
|
+
})
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
}], [{
|
|
162
|
+
key: "defaultProps",
|
|
163
|
+
get: function get() {
|
|
164
|
+
return {
|
|
165
|
+
sidebar: false,
|
|
166
|
+
body: false,
|
|
167
|
+
reset: false,
|
|
168
|
+
value: "",
|
|
169
|
+
onChange: function onChange(event) {},
|
|
170
|
+
onSubmit: function onSubmit(event) {},
|
|
171
|
+
placeholder: "",
|
|
172
|
+
autoFocus: false
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
}]);
|
|
176
|
+
|
|
177
|
+
return Search;
|
|
178
|
+
}(_react2.default.Component);
|
|
179
|
+
|
|
180
|
+
Search.propTypes = {
|
|
181
|
+
/**
|
|
182
|
+
* Wird Komponente in der Sidebar genutzt?
|
|
183
|
+
*/
|
|
184
|
+
sidebar: _propTypes2.default.bool,
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Wird Komponente im Body genutzt?
|
|
188
|
+
*/
|
|
189
|
+
body: _propTypes2.default.bool,
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Erlaube Zurücksetzen?
|
|
193
|
+
*/
|
|
194
|
+
reset: _propTypes2.default.bool,
|
|
195
|
+
|
|
196
|
+
value: _propTypes2.default.string,
|
|
197
|
+
onChange: _propTypes2.default.func,
|
|
198
|
+
onSubmit: _propTypes2.default.func,
|
|
199
|
+
placeholder: _propTypes2.default.string,
|
|
200
|
+
autoFocus: _propTypes2.default.bool
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
exports.default = Search;
|