blue-react 8.8.1 → 9.0.0-alpha1
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/dist/components/ActionMenu.js +109 -98
- package/dist/components/ActionMenuSwitch.js +55 -44
- package/dist/components/Body.js +50 -38
- package/dist/components/Caret.js +32 -19
- package/dist/components/DocumentView.js +88 -76
- package/dist/components/Header.js +34 -22
- package/dist/components/HeaderTitle.js +66 -54
- package/dist/components/Intro.js +48 -35
- package/dist/components/Layout.js +295 -283
- package/dist/components/MenuItem.js +139 -130
- package/dist/components/Modal.js +173 -164
- package/dist/components/ModalProvider.js +195 -184
- package/dist/components/Outside.js +63 -50
- package/dist/components/Page.js +74 -62
- package/dist/components/Search.js +168 -157
- package/dist/components/SidebarMenu.js +69 -56
- package/dist/components/SlimContainer.js +34 -21
- package/dist/components/Status.js +76 -64
- package/dist/components/StatusProvider.js +79 -68
- package/dist/components/Switch.js +70 -57
- package/dist/components/Utilities.js +192 -178
- package/dist/components/shared.js +37 -23
- package/dist/style.css +10 -139
- package/dist/style.min.css +4 -4
- package/dist/style.scss +7 -8
- package/dist/styles/_action-menu.scss +1 -1
- package/dist/styles/_bootstrap-optimizations.scss +0 -8
- package/dist/styles/_caret.scss +3 -3
- package/dist/styles/_general.scss +0 -17
- package/dist/styles/_layout.scss +1 -1
- package/dist/styles/mixins/_sidebar.scss +1 -1
- package/package.json +3 -3
- package/dist/styles/_switch.scss +0 -21
|
@@ -1,333 +1,345 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
(function (global, factory) {
|
|
4
|
+
if (typeof define === "function" && define.amd) {
|
|
5
|
+
define(["exports", "react", "./Utilities"], factory);
|
|
6
|
+
} else if (typeof exports !== "undefined") {
|
|
7
|
+
factory(exports, require("react"), require("./Utilities"));
|
|
8
|
+
} else {
|
|
9
|
+
var mod = {
|
|
10
|
+
exports: {}
|
|
11
|
+
};
|
|
12
|
+
factory(mod.exports, global.react, global.Utilities);
|
|
13
|
+
global.Layout = mod.exports;
|
|
14
|
+
}
|
|
15
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _react, _Utilities) {
|
|
16
|
+
"use strict";
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
Object.defineProperty(_exports, "__esModule", {
|
|
19
|
+
value: true
|
|
20
|
+
});
|
|
21
|
+
_exports.default = void 0;
|
|
22
|
+
_react = _interopRequireWildcard(_react);
|
|
23
|
+
_Utilities = _interopRequireDefault(_Utilities);
|
|
15
24
|
|
|
16
|
-
function
|
|
25
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
26
|
|
|
18
|
-
function
|
|
27
|
+
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); }
|
|
19
28
|
|
|
20
|
-
function
|
|
29
|
+
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; }
|
|
21
30
|
|
|
22
|
-
function
|
|
31
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23
32
|
|
|
24
|
-
function
|
|
33
|
+
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); } }
|
|
25
34
|
|
|
26
|
-
function
|
|
35
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
27
36
|
|
|
28
|
-
function
|
|
37
|
+
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
29
38
|
|
|
30
|
-
function
|
|
39
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
31
40
|
|
|
32
|
-
function
|
|
41
|
+
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); }; }
|
|
33
42
|
|
|
34
|
-
function
|
|
43
|
+
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); }
|
|
35
44
|
|
|
36
|
-
function
|
|
45
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
37
46
|
|
|
38
|
-
function
|
|
47
|
+
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; } }
|
|
39
48
|
|
|
40
|
-
|
|
49
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
41
50
|
|
|
42
|
-
|
|
43
|
-
* The main component. As soon this component is mounted, it is globally available under `window.blueLayoutRef`.
|
|
44
|
-
* You can also append your own event listeners.
|
|
45
|
-
*
|
|
46
|
-
* Allowed events:
|
|
47
|
-
*
|
|
48
|
-
* * **componentDidUpdate** - Component was updated.
|
|
49
|
-
* Example: `window.blueLayoutRef.addEventListener("componentDidUpdate", (prevProps, prevState) => { })`
|
|
50
|
-
* * **pageDidShowAgain** - Page appeared again with the same old state. In the callback function you can reinitialize things.
|
|
51
|
-
* Example: `window.blueLayoutRef.addEventListener("pageDidShowAgain", "home", (prevProps, prevState) => { })`
|
|
52
|
-
* * **pageDidHide** - This page disappeared and another page appears instead.
|
|
53
|
-
* Example: `window.blueLayoutRef.addEventListener("pageDidHide", "home", (prevProps, prevState) => { })`
|
|
54
|
-
*
|
|
55
|
-
* Method to add event listeners:
|
|
56
|
-
* * `window.blueLayoutRef.`**addEventListener**`(eventName: string, param2: any, param3: any, listenerId?: string)`
|
|
57
|
-
*
|
|
58
|
-
* Methods to remove event listeners:
|
|
59
|
-
* * `window.blueLayoutRef.`**removeEventListener**`(eventName: string, listenerId: string)`
|
|
60
|
-
* * `window.blueLayoutRef.`**removeDuplicatedEventListeners**`()` - Will automatically be called when running `addEventListener`
|
|
61
|
-
*/
|
|
62
|
-
var Layout = /*#__PURE__*/function (_Component) {
|
|
63
|
-
_inherits(Layout, _Component);
|
|
51
|
+
window.toggleSidebarEvent = new CustomEvent("toggleSidebar");
|
|
64
52
|
|
|
65
|
-
|
|
53
|
+
/**
|
|
54
|
+
* The main component. As soon this component is mounted, it is globally available under `window.blueLayoutRef`.
|
|
55
|
+
* You can also append your own event listeners.
|
|
56
|
+
*
|
|
57
|
+
* Allowed events:
|
|
58
|
+
*
|
|
59
|
+
* * **componentDidUpdate** - Component was updated.
|
|
60
|
+
* Example: `window.blueLayoutRef.addEventListener("componentDidUpdate", (prevProps, prevState) => { })`
|
|
61
|
+
* * **pageDidShowAgain** - Page appeared again with the same old state. In the callback function you can reinitialize things.
|
|
62
|
+
* Example: `window.blueLayoutRef.addEventListener("pageDidShowAgain", "home", (prevProps, prevState) => { })`
|
|
63
|
+
* * **pageDidHide** - This page disappeared and another page appears instead.
|
|
64
|
+
* Example: `window.blueLayoutRef.addEventListener("pageDidHide", "home", (prevProps, prevState) => { })`
|
|
65
|
+
*
|
|
66
|
+
* Method to add event listeners:
|
|
67
|
+
* * `window.blueLayoutRef.`**addEventListener**`(eventName: string, param2: any, param3: any, listenerId?: string)`
|
|
68
|
+
*
|
|
69
|
+
* Methods to remove event listeners:
|
|
70
|
+
* * `window.blueLayoutRef.`**removeEventListener**`(eventName: string, listenerId: string)`
|
|
71
|
+
* * `window.blueLayoutRef.`**removeDuplicatedEventListeners**`()` - Will automatically be called when running `addEventListener`
|
|
72
|
+
*/
|
|
73
|
+
var Layout = /*#__PURE__*/function (_Component) {
|
|
74
|
+
_inherits(Layout, _Component);
|
|
66
75
|
|
|
67
|
-
|
|
68
|
-
var _this;
|
|
76
|
+
var _super = _createSuper(Layout);
|
|
69
77
|
|
|
70
|
-
|
|
78
|
+
function Layout(props) {
|
|
79
|
+
var _this;
|
|
71
80
|
|
|
72
|
-
|
|
73
|
-
window.blueLayoutRef = _assertThisInitialized(_this);
|
|
74
|
-
_this.defaultMatch = ["home"];
|
|
75
|
-
_this.state = {
|
|
76
|
-
sidebarIn: props.sidebarIn || false,
|
|
77
|
-
match: null,
|
|
78
|
-
history: [],
|
|
79
|
-
hash: window.location.hash,
|
|
80
|
-
hashHistory: [],
|
|
81
|
-
blockRouting: props.blockRouting || undefined
|
|
82
|
-
};
|
|
83
|
-
_this.hideSidebar = _this.hideSidebar.bind(_assertThisInitialized(_this));
|
|
84
|
-
_this.eventListeners = [];
|
|
85
|
-
return _this;
|
|
86
|
-
}
|
|
81
|
+
_classCallCheck(this, Layout);
|
|
87
82
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
this.initMatch();
|
|
103
|
-
document.addEventListener("touchstart", function (event) {
|
|
104
|
-
var xPos = event.touches[0].pageX;
|
|
105
|
-
|
|
106
|
-
if (xPos < 5) {
|
|
107
|
-
me.toggleSidebar(event);
|
|
108
|
-
} else if (me.state.sidebarIn && xPos > 20) {
|
|
109
|
-
me.toggleSidebar(event);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
window.addEventListener("hashchange", this.onHashChange);
|
|
113
|
-
}
|
|
114
|
-
}, {
|
|
115
|
-
key: "componentWillUnmount",
|
|
116
|
-
value: function componentWillUnmount() {
|
|
117
|
-
window.removeEventListener("hashchange", this.onHashChange);
|
|
83
|
+
_this = _super.call(this, props);
|
|
84
|
+
window.blueLayoutRef = _assertThisInitialized(_this);
|
|
85
|
+
_this.defaultMatch = ["home"];
|
|
86
|
+
_this.state = {
|
|
87
|
+
sidebarIn: props.sidebarIn || false,
|
|
88
|
+
match: null,
|
|
89
|
+
history: [],
|
|
90
|
+
hash: window.location.hash,
|
|
91
|
+
hashHistory: [],
|
|
92
|
+
blockRouting: props.blockRouting || undefined
|
|
93
|
+
};
|
|
94
|
+
_this.hideSidebar = _this.hideSidebar.bind(_assertThisInitialized(_this));
|
|
95
|
+
_this.eventListeners = [];
|
|
96
|
+
return _this;
|
|
118
97
|
}
|
|
119
|
-
}, {
|
|
120
|
-
key: "componentDidUpdate",
|
|
121
|
-
value: function componentDidUpdate(prevProps, prevState) {
|
|
122
|
-
var _this3 = this;
|
|
123
98
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
99
|
+
_createClass(Layout, [{
|
|
100
|
+
key: "onHashChange",
|
|
101
|
+
value: function onHashChange() {
|
|
102
|
+
window.blueLayoutRef.initMatch();
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
key: "componentDidMount",
|
|
106
|
+
value: function componentDidMount() {
|
|
107
|
+
var _this2 = this;
|
|
108
|
+
|
|
109
|
+
var me = this;
|
|
110
|
+
document.addEventListener("toggleSidebar", function () {
|
|
111
|
+
_this2.toggleSidebar(undefined);
|
|
112
|
+
}, false);
|
|
113
|
+
this.initMatch();
|
|
114
|
+
document.addEventListener("touchstart", function (event) {
|
|
115
|
+
var xPos = event.touches[0].pageX;
|
|
116
|
+
|
|
117
|
+
if (xPos < 5) {
|
|
118
|
+
me.toggleSidebar(event);
|
|
119
|
+
} else if (me.state.sidebarIn && xPos > 20) {
|
|
120
|
+
me.toggleSidebar(event);
|
|
121
|
+
}
|
|
127
122
|
});
|
|
123
|
+
window.addEventListener("hashchange", this.onHashChange);
|
|
128
124
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
125
|
+
}, {
|
|
126
|
+
key: "componentWillUnmount",
|
|
127
|
+
value: function componentWillUnmount() {
|
|
128
|
+
window.removeEventListener("hashchange", this.onHashChange);
|
|
132
129
|
}
|
|
130
|
+
}, {
|
|
131
|
+
key: "componentDidUpdate",
|
|
132
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
133
|
+
var _this3 = this;
|
|
134
|
+
|
|
135
|
+
if (prevProps.sidebarIn !== this.props.sidebarIn) {
|
|
136
|
+
this.setState({
|
|
137
|
+
sidebarIn: this.props.sidebarIn || false
|
|
138
|
+
});
|
|
139
|
+
}
|
|
133
140
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
});
|
|
138
|
-
}
|
|
141
|
+
if (this.props.onChangeSidebarIn && prevState.sidebarIn !== this.state.sidebarIn) {
|
|
142
|
+
this.props.onChangeSidebarIn(this.state.sidebarIn);
|
|
143
|
+
}
|
|
139
144
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
if (prevProps.blockRouting !== this.props.blockRouting && this.props.blockRouting !== this.state.blockRouting) {
|
|
146
|
+
this.setState({
|
|
147
|
+
blockRouting: this.props.blockRouting
|
|
148
|
+
});
|
|
143
149
|
}
|
|
144
150
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
151
|
+
this.eventListeners.forEach(function (eventListener) {
|
|
152
|
+
if (eventListener[0] === "componentDidUpdate") {
|
|
153
|
+
eventListener[1](prevProps, prevState);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (eventListener[0] === "pageDidShowAgain") {
|
|
157
|
+
var pageId = eventListener[1];
|
|
158
|
+
var callback = eventListener[2];
|
|
148
159
|
|
|
149
|
-
|
|
150
|
-
|
|
160
|
+
if (prevState.hash !== _this3.state.hash && _this3.state.match[0] === pageId) {
|
|
161
|
+
callback(prevProps, prevState);
|
|
162
|
+
}
|
|
151
163
|
}
|
|
152
|
-
}
|
|
153
164
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
165
|
+
if (eventListener[0] === "pageDidHide") {
|
|
166
|
+
var _pageId = eventListener[1];
|
|
167
|
+
var _callback = eventListener[2];
|
|
157
168
|
|
|
158
|
-
|
|
159
|
-
|
|
169
|
+
if (prevState.hash !== _this3.state.hash && prevState.match[0] === _pageId) {
|
|
170
|
+
_callback(prevProps, prevState);
|
|
171
|
+
}
|
|
160
172
|
}
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
}, {
|
|
165
|
-
key: "toggleSidebar",
|
|
166
|
-
value: function toggleSidebar(event) {
|
|
167
|
-
if (this.state.sidebarIn) {
|
|
168
|
-
this.hideSidebar(event);
|
|
173
|
+
});
|
|
169
174
|
}
|
|
175
|
+
}, {
|
|
176
|
+
key: "toggleSidebar",
|
|
177
|
+
value: function toggleSidebar(event) {
|
|
178
|
+
if (this.state.sidebarIn) {
|
|
179
|
+
this.hideSidebar(event);
|
|
180
|
+
}
|
|
170
181
|
|
|
171
|
-
this.setState({
|
|
172
|
-
sidebarIn: true
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
}, {
|
|
176
|
-
key: "hideSidebar",
|
|
177
|
-
value: function hideSidebar(e) {
|
|
178
|
-
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-menu-item-dropdown-toggle") || _Utilities.default.hasClass(e.target, "blue-menu-item-dropdown-caret") || _Utilities.default.hasClass(e.target, "blue-menu-item-dropdown-icon") || _Utilities.default.hasClass(e.target, "blue-sidebar-exception"))) {
|
|
179
182
|
this.setState({
|
|
180
|
-
sidebarIn:
|
|
183
|
+
sidebarIn: true
|
|
181
184
|
});
|
|
182
185
|
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
return n !== "";
|
|
192
|
-
});
|
|
193
|
-
} else {
|
|
194
|
-
newMatch = this.defaultMatch;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if (this.props.unrouteable) {
|
|
198
|
-
newMatch = this.defaultMatch;
|
|
186
|
+
}, {
|
|
187
|
+
key: "hideSidebar",
|
|
188
|
+
value: function hideSidebar(e) {
|
|
189
|
+
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-menu-item-dropdown-toggle") || _Utilities.default.hasClass(e.target, "blue-menu-item-dropdown-caret") || _Utilities.default.hasClass(e.target, "blue-menu-item-dropdown-icon") || _Utilities.default.hasClass(e.target, "blue-sidebar-exception"))) {
|
|
190
|
+
this.setState({
|
|
191
|
+
sidebarIn: false
|
|
192
|
+
});
|
|
193
|
+
}
|
|
199
194
|
}
|
|
195
|
+
}, {
|
|
196
|
+
key: "initMatch",
|
|
197
|
+
value: function initMatch() {
|
|
198
|
+
var newMatch;
|
|
199
|
+
|
|
200
|
+
if (window.location.hash && window.location.hash !== "" && window.location.hash !== "#/") {
|
|
201
|
+
newMatch = window.location.hash.replace("#", "").split("/").filter(function (n) {
|
|
202
|
+
return n !== "";
|
|
203
|
+
});
|
|
204
|
+
} else {
|
|
205
|
+
newMatch = this.defaultMatch;
|
|
206
|
+
}
|
|
200
207
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
} else {
|
|
204
|
-
if (!(this.state.history.indexOf(newMatch[0]) > -1)) {
|
|
205
|
-
this.state.history.push(newMatch[0]);
|
|
208
|
+
if (this.props.unrouteable) {
|
|
209
|
+
newMatch = this.defaultMatch;
|
|
206
210
|
}
|
|
207
211
|
|
|
208
|
-
this.
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
}, {
|
|
223
|
-
key: "removeEventListener",
|
|
224
|
-
value: function removeEventListener(type, listenerId) {
|
|
225
|
-
this.eventListeners = this.eventListeners.filter(function (param) {
|
|
226
|
-
if (param[0] !== type) {
|
|
227
|
-
return param;
|
|
228
|
-
} else if (param[0] === type && param[3] !== listenerId) {
|
|
229
|
-
return param;
|
|
212
|
+
if (this.state.blockRouting && this.state.blockRouting(newMatch, this.state.match) === true) {
|
|
213
|
+
window.location.hash = this.state.hash;
|
|
214
|
+
} else {
|
|
215
|
+
if (!(this.state.history.indexOf(newMatch[0]) > -1)) {
|
|
216
|
+
this.state.history.push(newMatch[0]);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
this.setState({
|
|
220
|
+
match: newMatch,
|
|
221
|
+
history: this.state.history,
|
|
222
|
+
hash: window.location.hash,
|
|
223
|
+
hashHistory: this.state.hashHistory.concat([window.location.hash])
|
|
224
|
+
});
|
|
230
225
|
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
226
|
+
}
|
|
227
|
+
}, {
|
|
228
|
+
key: "addEventListener",
|
|
229
|
+
value: function addEventListener(param1, param2, param3, listenerId) {
|
|
230
|
+
this.eventListeners.push([param1, param2, param3, listenerId]);
|
|
231
|
+
this.removeDuplicatedEventListeners();
|
|
232
|
+
}
|
|
233
|
+
}, {
|
|
234
|
+
key: "removeEventListener",
|
|
235
|
+
value: function removeEventListener(type, listenerId) {
|
|
236
|
+
this.eventListeners = this.eventListeners.filter(function (param) {
|
|
237
|
+
if (param[0] !== type) {
|
|
238
|
+
return param;
|
|
239
|
+
} else if (param[0] === type && param[3] !== listenerId) {
|
|
240
|
+
return param;
|
|
241
|
+
}
|
|
239
242
|
});
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
249
|
-
className: "blue-wrapper"
|
|
250
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
251
|
-
id: this.props.id ? this.props.id : "",
|
|
252
|
-
style: this.props.style ? this.props.style : {},
|
|
253
|
-
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" : ""),
|
|
254
|
-
onClick: this.hideSidebar
|
|
255
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
256
|
-
className: "blue-sidebar-toggler"
|
|
257
|
-
}, !this.props.hideSidebarMenu ? /*#__PURE__*/_react.default.createElement("button", {
|
|
258
|
-
type: "button",
|
|
259
|
-
className: "blue-open-menu blue-menu-item btn",
|
|
260
|
-
onClick: function onClick() {
|
|
261
|
-
_this4.setState({
|
|
262
|
-
sidebarIn: !_this4.state.sidebarIn
|
|
243
|
+
}
|
|
244
|
+
}, {
|
|
245
|
+
key: "removeDuplicatedEventListeners",
|
|
246
|
+
value: function removeDuplicatedEventListeners() {
|
|
247
|
+
this.eventListeners = this.eventListeners.filter(function (value, index, self) {
|
|
248
|
+
return index === self.findIndex(function (t) {
|
|
249
|
+
return t[3] === value[3] && t[0] === value[0];
|
|
263
250
|
});
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
"
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}, {
|
|
254
|
+
key: "render",
|
|
255
|
+
value: function render() {
|
|
256
|
+
var _this4 = this,
|
|
257
|
+
_this$props$pages;
|
|
258
|
+
|
|
259
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
260
|
+
className: "blue-wrapper"
|
|
261
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
262
|
+
id: this.props.id ? this.props.id : "",
|
|
263
|
+
style: this.props.style ? this.props.style : {},
|
|
264
|
+
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" : ""),
|
|
265
|
+
onClick: this.hideSidebar
|
|
266
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
267
|
+
className: "blue-sidebar-toggler"
|
|
268
|
+
}, !this.props.hideSidebarMenu ? /*#__PURE__*/_react.default.createElement("button", {
|
|
269
|
+
type: "button",
|
|
270
|
+
className: "blue-open-menu blue-menu-item btn",
|
|
271
|
+
onClick: function onClick() {
|
|
272
|
+
_this4.setState({
|
|
273
|
+
sidebarIn: !_this4.state.sidebarIn
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
277
|
+
className: "blue-sidebar-exception position-absolute w-100 h-100"
|
|
278
|
+
}), 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) {
|
|
279
|
+
return _this4.state.history.indexOf(page.name) > -1 && /*#__PURE__*/_react.default.createElement("div", {
|
|
280
|
+
key: page.name,
|
|
281
|
+
className: "router-page " + (_this4.state.match[0] === page.name ? "active" : "")
|
|
282
|
+
}, page.component);
|
|
283
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
284
|
+
className: "blue-status-circle blue-loading blue-status-loading"
|
|
285
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
286
|
+
className: "spinner-bounce-circle"
|
|
287
|
+
}, /*#__PURE__*/_react.default.createElement("div", null), /*#__PURE__*/_react.default.createElement("div", null))), /*#__PURE__*/_react.default.createElement("div", {
|
|
288
|
+
className: "blue-status-circle blue-status-success"
|
|
289
|
+
}, this.props.statusIcons.success), /*#__PURE__*/_react.default.createElement("div", {
|
|
290
|
+
className: "blue-status-circle blue-status-info"
|
|
291
|
+
}, this.props.statusIcons.info), /*#__PURE__*/_react.default.createElement("div", {
|
|
292
|
+
className: "blue-status-circle blue-status-warning"
|
|
293
|
+
}, this.props.statusIcons.warning), /*#__PURE__*/_react.default.createElement("div", {
|
|
294
|
+
className: "blue-status-circle blue-status-danger"
|
|
295
|
+
}, this.props.statusIcons.danger), /*#__PURE__*/_react.default.createElement("div", {
|
|
296
|
+
className: "blue-status-alert alert"
|
|
297
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
298
|
+
type: "button",
|
|
299
|
+
className: "btn-close float-end mb-1",
|
|
300
|
+
"aria-label": "Close"
|
|
301
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
302
|
+
className: "alert-body"
|
|
303
|
+
}))));
|
|
304
|
+
}
|
|
305
|
+
}], [{
|
|
306
|
+
key: "defaultProps",
|
|
307
|
+
get: function get() {
|
|
308
|
+
return {
|
|
309
|
+
expandSidebar: false,
|
|
310
|
+
hideSidebarMenu: false,
|
|
311
|
+
unrouteable: false,
|
|
312
|
+
disableTitleSet: false,
|
|
313
|
+
sidebarToggleIconComponent: /*#__PURE__*/_react.default.createElement("svg", {
|
|
314
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
315
|
+
width: "1em",
|
|
316
|
+
height: "1em",
|
|
317
|
+
fill: "currentColor",
|
|
318
|
+
viewBox: "0 0 16 16"
|
|
319
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
320
|
+
fillRule: "evenodd",
|
|
321
|
+
d: "M2.5 12a.5.5 0 01.5-.5h10a.5.5 0 010 1H3a.5.5 0 01-.5-.5zm0-4a.5.5 0 01.5-.5h10a.5.5 0 010 1H3a.5.5 0 01-.5-.5zm0-4a.5.5 0 01.5-.5h10a.5.5 0 010 1H3a.5.5 0 01-.5-.5z"
|
|
322
|
+
})),
|
|
323
|
+
statusIcons: {
|
|
324
|
+
danger: /*#__PURE__*/_react.default.createElement("span", {
|
|
325
|
+
className: "bi-error"
|
|
326
|
+
}),
|
|
327
|
+
info: /*#__PURE__*/_react.default.createElement("span", {
|
|
328
|
+
className: "bi-information"
|
|
329
|
+
}),
|
|
330
|
+
success: /*#__PURE__*/_react.default.createElement("span", {
|
|
331
|
+
className: "bi-check"
|
|
332
|
+
}),
|
|
333
|
+
warning: /*#__PURE__*/_react.default.createElement("span", {
|
|
334
|
+
className: "bi-sign_warning"
|
|
335
|
+
})
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
}]);
|
|
329
340
|
|
|
330
|
-
|
|
331
|
-
}(_react.Component);
|
|
341
|
+
return Layout;
|
|
342
|
+
}(_react.Component);
|
|
332
343
|
|
|
333
|
-
|
|
344
|
+
_exports.default = Layout;
|
|
345
|
+
});
|