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/Grid.js
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
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 _SidebarMenu = require("./SidebarMenu.js");
|
|
18
|
+
|
|
19
|
+
var _SidebarMenu2 = _interopRequireDefault(_SidebarMenu);
|
|
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
|
+
// Damit Events auch in IE funktionieren
|
|
34
|
+
// require("custom-event-polyfill/custom-event-polyfill.js");
|
|
35
|
+
|
|
36
|
+
window.toggleSidebarEvent = new CustomEvent("toggleSidebar");
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Das Grundgerüst. Sobald diese Komponente gemountet wurde, ist sie global über <code>window.blueGridRef</code> zugreifbar.<br>
|
|
40
|
+
* Außerdem kann über <code>blueGridRef.addEventListener(eventName, (prevProps, prevState) => { })</code> ein Event-Listener angefügt werden.
|
|
41
|
+
* <br><br>
|
|
42
|
+
* Erlaubte Event-Listener:
|
|
43
|
+
* <table class="table">
|
|
44
|
+
* <thead><tr><th>Event name</th><th>Description</th><th>Beispiel</th></tr></thead>
|
|
45
|
+
* <tbody>
|
|
46
|
+
* <tr>
|
|
47
|
+
* <th>componentDidUpdate</th>
|
|
48
|
+
* <td>Komponente wurde aktualisiert.</td>
|
|
49
|
+
* <td><code>blueGridRef.addEventListener("componentDidUpdate", (prevProps, prevState) => { })</code></td>
|
|
50
|
+
* </tr>
|
|
51
|
+
*
|
|
52
|
+
* <tr>
|
|
53
|
+
* <th>pageDidShowAgain</th>
|
|
54
|
+
* <td>Seite wurde erneut angezeigt, mit altem Stand. Im Callback kann Komponente neu initialisiert werden.</td>
|
|
55
|
+
* <td><code>blueGridRef.addEventListener("pageDidShowAgain", "home", (prevProps, prevState) => { })</code></td>
|
|
56
|
+
* </tr>
|
|
57
|
+
*
|
|
58
|
+
* <tr>
|
|
59
|
+
* <th>pageDidHide</th>
|
|
60
|
+
* <td>Seite wurde versteckt (andere Seite wurde angezeigt).</td>
|
|
61
|
+
* <td><code>blueGridRef.addEventListener("pageDidHide", "home", (prevProps, prevState) => { })</code></td>
|
|
62
|
+
* </tr>
|
|
63
|
+
* </tbody>
|
|
64
|
+
* </table>
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
var Grid = function (_React$Component) {
|
|
68
|
+
_inherits(Grid, _React$Component);
|
|
69
|
+
|
|
70
|
+
function Grid() {
|
|
71
|
+
_classCallCheck(this, Grid);
|
|
72
|
+
|
|
73
|
+
var _this = _possibleConstructorReturn(this, (Grid.__proto__ || Object.getPrototypeOf(Grid)).call(this));
|
|
74
|
+
|
|
75
|
+
window.blueGridRef = _this;
|
|
76
|
+
|
|
77
|
+
_this.defaultMatch = ["home"];
|
|
78
|
+
|
|
79
|
+
_this.state = {
|
|
80
|
+
sidebarIn: false,
|
|
81
|
+
match: null,
|
|
82
|
+
history: [],
|
|
83
|
+
hash: location.hash
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
_this.hideSidebar = _this.hideSidebar.bind(_this);
|
|
87
|
+
|
|
88
|
+
window.addEventListener("hashchange", function (event) {
|
|
89
|
+
_this.initMatch();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
_this.eventListeners = [];
|
|
93
|
+
return _this;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
_createClass(Grid, [{
|
|
97
|
+
key: "componentWillMount",
|
|
98
|
+
value: function componentWillMount() {
|
|
99
|
+
var _this2 = this;
|
|
100
|
+
|
|
101
|
+
document.addEventListener("toggleSidebar", function () {
|
|
102
|
+
_this2.toggleSidebar();
|
|
103
|
+
}, false);
|
|
104
|
+
|
|
105
|
+
this.setState({ sidebarIn: this.props.sidebarIn });
|
|
106
|
+
|
|
107
|
+
this.initMatch();
|
|
108
|
+
}
|
|
109
|
+
}, {
|
|
110
|
+
key: "componentDidMount",
|
|
111
|
+
value: function componentDidMount() {
|
|
112
|
+
|
|
113
|
+
var me = this;
|
|
114
|
+
|
|
115
|
+
document.addEventListener("touchstart", function (event) {
|
|
116
|
+
var xPos = event.touches[0].pageX;
|
|
117
|
+
|
|
118
|
+
if (xPos < 5) {
|
|
119
|
+
me.toggleSidebar(event);
|
|
120
|
+
} else if (me.state.sidebarIn && xPos > 20) {
|
|
121
|
+
me.toggleSidebar(event);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
_Utilities2.default.registerFluentBtns();
|
|
126
|
+
}
|
|
127
|
+
}, {
|
|
128
|
+
key: "componentDidUpdate",
|
|
129
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
130
|
+
var _this3 = this;
|
|
131
|
+
|
|
132
|
+
this.eventListeners.map(function (eventListener) {
|
|
133
|
+
if (eventListener[0] == "componentDidUpdate") {
|
|
134
|
+
var callback = eventListener[1];
|
|
135
|
+
eventListener[1](prevProps, prevState);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (eventListener[0] == "pageDidShowAgain") {
|
|
139
|
+
var pageId = eventListener[1];
|
|
140
|
+
var _callback = eventListener[2];
|
|
141
|
+
|
|
142
|
+
if (prevState.hash != _this3.state.hash && _this3.state.match[0] == pageId) {
|
|
143
|
+
_callback(prevProps, prevState);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (eventListener[0] == "pageDidHide") {
|
|
148
|
+
var _pageId = eventListener[1];
|
|
149
|
+
var _callback2 = eventListener[2];
|
|
150
|
+
|
|
151
|
+
if (prevState.hash != _this3.state.hash && prevState.match[0] == _pageId) {
|
|
152
|
+
_callback2(prevProps, prevState);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}, {
|
|
158
|
+
key: "toggleSidebar",
|
|
159
|
+
value: function toggleSidebar(event) {
|
|
160
|
+
if (this.state.sidebarIn) {
|
|
161
|
+
this.hideSidebar(event);
|
|
162
|
+
}
|
|
163
|
+
this.setState({ sidebarIn: true });
|
|
164
|
+
}
|
|
165
|
+
}, {
|
|
166
|
+
key: "hideSidebar",
|
|
167
|
+
value: function hideSidebar(e) {
|
|
168
|
+
if (!(_Utilities2.default.hasClass(e.target, "blue-app-open-menu") || _Utilities2.default.hasClass(e.target, "bi-menu") || _Utilities2.default.hasClass(e.target, "blue-app-search") || _Utilities2.default.hasClass(e.target, "blue-app-search-control") || _Utilities2.default.hasClass(e.target, "blue-app-search-btn") || _Utilities2.default.hasClass(e.target, "blue-app-search-btn-icon") || _Utilities2.default.hasClass(e.target, "blue-app-sidebar-label") || _Utilities2.default.hasClass(e.target, "blue-app-sidebar-dropdown-toggle") || _Utilities2.default.hasClass(e.target, "blue-app-sidebar-dropdown-caret") || _Utilities2.default.hasClass(e.target, "blue-app-sidebar-dropdown-icon") || _Utilities2.default.hasClass(e.target, "blue-app-sidebar-exception"))) {
|
|
169
|
+
this.setState({ sidebarIn: false });
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}, {
|
|
173
|
+
key: "initMatch",
|
|
174
|
+
value: function initMatch() {
|
|
175
|
+
var newMatch = void 0;
|
|
176
|
+
|
|
177
|
+
if (location.hash && location.hash != "" && location.hash != "#/") {
|
|
178
|
+
newMatch = location.hash.replace("#", "").split("/").filter(function (n) {
|
|
179
|
+
return n != "";
|
|
180
|
+
});
|
|
181
|
+
} else {
|
|
182
|
+
newMatch = this.defaultMatch;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (this.props.unrouteable) {
|
|
186
|
+
newMatch = this.defaultMatch;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (!(this.state.history.indexOf(newMatch[0]) > -1)) {
|
|
190
|
+
this.state.history.push(newMatch[0]);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
this.setState({ match: newMatch, history: this.state.history, hash: location.hash });
|
|
194
|
+
}
|
|
195
|
+
}, {
|
|
196
|
+
key: "addEventListener",
|
|
197
|
+
value: function addEventListener(param1, param2, param3) {
|
|
198
|
+
this.eventListeners.push([param1, param2, param3]);
|
|
199
|
+
}
|
|
200
|
+
}, {
|
|
201
|
+
key: "render",
|
|
202
|
+
value: function render() {
|
|
203
|
+
var _this4 = this;
|
|
204
|
+
|
|
205
|
+
return _react2.default.createElement(
|
|
206
|
+
"div",
|
|
207
|
+
null,
|
|
208
|
+
_react2.default.createElement("div", { className: "blue-app-wrapper" }),
|
|
209
|
+
_react2.default.createElement(
|
|
210
|
+
"div",
|
|
211
|
+
{ id: this.props.id ? this.props.id : "",
|
|
212
|
+
style: this.props.style ? this.props.style : {},
|
|
213
|
+
className: "blue-app-grid" + (this.props.className ? " " + this.props.className : "") + (this.state.sidebarIn ? " open" : "") + (this.props.hideSidebarMenu ? " hasNoSidebarMenu" : " hasSidebarMenu") + (this.props.expandSidebar ? " expand-sidebar" : ""),
|
|
214
|
+
onClick: this.hideSidebar
|
|
215
|
+
},
|
|
216
|
+
_react2.default.createElement(
|
|
217
|
+
"div",
|
|
218
|
+
{ className: "blue-app-sidebar-toggler" },
|
|
219
|
+
!this.props.hideSidebarMenu ? _react2.default.createElement(
|
|
220
|
+
"button",
|
|
221
|
+
{
|
|
222
|
+
type: "button",
|
|
223
|
+
className: "fluent-btn blue-app-open-menu blue-app-sidebar-btn btn",
|
|
224
|
+
onClick: function onClick() {
|
|
225
|
+
_this4.setState({ sidebarIn: !_this4.state.sidebarIn });
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
_react2.default.createElement("div", { className: "fluent-btn-ball blue-app-sidebar-exception" }),
|
|
229
|
+
_react2.default.createElement("span", { className: "bi-menu" })
|
|
230
|
+
) : ""
|
|
231
|
+
),
|
|
232
|
+
this.props.children,
|
|
233
|
+
this.props.pages.map(function (page) {
|
|
234
|
+
return _this4.state.history.indexOf(page.name) > -1 && _react2.default.createElement(
|
|
235
|
+
"div",
|
|
236
|
+
{
|
|
237
|
+
key: page.name,
|
|
238
|
+
className: "router-page " + (_this4.state.match[0] == page.name ? "active" : "")
|
|
239
|
+
},
|
|
240
|
+
page.component
|
|
241
|
+
);
|
|
242
|
+
}),
|
|
243
|
+
_react2.default.createElement(
|
|
244
|
+
"div",
|
|
245
|
+
{ className: "blue-app-status-circle blue-app-loading blue-app-status-loading" },
|
|
246
|
+
_react2.default.createElement(
|
|
247
|
+
"div",
|
|
248
|
+
{ className: "spinner-bounce-circle" },
|
|
249
|
+
_react2.default.createElement("div", null),
|
|
250
|
+
_react2.default.createElement("div", null)
|
|
251
|
+
)
|
|
252
|
+
),
|
|
253
|
+
_react2.default.createElement(
|
|
254
|
+
"div",
|
|
255
|
+
{ className: "blue-app-status-circle blue-app-status-success" },
|
|
256
|
+
_react2.default.createElement("span", { className: "bi-check" })
|
|
257
|
+
),
|
|
258
|
+
_react2.default.createElement(
|
|
259
|
+
"div",
|
|
260
|
+
{ className: "blue-app-status-circle blue-app-status-info" },
|
|
261
|
+
_react2.default.createElement("span", { className: "bi-information" })
|
|
262
|
+
),
|
|
263
|
+
_react2.default.createElement(
|
|
264
|
+
"div",
|
|
265
|
+
{ className: "blue-app-status-circle blue-app-status-warning" },
|
|
266
|
+
_react2.default.createElement("span", { className: "bi-sign_warning" })
|
|
267
|
+
),
|
|
268
|
+
_react2.default.createElement(
|
|
269
|
+
"div",
|
|
270
|
+
{ className: "blue-app-status-circle blue-app-status-danger" },
|
|
271
|
+
_react2.default.createElement("span", { className: "bi-error" })
|
|
272
|
+
),
|
|
273
|
+
_react2.default.createElement(
|
|
274
|
+
"div",
|
|
275
|
+
{ className: "blue-app-status-alert alert" },
|
|
276
|
+
_react2.default.createElement(
|
|
277
|
+
"button",
|
|
278
|
+
{
|
|
279
|
+
type: "button",
|
|
280
|
+
className: "close"
|
|
281
|
+
},
|
|
282
|
+
"\xD7"
|
|
283
|
+
),
|
|
284
|
+
_react2.default.createElement("div", { className: "alert-body" })
|
|
285
|
+
)
|
|
286
|
+
)
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
}], [{
|
|
290
|
+
key: "defaultProps",
|
|
291
|
+
get: function get() {
|
|
292
|
+
return {
|
|
293
|
+
expandSidebar: false,
|
|
294
|
+
hideSidebarMenu: false,
|
|
295
|
+
unrouteable: false,
|
|
296
|
+
disableTitleSet: false
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
}]);
|
|
300
|
+
|
|
301
|
+
return Grid;
|
|
302
|
+
}(_react2.default.Component);
|
|
303
|
+
|
|
304
|
+
// Grid.toggleSidebar = null;
|
|
305
|
+
|
|
306
|
+
Grid.SidebarMenu = _SidebarMenu2.default;
|
|
307
|
+
|
|
308
|
+
Grid.propTypes = {
|
|
309
|
+
/**
|
|
310
|
+
* Die Sidebar ist bei Vollbild automatisch eingeklappt.
|
|
311
|
+
*/
|
|
312
|
+
expandSidebar: _propTypes2.default.bool,
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Deaktiviert die Sidebar.
|
|
316
|
+
*/
|
|
317
|
+
hideSidebarMenu: _propTypes2.default.bool,
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Registriert Seiten. Beispiel: [{name: "home", component: <HomePage />}]
|
|
321
|
+
*/
|
|
322
|
+
pages: _propTypes2.default.array,
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Wenn <code>true</code> wird immer die "home"-Route geladen.
|
|
326
|
+
*/
|
|
327
|
+
unrouteable: _propTypes2.default.bool,
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Erweitert die <code>className</code>-Eigenschaft.
|
|
331
|
+
*/
|
|
332
|
+
className: _propTypes2.default.string,
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Normalerweise wird der Dokumenten-Titel automatisch gesetzt. Setze diese Property auf <code>true</code> um das zu
|
|
336
|
+
* deaktivieren.
|
|
337
|
+
*/
|
|
338
|
+
disableTitleSet: _propTypes2.default.bool
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
exports.default = Grid;
|
package/dist/Header.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
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 _HeaderTitle = require("./HeaderTitle.js");
|
|
14
|
+
|
|
15
|
+
var _HeaderTitle2 = _interopRequireDefault(_HeaderTitle);
|
|
16
|
+
|
|
17
|
+
var _HeaderActions = require("./HeaderActions.js");
|
|
18
|
+
|
|
19
|
+
var _HeaderActions2 = _interopRequireDefault(_HeaderActions);
|
|
20
|
+
|
|
21
|
+
var _FluentBtn = require("./FluentBtn.js");
|
|
22
|
+
|
|
23
|
+
var _FluentBtn2 = _interopRequireDefault(_FluentBtn);
|
|
24
|
+
|
|
25
|
+
var _Utilities = require("./Utilities.js");
|
|
26
|
+
|
|
27
|
+
var _Utilities2 = _interopRequireDefault(_Utilities);
|
|
28
|
+
|
|
29
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
|
+
|
|
31
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
32
|
+
|
|
33
|
+
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; }
|
|
34
|
+
|
|
35
|
+
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; }
|
|
36
|
+
|
|
37
|
+
var Header = function (_React$Component) {
|
|
38
|
+
_inherits(Header, _React$Component);
|
|
39
|
+
|
|
40
|
+
function Header() {
|
|
41
|
+
_classCallCheck(this, Header);
|
|
42
|
+
|
|
43
|
+
return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
_createClass(Header, [{
|
|
47
|
+
key: "render",
|
|
48
|
+
value: function render() {
|
|
49
|
+
return _react2.default.createElement(
|
|
50
|
+
"div",
|
|
51
|
+
{ className: "blue-app-header blue-app-header-extension" },
|
|
52
|
+
_react2.default.createElement("div", { className: "ui-header-wrapper", onClick: function onClick() {
|
|
53
|
+
return _Utilities2.default.scrollToTop();
|
|
54
|
+
} }),
|
|
55
|
+
this.props.children
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}]);
|
|
59
|
+
|
|
60
|
+
return Header;
|
|
61
|
+
}(_react2.default.Component);
|
|
62
|
+
|
|
63
|
+
Header.Title = _HeaderTitle2.default;
|
|
64
|
+
Header.Actions = _HeaderActions2.default;
|
|
65
|
+
|
|
66
|
+
exports.default = Header;
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
* Hier werden z.B. Buttons für die aktuelle Seite platziert.
|
|
31
|
+
*/
|
|
32
|
+
var HeaderActions = function (_React$Component) {
|
|
33
|
+
_inherits(HeaderActions, _React$Component);
|
|
34
|
+
|
|
35
|
+
function HeaderActions() {
|
|
36
|
+
_classCallCheck(this, HeaderActions);
|
|
37
|
+
|
|
38
|
+
return _possibleConstructorReturn(this, (HeaderActions.__proto__ || Object.getPrototypeOf(HeaderActions)).apply(this, arguments));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
_createClass(HeaderActions, [{
|
|
42
|
+
key: "render",
|
|
43
|
+
value: function render() {
|
|
44
|
+
return _react2.default.createElement(
|
|
45
|
+
"div",
|
|
46
|
+
{ className: "blue-app-actions navbar navbar-expand-lg " + this.props.className + " " + this.props.breakpoint },
|
|
47
|
+
_react2.default.createElement("div", { className: "ui-header-wrapper", onClick: function onClick() {
|
|
48
|
+
return _Utilities2.default.scrollToTop();
|
|
49
|
+
} }),
|
|
50
|
+
this.props.children
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}], [{
|
|
54
|
+
key: "defaultProps",
|
|
55
|
+
get: function get() {
|
|
56
|
+
return {
|
|
57
|
+
className: "",
|
|
58
|
+
breakpoint: "sm"
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}]);
|
|
62
|
+
|
|
63
|
+
return HeaderActions;
|
|
64
|
+
}(_react2.default.Component);
|
|
65
|
+
|
|
66
|
+
HeaderActions.propTypes = {
|
|
67
|
+
className: _propTypes2.default.string,
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Legt fest, ab welcher Breite umgebrochen wird. Mögliche Werte: <code>"sm"</code> (768px), <code>"md"</code> (992px), <code>"lg"</code> (1200px)
|
|
71
|
+
*/
|
|
72
|
+
breakpoint: _propTypes2.default.string
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
exports.default = HeaderActions;
|
|
@@ -0,0 +1,137 @@
|
|
|
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
|
+
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
|
+
* Der Titel-Bereich in der Kopf-Leiste.
|
|
31
|
+
* Anhand dessen wird auch der Dokumenten-Titel gesetzt (was in der Browser Titelzeile gezeigt wird).
|
|
32
|
+
*/
|
|
33
|
+
var HeaderTitle = function (_React$Component) {
|
|
34
|
+
_inherits(HeaderTitle, _React$Component);
|
|
35
|
+
|
|
36
|
+
_createClass(HeaderTitle, null, [{
|
|
37
|
+
key: "defaultProps",
|
|
38
|
+
get: function get() {
|
|
39
|
+
return {
|
|
40
|
+
keepAppTitle: false
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}]);
|
|
44
|
+
|
|
45
|
+
function HeaderTitle() {
|
|
46
|
+
_classCallCheck(this, HeaderTitle);
|
|
47
|
+
|
|
48
|
+
var _this = _possibleConstructorReturn(this, (HeaderTitle.__proto__ || Object.getPrototypeOf(HeaderTitle)).call(this));
|
|
49
|
+
|
|
50
|
+
_this.uniqueId = "HeaderTitle-" + _Utilities2.default.guid();
|
|
51
|
+
return _this;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
_createClass(HeaderTitle, [{
|
|
55
|
+
key: "componentDidMount",
|
|
56
|
+
value: function componentDidMount() {
|
|
57
|
+
this.setDocumentTitle();
|
|
58
|
+
}
|
|
59
|
+
}, {
|
|
60
|
+
key: "componentDidUpdate",
|
|
61
|
+
value: function componentDidUpdate(prevProps) {
|
|
62
|
+
if (prevProps.children !== this.props.children) {
|
|
63
|
+
this.setDocumentTitle();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}, {
|
|
67
|
+
key: "setDocumentTitle",
|
|
68
|
+
value: function setDocumentTitle() {
|
|
69
|
+
if (blueGridRef && blueGridRef.props && blueGridRef.props.disableTitleSet == false) {
|
|
70
|
+
var element = document.querySelector("#" + this.uniqueId + " .blue-app-header-logo-title-labels");
|
|
71
|
+
if (element && element.innerText) {
|
|
72
|
+
document.querySelector("title").innerText = element.innerText;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
key: "render",
|
|
78
|
+
value: function render() {
|
|
79
|
+
return _react2.default.createElement(
|
|
80
|
+
"h3",
|
|
81
|
+
{ id: this.uniqueId, className: "blue-app-header-logo" },
|
|
82
|
+
_react2.default.createElement(
|
|
83
|
+
"span",
|
|
84
|
+
{ className: "blue-app-header-logo-title" },
|
|
85
|
+
this.props.logo ? _react2.default.createElement(
|
|
86
|
+
"span",
|
|
87
|
+
null,
|
|
88
|
+
_react2.default.createElement(
|
|
89
|
+
"a",
|
|
90
|
+
{ href: "#" },
|
|
91
|
+
_react2.default.createElement("img", { src: this.props.logo, className: "blue-app-header-logo-image" })
|
|
92
|
+
),
|
|
93
|
+
"\xA0"
|
|
94
|
+
) : "",
|
|
95
|
+
_react2.default.createElement(
|
|
96
|
+
"span",
|
|
97
|
+
{ className: "blue-app-header-logo-title-labels " + (this.props.keepAppTitle ? "keep" : "") },
|
|
98
|
+
this.props.appTitle ? _react2.default.createElement(
|
|
99
|
+
"span",
|
|
100
|
+
null,
|
|
101
|
+
_react2.default.createElement(
|
|
102
|
+
"a",
|
|
103
|
+
{ href: "#" },
|
|
104
|
+
this.props.appTitle
|
|
105
|
+
),
|
|
106
|
+
" ",
|
|
107
|
+
this.props.children ? "/" : "",
|
|
108
|
+
"\xA0"
|
|
109
|
+
) : "",
|
|
110
|
+
this.props.children
|
|
111
|
+
)
|
|
112
|
+
)
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
}]);
|
|
116
|
+
|
|
117
|
+
return HeaderTitle;
|
|
118
|
+
}(_react2.default.Component);
|
|
119
|
+
|
|
120
|
+
HeaderTitle.propTypes = {
|
|
121
|
+
/**
|
|
122
|
+
* Kann ein Bild sein. Wird im src-Attribute implementiert.
|
|
123
|
+
*/
|
|
124
|
+
logo: _propTypes2.default.string,
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Der Text, der neben dem Logo steht.
|
|
128
|
+
*/
|
|
129
|
+
appTitle: _propTypes2.default.string,
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Deaktiviert, dass der App-Titel bei bestimmer Bildschirmgröße ausgeblendet wird.
|
|
133
|
+
*/
|
|
134
|
+
keepAppTitle: _propTypes2.default.bool
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
exports.default = HeaderTitle;
|