blue-react 8.0.0-next.3 → 8.0.1
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 +59 -59
- package/dist/components/ActionMenuSwitch.js +2 -2
- package/dist/components/BodyRounded.js +41 -41
- package/dist/components/Caret.js +2 -2
- package/dist/components/DocumentView.js +3 -3
- package/dist/components/Grid.js +275 -275
- package/dist/components/Header.js +2 -2
- package/dist/components/HeaderTitle.js +3 -3
- package/dist/components/Intro.js +2 -2
- package/dist/components/Layout.js +35 -7
- package/dist/components/Outside.js +6 -6
- package/dist/components/Page.js +2 -2
- package/dist/components/Search.js +1 -1
- package/dist/components/SidebarMenu.js +2 -2
- package/dist/components/Switch.js +2 -2
- package/dist/style.css +9 -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/_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 +6 -6
- package/dist/styles/_router.scss +18 -18
- package/dist/styles/_search.scss +0 -1
- package/dist/styles/_switch.scss +21 -21
- package/dist/styles/mixins/_action-menu.scss +68 -68
- 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/Layout.d.ts +15 -6
- package/package.json +88 -88
package/dist/components/Grid.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _Utilities = _interopRequireDefault(require("./Utilities"));
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
-
|
|
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
|
-
|
|
20
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
-
|
|
22
|
-
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); } }
|
|
23
|
-
|
|
24
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
25
|
-
|
|
26
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
-
|
|
28
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
-
|
|
30
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
31
|
-
|
|
32
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
33
|
-
|
|
34
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
|
-
|
|
36
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
|
-
|
|
38
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
-
|
|
40
|
-
window.toggleSidebarEvent = new CustomEvent("toggleSidebar");
|
|
41
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _Utilities = _interopRequireDefault(require("./Utilities"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
|
|
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
|
+
|
|
20
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
+
|
|
22
|
+
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); } }
|
|
23
|
+
|
|
24
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
25
|
+
|
|
26
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
+
|
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
+
|
|
30
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
31
|
+
|
|
32
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
33
|
+
|
|
34
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
|
+
|
|
36
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
|
+
|
|
38
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
+
|
|
40
|
+
window.toggleSidebarEvent = new CustomEvent("toggleSidebar");
|
|
41
|
+
|
|
42
42
|
/**
|
|
43
43
|
* The main component. As soon this component is mounted, it is globally available under `window.blueGridRef`.
|
|
44
44
|
* Also you can append your own event listeners with `blueGridRef.addEventListener(eventName, (prevProps, prevState) => { })`.
|
|
@@ -51,238 +51,238 @@ window.toggleSidebarEvent = new CustomEvent("toggleSidebar");
|
|
|
51
51
|
* Example: `blueGridRef.addEventListener("pageDidShowAgain", "home", (prevProps, prevState) => { })`
|
|
52
52
|
* * **pageDidHide** - This page disappeared and another page appears instead.
|
|
53
53
|
* Example: `blueGridRef.addEventListener("pageDidHide", "home", (prevProps, prevState) => { })`
|
|
54
|
-
*/
|
|
55
|
-
var Grid = /*#__PURE__*/function (_Component) {
|
|
56
|
-
_inherits(Grid, _Component);
|
|
57
|
-
|
|
58
|
-
var _super = _createSuper(Grid);
|
|
59
|
-
|
|
60
|
-
function Grid(props) {
|
|
61
|
-
var _this;
|
|
62
|
-
|
|
63
|
-
_classCallCheck(this, Grid);
|
|
64
|
-
|
|
65
|
-
_this = _super.call(this, props);
|
|
66
|
-
window.blueGridRef = _assertThisInitialized(_this);
|
|
67
|
-
_this.defaultMatch = ["home"];
|
|
68
|
-
_this.state = {
|
|
69
|
-
sidebarIn: props.sidebarIn,
|
|
70
|
-
match: null,
|
|
71
|
-
history: [],
|
|
72
|
-
hash: window.location.hash,
|
|
73
|
-
hashHistory: [],
|
|
74
|
-
blockRouting: props.blockRouting || undefined
|
|
75
|
-
};
|
|
76
|
-
_this.hideSidebar = _this.hideSidebar.bind(_assertThisInitialized(_this));
|
|
77
|
-
_this.eventListeners = [];
|
|
78
|
-
return _this;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
_createClass(Grid, [{
|
|
82
|
-
key: "onHashChange",
|
|
83
|
-
value: function onHashChange(event) {
|
|
84
|
-
window.blueGridRef.initMatch();
|
|
85
|
-
}
|
|
86
|
-
}, {
|
|
87
|
-
key: "componentDidMount",
|
|
88
|
-
value: function componentDidMount() {
|
|
89
|
-
var _this2 = this;
|
|
90
|
-
|
|
91
|
-
var me = this;
|
|
92
|
-
document.addEventListener("toggleSidebar", function () {
|
|
93
|
-
_this2.toggleSidebar(undefined);
|
|
94
|
-
}, false);
|
|
95
|
-
this.initMatch();
|
|
96
|
-
document.addEventListener("touchstart", function (event) {
|
|
97
|
-
var xPos = event.touches[0].pageX;
|
|
98
|
-
|
|
99
|
-
if (xPos < 5) {
|
|
100
|
-
me.toggleSidebar(event);
|
|
101
|
-
} else if (me.state.sidebarIn && xPos > 20) {
|
|
102
|
-
me.toggleSidebar(event);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
window.addEventListener("hashchange", this.onHashChange);
|
|
106
|
-
}
|
|
107
|
-
}, {
|
|
108
|
-
key: "componentWillUnmount",
|
|
109
|
-
value: function componentWillUnmount() {
|
|
110
|
-
window.removeEventListener("hashchange", this.onHashChange);
|
|
111
|
-
}
|
|
112
|
-
}, {
|
|
113
|
-
key: "componentDidUpdate",
|
|
114
|
-
value: function componentDidUpdate(prevProps, prevState) {
|
|
115
|
-
var _this3 = this;
|
|
116
|
-
|
|
117
|
-
if (prevProps.blockRouting !== this.props.blockRouting && this.props.blockRouting !== this.state.blockRouting) {
|
|
118
|
-
this.setState({
|
|
119
|
-
blockRouting: this.props.blockRouting
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
this.eventListeners.forEach(function (eventListener) {
|
|
124
|
-
if (eventListener[0] === "componentDidUpdate") {
|
|
125
|
-
eventListener[1](prevProps, prevState);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (eventListener[0] === "pageDidShowAgain") {
|
|
129
|
-
var pageId = eventListener[1];
|
|
130
|
-
var callback = eventListener[2];
|
|
131
|
-
|
|
132
|
-
if (prevState.hash !== _this3.state.hash && _this3.state.match[0] === pageId) {
|
|
133
|
-
callback(prevProps, prevState);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
if (eventListener[0] === "pageDidHide") {
|
|
138
|
-
var _pageId = eventListener[1];
|
|
139
|
-
var _callback = eventListener[2];
|
|
140
|
-
|
|
141
|
-
if (prevState.hash !== _this3.state.hash && prevState.match[0] === _pageId) {
|
|
142
|
-
_callback(prevProps, prevState);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}, {
|
|
148
|
-
key: "toggleSidebar",
|
|
149
|
-
value: function toggleSidebar(event) {
|
|
150
|
-
if (this.state.sidebarIn) {
|
|
151
|
-
this.hideSidebar(event);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
this.setState({
|
|
155
|
-
sidebarIn: true
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
}, {
|
|
159
|
-
key: "hideSidebar",
|
|
160
|
-
value: function hideSidebar(e) {
|
|
161
|
-
if (!(_Utilities.default.hasClass(e.target, "blue-open-menu") || _Utilities.default.hasClass(e.target, "bi-menu") || _Utilities.default.hasClass(e.target, "blue-search") || _Utilities.default.hasClass(e.target, "blue-search-control") || _Utilities.default.hasClass(e.target, "blue-search-btn") || _Utilities.default.hasClass(e.target, "blue-search-btn-icon") || _Utilities.default.hasClass(e.target, "blue-sidebar-dropdown-toggle") || _Utilities.default.hasClass(e.target, "blue-sidebar-dropdown-caret") || _Utilities.default.hasClass(e.target, "blue-sidebar-dropdown-icon") || _Utilities.default.hasClass(e.target, "blue-sidebar-exception"))) {
|
|
162
|
-
this.setState({
|
|
163
|
-
sidebarIn: false
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}, {
|
|
168
|
-
key: "initMatch",
|
|
169
|
-
value: function initMatch() {
|
|
170
|
-
var newMatch;
|
|
171
|
-
|
|
172
|
-
if (window.location.hash && window.location.hash !== "" && window.location.hash !== "#/") {
|
|
173
|
-
newMatch = window.location.hash.replace("#", "").split("/").filter(function (n) {
|
|
174
|
-
return n !== "";
|
|
175
|
-
});
|
|
176
|
-
} else {
|
|
177
|
-
newMatch = this.defaultMatch;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
if (this.props.unrouteable) {
|
|
181
|
-
newMatch = this.defaultMatch;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
if (this.state.blockRouting && this.state.blockRouting(newMatch, this.state.match) === true) {
|
|
185
|
-
window.location.hash = this.state.hash;
|
|
186
|
-
} else {
|
|
187
|
-
if (!(this.state.history.indexOf(newMatch[0]) > -1)) {
|
|
188
|
-
this.state.history.push(newMatch[0]);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
this.setState({
|
|
192
|
-
match: newMatch,
|
|
193
|
-
history: this.state.history,
|
|
194
|
-
hash: window.location.hash,
|
|
195
|
-
hashHistory: this.state.hashHistory.concat([window.location.hash])
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}, {
|
|
200
|
-
key: "addEventListener",
|
|
201
|
-
value: function addEventListener(param1, param2, param3) {
|
|
202
|
-
this.eventListeners.push([param1, param2, param3]);
|
|
203
|
-
}
|
|
204
|
-
}, {
|
|
205
|
-
key: "render",
|
|
206
|
-
value: function render() {
|
|
207
|
-
var _this4 = this,
|
|
208
|
-
_this$props$pages;
|
|
209
|
-
|
|
210
|
-
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
211
|
-
className: "blue-wrapper"
|
|
212
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
213
|
-
id: this.props.id ? this.props.id : "",
|
|
214
|
-
style: this.props.style ? this.props.style : {},
|
|
215
|
-
className: "blue-layout" + (this.props.className ? " " + this.props.className : "") + (this.state.sidebarIn ? " open" : "") + (this.props.hideSidebarMenu ? " hasNoSidebarMenu" : " hasSidebarMenu") + (this.props.expandSidebar ? " expandSidebar" : "") + (this.props.disableHeaders ? " disableHeaders" : ""),
|
|
216
|
-
onClick: this.hideSidebar
|
|
217
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
218
|
-
className: "blue-sidebar-toggler"
|
|
219
|
-
}, !this.props.hideSidebarMenu ? /*#__PURE__*/_react.default.createElement("button", {
|
|
220
|
-
type: "button",
|
|
221
|
-
className: "blue-open-menu blue-sidebar-btn btn",
|
|
222
|
-
onClick: function onClick() {
|
|
223
|
-
_this4.setState({
|
|
224
|
-
sidebarIn: !_this4.state.sidebarIn
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
228
|
-
className: "blue-sidebar-exception position-absolute w-100 h-100"
|
|
229
|
-
}), this.props.sidebarToggleIconComponent) : ""), this.props.children, (_this$props$pages = this.props.pages) === null || _this$props$pages === void 0 ? void 0 : _this$props$pages.map(function (page) {
|
|
230
|
-
return _this4.state.history.indexOf(page.name) > -1 && /*#__PURE__*/_react.default.createElement("div", {
|
|
231
|
-
key: page.name,
|
|
232
|
-
className: "router-page " + (_this4.state.match[0] === page.name ? "active" : "")
|
|
233
|
-
}, page.component);
|
|
234
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
235
|
-
className: "blue-status-circle blue-loading blue-status-loading"
|
|
236
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
237
|
-
className: "spinner-bounce-circle"
|
|
238
|
-
}, /*#__PURE__*/_react.default.createElement("div", null), /*#__PURE__*/_react.default.createElement("div", null))), /*#__PURE__*/_react.default.createElement("div", {
|
|
239
|
-
className: "blue-status-circle blue-status-success"
|
|
240
|
-
}, this.props.statusIcons.success), /*#__PURE__*/_react.default.createElement("div", {
|
|
241
|
-
className: "blue-status-circle blue-status-info"
|
|
242
|
-
}, this.props.statusIcons.info), /*#__PURE__*/_react.default.createElement("div", {
|
|
243
|
-
className: "blue-status-circle blue-status-warning"
|
|
244
|
-
}, this.props.statusIcons.warning), /*#__PURE__*/_react.default.createElement("div", {
|
|
245
|
-
className: "blue-status-circle blue-status-danger"
|
|
246
|
-
}, this.props.statusIcons.danger), /*#__PURE__*/_react.default.createElement("div", {
|
|
247
|
-
className: "blue-status-alert alert"
|
|
248
|
-
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
249
|
-
type: "button",
|
|
250
|
-
className: "btn-close float-end mb-1",
|
|
251
|
-
"aria-label": "Close"
|
|
252
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
253
|
-
className: "alert-body"
|
|
254
|
-
}))));
|
|
255
|
-
}
|
|
256
|
-
}], [{
|
|
257
|
-
key: "defaultProps",
|
|
258
|
-
get: function get() {
|
|
259
|
-
return {
|
|
260
|
-
expandSidebar: false,
|
|
261
|
-
hideSidebarMenu: false,
|
|
262
|
-
unrouteable: false,
|
|
263
|
-
disableTitleSet: false,
|
|
264
|
-
sidebarToggleIconComponent: /*#__PURE__*/_react.default.createElement("span", {
|
|
265
|
-
className: "bi-menu"
|
|
266
|
-
}),
|
|
267
|
-
statusIcons: {
|
|
268
|
-
danger: /*#__PURE__*/_react.default.createElement("span", {
|
|
269
|
-
className: "bi-error"
|
|
270
|
-
}),
|
|
271
|
-
info: /*#__PURE__*/_react.default.createElement("span", {
|
|
272
|
-
className: "bi-information"
|
|
273
|
-
}),
|
|
274
|
-
success: /*#__PURE__*/_react.default.createElement("span", {
|
|
275
|
-
className: "bi-check"
|
|
276
|
-
}),
|
|
277
|
-
warning: /*#__PURE__*/_react.default.createElement("span", {
|
|
278
|
-
className: "bi-sign_warning"
|
|
279
|
-
})
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
}]);
|
|
284
|
-
|
|
285
|
-
return Grid;
|
|
286
|
-
}(_react.Component);
|
|
287
|
-
|
|
54
|
+
*/
|
|
55
|
+
var Grid = /*#__PURE__*/function (_Component) {
|
|
56
|
+
_inherits(Grid, _Component);
|
|
57
|
+
|
|
58
|
+
var _super = _createSuper(Grid);
|
|
59
|
+
|
|
60
|
+
function Grid(props) {
|
|
61
|
+
var _this;
|
|
62
|
+
|
|
63
|
+
_classCallCheck(this, Grid);
|
|
64
|
+
|
|
65
|
+
_this = _super.call(this, props);
|
|
66
|
+
window.blueGridRef = _assertThisInitialized(_this);
|
|
67
|
+
_this.defaultMatch = ["home"];
|
|
68
|
+
_this.state = {
|
|
69
|
+
sidebarIn: props.sidebarIn,
|
|
70
|
+
match: null,
|
|
71
|
+
history: [],
|
|
72
|
+
hash: window.location.hash,
|
|
73
|
+
hashHistory: [],
|
|
74
|
+
blockRouting: props.blockRouting || undefined
|
|
75
|
+
};
|
|
76
|
+
_this.hideSidebar = _this.hideSidebar.bind(_assertThisInitialized(_this));
|
|
77
|
+
_this.eventListeners = [];
|
|
78
|
+
return _this;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
_createClass(Grid, [{
|
|
82
|
+
key: "onHashChange",
|
|
83
|
+
value: function onHashChange(event) {
|
|
84
|
+
window.blueGridRef.initMatch();
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
key: "componentDidMount",
|
|
88
|
+
value: function componentDidMount() {
|
|
89
|
+
var _this2 = this;
|
|
90
|
+
|
|
91
|
+
var me = this;
|
|
92
|
+
document.addEventListener("toggleSidebar", function () {
|
|
93
|
+
_this2.toggleSidebar(undefined);
|
|
94
|
+
}, false);
|
|
95
|
+
this.initMatch();
|
|
96
|
+
document.addEventListener("touchstart", function (event) {
|
|
97
|
+
var xPos = event.touches[0].pageX;
|
|
98
|
+
|
|
99
|
+
if (xPos < 5) {
|
|
100
|
+
me.toggleSidebar(event);
|
|
101
|
+
} else if (me.state.sidebarIn && xPos > 20) {
|
|
102
|
+
me.toggleSidebar(event);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
window.addEventListener("hashchange", this.onHashChange);
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
key: "componentWillUnmount",
|
|
109
|
+
value: function componentWillUnmount() {
|
|
110
|
+
window.removeEventListener("hashchange", this.onHashChange);
|
|
111
|
+
}
|
|
112
|
+
}, {
|
|
113
|
+
key: "componentDidUpdate",
|
|
114
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
115
|
+
var _this3 = this;
|
|
116
|
+
|
|
117
|
+
if (prevProps.blockRouting !== this.props.blockRouting && this.props.blockRouting !== this.state.blockRouting) {
|
|
118
|
+
this.setState({
|
|
119
|
+
blockRouting: this.props.blockRouting
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
this.eventListeners.forEach(function (eventListener) {
|
|
124
|
+
if (eventListener[0] === "componentDidUpdate") {
|
|
125
|
+
eventListener[1](prevProps, prevState);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (eventListener[0] === "pageDidShowAgain") {
|
|
129
|
+
var pageId = eventListener[1];
|
|
130
|
+
var callback = eventListener[2];
|
|
131
|
+
|
|
132
|
+
if (prevState.hash !== _this3.state.hash && _this3.state.match[0] === pageId) {
|
|
133
|
+
callback(prevProps, prevState);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (eventListener[0] === "pageDidHide") {
|
|
138
|
+
var _pageId = eventListener[1];
|
|
139
|
+
var _callback = eventListener[2];
|
|
140
|
+
|
|
141
|
+
if (prevState.hash !== _this3.state.hash && prevState.match[0] === _pageId) {
|
|
142
|
+
_callback(prevProps, prevState);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}, {
|
|
148
|
+
key: "toggleSidebar",
|
|
149
|
+
value: function toggleSidebar(event) {
|
|
150
|
+
if (this.state.sidebarIn) {
|
|
151
|
+
this.hideSidebar(event);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
this.setState({
|
|
155
|
+
sidebarIn: true
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}, {
|
|
159
|
+
key: "hideSidebar",
|
|
160
|
+
value: function hideSidebar(e) {
|
|
161
|
+
if (!(_Utilities.default.hasClass(e.target, "blue-open-menu") || _Utilities.default.hasClass(e.target, "bi-menu") || _Utilities.default.hasClass(e.target, "blue-search") || _Utilities.default.hasClass(e.target, "blue-search-control") || _Utilities.default.hasClass(e.target, "blue-search-btn") || _Utilities.default.hasClass(e.target, "blue-search-btn-icon") || _Utilities.default.hasClass(e.target, "blue-sidebar-dropdown-toggle") || _Utilities.default.hasClass(e.target, "blue-sidebar-dropdown-caret") || _Utilities.default.hasClass(e.target, "blue-sidebar-dropdown-icon") || _Utilities.default.hasClass(e.target, "blue-sidebar-exception"))) {
|
|
162
|
+
this.setState({
|
|
163
|
+
sidebarIn: false
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}, {
|
|
168
|
+
key: "initMatch",
|
|
169
|
+
value: function initMatch() {
|
|
170
|
+
var newMatch;
|
|
171
|
+
|
|
172
|
+
if (window.location.hash && window.location.hash !== "" && window.location.hash !== "#/") {
|
|
173
|
+
newMatch = window.location.hash.replace("#", "").split("/").filter(function (n) {
|
|
174
|
+
return n !== "";
|
|
175
|
+
});
|
|
176
|
+
} else {
|
|
177
|
+
newMatch = this.defaultMatch;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (this.props.unrouteable) {
|
|
181
|
+
newMatch = this.defaultMatch;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (this.state.blockRouting && this.state.blockRouting(newMatch, this.state.match) === true) {
|
|
185
|
+
window.location.hash = this.state.hash;
|
|
186
|
+
} else {
|
|
187
|
+
if (!(this.state.history.indexOf(newMatch[0]) > -1)) {
|
|
188
|
+
this.state.history.push(newMatch[0]);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
this.setState({
|
|
192
|
+
match: newMatch,
|
|
193
|
+
history: this.state.history,
|
|
194
|
+
hash: window.location.hash,
|
|
195
|
+
hashHistory: this.state.hashHistory.concat([window.location.hash])
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}, {
|
|
200
|
+
key: "addEventListener",
|
|
201
|
+
value: function addEventListener(param1, param2, param3) {
|
|
202
|
+
this.eventListeners.push([param1, param2, param3]);
|
|
203
|
+
}
|
|
204
|
+
}, {
|
|
205
|
+
key: "render",
|
|
206
|
+
value: function render() {
|
|
207
|
+
var _this4 = this,
|
|
208
|
+
_this$props$pages;
|
|
209
|
+
|
|
210
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
211
|
+
className: "blue-wrapper"
|
|
212
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
213
|
+
id: this.props.id ? this.props.id : "",
|
|
214
|
+
style: this.props.style ? this.props.style : {},
|
|
215
|
+
className: "blue-layout" + (this.props.className ? " " + this.props.className : "") + (this.state.sidebarIn ? " open" : "") + (this.props.hideSidebarMenu ? " hasNoSidebarMenu" : " hasSidebarMenu") + (this.props.expandSidebar ? " expandSidebar" : "") + (this.props.disableHeaders ? " disableHeaders" : ""),
|
|
216
|
+
onClick: this.hideSidebar
|
|
217
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
218
|
+
className: "blue-sidebar-toggler"
|
|
219
|
+
}, !this.props.hideSidebarMenu ? /*#__PURE__*/_react.default.createElement("button", {
|
|
220
|
+
type: "button",
|
|
221
|
+
className: "blue-open-menu blue-sidebar-btn btn",
|
|
222
|
+
onClick: function onClick() {
|
|
223
|
+
_this4.setState({
|
|
224
|
+
sidebarIn: !_this4.state.sidebarIn
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
228
|
+
className: "blue-sidebar-exception position-absolute w-100 h-100"
|
|
229
|
+
}), this.props.sidebarToggleIconComponent) : ""), this.props.children, (_this$props$pages = this.props.pages) === null || _this$props$pages === void 0 ? void 0 : _this$props$pages.map(function (page) {
|
|
230
|
+
return _this4.state.history.indexOf(page.name) > -1 && /*#__PURE__*/_react.default.createElement("div", {
|
|
231
|
+
key: page.name,
|
|
232
|
+
className: "router-page " + (_this4.state.match[0] === page.name ? "active" : "")
|
|
233
|
+
}, page.component);
|
|
234
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
235
|
+
className: "blue-status-circle blue-loading blue-status-loading"
|
|
236
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
237
|
+
className: "spinner-bounce-circle"
|
|
238
|
+
}, /*#__PURE__*/_react.default.createElement("div", null), /*#__PURE__*/_react.default.createElement("div", null))), /*#__PURE__*/_react.default.createElement("div", {
|
|
239
|
+
className: "blue-status-circle blue-status-success"
|
|
240
|
+
}, this.props.statusIcons.success), /*#__PURE__*/_react.default.createElement("div", {
|
|
241
|
+
className: "blue-status-circle blue-status-info"
|
|
242
|
+
}, this.props.statusIcons.info), /*#__PURE__*/_react.default.createElement("div", {
|
|
243
|
+
className: "blue-status-circle blue-status-warning"
|
|
244
|
+
}, this.props.statusIcons.warning), /*#__PURE__*/_react.default.createElement("div", {
|
|
245
|
+
className: "blue-status-circle blue-status-danger"
|
|
246
|
+
}, this.props.statusIcons.danger), /*#__PURE__*/_react.default.createElement("div", {
|
|
247
|
+
className: "blue-status-alert alert"
|
|
248
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
249
|
+
type: "button",
|
|
250
|
+
className: "btn-close float-end mb-1",
|
|
251
|
+
"aria-label": "Close"
|
|
252
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
253
|
+
className: "alert-body"
|
|
254
|
+
}))));
|
|
255
|
+
}
|
|
256
|
+
}], [{
|
|
257
|
+
key: "defaultProps",
|
|
258
|
+
get: function get() {
|
|
259
|
+
return {
|
|
260
|
+
expandSidebar: false,
|
|
261
|
+
hideSidebarMenu: false,
|
|
262
|
+
unrouteable: false,
|
|
263
|
+
disableTitleSet: false,
|
|
264
|
+
sidebarToggleIconComponent: /*#__PURE__*/_react.default.createElement("span", {
|
|
265
|
+
className: "bi-menu"
|
|
266
|
+
}),
|
|
267
|
+
statusIcons: {
|
|
268
|
+
danger: /*#__PURE__*/_react.default.createElement("span", {
|
|
269
|
+
className: "bi-error"
|
|
270
|
+
}),
|
|
271
|
+
info: /*#__PURE__*/_react.default.createElement("span", {
|
|
272
|
+
className: "bi-information"
|
|
273
|
+
}),
|
|
274
|
+
success: /*#__PURE__*/_react.default.createElement("span", {
|
|
275
|
+
className: "bi-check"
|
|
276
|
+
}),
|
|
277
|
+
warning: /*#__PURE__*/_react.default.createElement("span", {
|
|
278
|
+
className: "bi-sign_warning"
|
|
279
|
+
})
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
}]);
|
|
284
|
+
|
|
285
|
+
return Grid;
|
|
286
|
+
}(_react.Component);
|
|
287
|
+
|
|
288
288
|
exports.default = Grid;
|
|
@@ -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;
|
|
@@ -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
|
@@ -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
|
-
* Can be used for a sign-in page.
|
|
12
|
+
/**
|
|
13
|
+
* Can be used for a sign-in page.
|
|
14
14
|
*/
|
|
15
15
|
function Intro(_ref) {
|
|
16
16
|
var logo = _ref.logo,
|