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
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
8
|
+
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
|
|
11
|
+
var _react2 = _interopRequireDefault(_react);
|
|
12
|
+
|
|
13
|
+
var _propTypes = require("prop-types");
|
|
14
|
+
|
|
15
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
16
|
+
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
|
|
19
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
20
|
+
|
|
21
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
22
|
+
|
|
23
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Die Seitenleiste für das Grid.
|
|
27
|
+
*/
|
|
28
|
+
var SidebarMenu = function (_React$Component) {
|
|
29
|
+
_inherits(SidebarMenu, _React$Component);
|
|
30
|
+
|
|
31
|
+
function SidebarMenu(props) {
|
|
32
|
+
_classCallCheck(this, SidebarMenu);
|
|
33
|
+
|
|
34
|
+
var _this = _possibleConstructorReturn(this, (SidebarMenu.__proto__ || Object.getPrototypeOf(SidebarMenu)).call(this, props));
|
|
35
|
+
|
|
36
|
+
_this.state = {
|
|
37
|
+
hasShadow: false,
|
|
38
|
+
height: window.innerHeight,
|
|
39
|
+
width: window.innerWidth
|
|
40
|
+
};
|
|
41
|
+
_this.updateDimensions = _this.updateDimensions.bind(_this);
|
|
42
|
+
return _this;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
_createClass(SidebarMenu, [{
|
|
46
|
+
key: "componentDidMount",
|
|
47
|
+
value: function componentDidMount() {
|
|
48
|
+
var _this2 = this;
|
|
49
|
+
|
|
50
|
+
var blueAppSidebar = document.querySelector(".blue-app-sidebar");
|
|
51
|
+
|
|
52
|
+
window.addEventListener("resize", this.updateDimensions);
|
|
53
|
+
|
|
54
|
+
if (blueAppSidebar.scrollHeight > blueAppSidebar.clientHeight) {
|
|
55
|
+
console.log("has scroll bar!");
|
|
56
|
+
this.setState({ hasShadow: true });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
blueAppSidebar.addEventListener("scroll", function () {
|
|
60
|
+
if (blueAppSidebar.scrollHeight - blueAppSidebar.scrollTop === blueAppSidebar.clientHeight) {
|
|
61
|
+
_this2.setState({ hasShadow: false });
|
|
62
|
+
} else {
|
|
63
|
+
_this2.setState({ hasShadow: true });
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}, {
|
|
68
|
+
key: "updateDimensions",
|
|
69
|
+
value: function updateDimensions() {
|
|
70
|
+
if (window.innerHeight > 500) {
|
|
71
|
+
this.setState({ hasShadow: false });
|
|
72
|
+
}
|
|
73
|
+
this.setState({
|
|
74
|
+
height: window.innerHeight,
|
|
75
|
+
width: window.innerWidth
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
key: "componentWillUnmount",
|
|
80
|
+
value: function componentWillUnmount() {
|
|
81
|
+
window.removeEventListener("resize", this.updateDimensions);
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
key: "render",
|
|
85
|
+
value: function render() {
|
|
86
|
+
return _react2.default.createElement(
|
|
87
|
+
"div",
|
|
88
|
+
{ className: "blue-app-sidebar " + (this.props.sidebarClass ? this.props.sidebarClass : ""),
|
|
89
|
+
style: this.props.sidebarStyle ? this.props.sidebarStyle : {}
|
|
90
|
+
},
|
|
91
|
+
this.props.topContent && _react2.default.createElement(
|
|
92
|
+
"div",
|
|
93
|
+
{ className: "blue-app-sidebar-top" },
|
|
94
|
+
this.props.topContent
|
|
95
|
+
),
|
|
96
|
+
_react2.default.createElement(
|
|
97
|
+
"div",
|
|
98
|
+
{ className: "blue-app-menu " + (this.props.menuClass ? this.props.menuClass : ""),
|
|
99
|
+
style: this.props.menuStyle ? this.props.menuStyle : {}
|
|
100
|
+
},
|
|
101
|
+
_react2.default.createElement(
|
|
102
|
+
"div",
|
|
103
|
+
{ className: "fluent-btn" },
|
|
104
|
+
_react2.default.createElement("div", { className: "fluent-btn-ball" }),
|
|
105
|
+
this.props.children
|
|
106
|
+
)
|
|
107
|
+
),
|
|
108
|
+
this.props.bottomContent && _react2.default.createElement(
|
|
109
|
+
"div",
|
|
110
|
+
{ className: "blue-app-sidebar-bottom " + (this.state.hasShadow ? " has-shadow" : "") },
|
|
111
|
+
this.props.bottomContent
|
|
112
|
+
)
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
}]);
|
|
116
|
+
|
|
117
|
+
return SidebarMenu;
|
|
118
|
+
}(_react2.default.Component);
|
|
119
|
+
|
|
120
|
+
SidebarMenu.propTypes = {
|
|
121
|
+
/**
|
|
122
|
+
* Erweiterung der className-Property der Seitenleiste.
|
|
123
|
+
*/
|
|
124
|
+
sidebarClass: _propTypes2.default.string,
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Setzt die style-Property der Seitenleiste.
|
|
128
|
+
*/
|
|
129
|
+
sidebarStyle: _propTypes2.default.object,
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Erweiterung der className-Property des Menüs.
|
|
133
|
+
*/
|
|
134
|
+
menuClass: _propTypes2.default.string,
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Setzt die style-Property des Menüs.
|
|
138
|
+
*/
|
|
139
|
+
menuStyle: _propTypes2.default.object,
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Inhalte oberhalb des Sidebar-Menüs
|
|
143
|
+
*/
|
|
144
|
+
topContent: _propTypes2.default.any,
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Inhalte für den Footer der Sidebar
|
|
148
|
+
*/
|
|
149
|
+
bottomContent: _propTypes2.default.any
|
|
150
|
+
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
exports.default = SidebarMenu;
|
package/dist/Switch.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
8
|
+
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
|
|
11
|
+
var _react2 = _interopRequireDefault(_react);
|
|
12
|
+
|
|
13
|
+
var _propTypes = require("prop-types");
|
|
14
|
+
|
|
15
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
16
|
+
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
|
|
19
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
20
|
+
|
|
21
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
22
|
+
|
|
23
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Switch.
|
|
27
|
+
*/
|
|
28
|
+
var Switch = function (_React$Component) {
|
|
29
|
+
_inherits(Switch, _React$Component);
|
|
30
|
+
|
|
31
|
+
function Switch() {
|
|
32
|
+
_classCallCheck(this, Switch);
|
|
33
|
+
|
|
34
|
+
return _possibleConstructorReturn(this, (Switch.__proto__ || Object.getPrototypeOf(Switch)).apply(this, arguments));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_createClass(Switch, [{
|
|
38
|
+
key: "render",
|
|
39
|
+
value: function render() {
|
|
40
|
+
return _react2.default.createElement(this.props.elementType, {
|
|
41
|
+
className: "switch " + (this.props.disabled ? "disabled " : "") + this.props.className
|
|
42
|
+
}, [_react2.default.createElement("input", {
|
|
43
|
+
key: 0,
|
|
44
|
+
type: "checkbox",
|
|
45
|
+
checked: this.props.checked,
|
|
46
|
+
onChange: this.props.onChange,
|
|
47
|
+
disabled: this.props.disabled
|
|
48
|
+
}), _react2.default.createElement("span", {
|
|
49
|
+
key: 1,
|
|
50
|
+
className: "slider round",
|
|
51
|
+
"data-label": this.props.sliderLabel
|
|
52
|
+
})]);
|
|
53
|
+
}
|
|
54
|
+
}], [{
|
|
55
|
+
key: "defaultProps",
|
|
56
|
+
get: function get() {
|
|
57
|
+
return {
|
|
58
|
+
className: "",
|
|
59
|
+
checked: false,
|
|
60
|
+
onChange: function onChange() {},
|
|
61
|
+
sliderLabel: null,
|
|
62
|
+
elementType: "label",
|
|
63
|
+
disabled: false
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}]);
|
|
67
|
+
|
|
68
|
+
return Switch;
|
|
69
|
+
}(_react2.default.Component);
|
|
70
|
+
|
|
71
|
+
Switch.propTypes = {
|
|
72
|
+
className: _propTypes2.default.string,
|
|
73
|
+
checked: _propTypes2.default.bool,
|
|
74
|
+
onChange: _propTypes2.default.func,
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Sets label inside of the switch. If you set this, you should also set the className "lg" to make the switch larger.
|
|
78
|
+
*/
|
|
79
|
+
sliderLabel: _propTypes2.default.string,
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* You can change the type of the wrapper element. If you do, the <code>onChange</code> event might not be triggered.
|
|
83
|
+
*/
|
|
84
|
+
elementType: _propTypes2.default.string,
|
|
85
|
+
|
|
86
|
+
disabled: _propTypes2.default.bool
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
exports.default = Switch;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
8
|
+
|
|
9
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
10
|
+
|
|
11
|
+
var _react = require("react");
|
|
12
|
+
|
|
13
|
+
var _react2 = _interopRequireDefault(_react);
|
|
14
|
+
|
|
15
|
+
var _propTypes = require("prop-types");
|
|
16
|
+
|
|
17
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
18
|
+
|
|
19
|
+
var _MenuItem = require("./MenuItem.js");
|
|
20
|
+
|
|
21
|
+
var _MenuItem2 = _interopRequireDefault(_MenuItem);
|
|
22
|
+
|
|
23
|
+
var _Switch = require("./Switch.js");
|
|
24
|
+
|
|
25
|
+
var _Switch2 = _interopRequireDefault(_Switch);
|
|
26
|
+
|
|
27
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
|
+
|
|
29
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
30
|
+
|
|
31
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
32
|
+
|
|
33
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Switch for <strong>Actions</strong>
|
|
37
|
+
*/
|
|
38
|
+
var SwitchMenuItem = function (_React$Component) {
|
|
39
|
+
_inherits(SwitchMenuItem, _React$Component);
|
|
40
|
+
|
|
41
|
+
function SwitchMenuItem() {
|
|
42
|
+
_classCallCheck(this, SwitchMenuItem);
|
|
43
|
+
|
|
44
|
+
return _possibleConstructorReturn(this, (SwitchMenuItem.__proto__ || Object.getPrototypeOf(SwitchMenuItem)).apply(this, arguments));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
_createClass(SwitchMenuItem, [{
|
|
48
|
+
key: "render",
|
|
49
|
+
value: function render() {
|
|
50
|
+
return _react2.default.createElement(_MenuItem2.default, {
|
|
51
|
+
onClick: this.props.onChange,
|
|
52
|
+
icon: _react2.default.createElement(_Switch2.default, _extends({}, this.props, {
|
|
53
|
+
elementType: "span"
|
|
54
|
+
})),
|
|
55
|
+
label: this.props.label
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}]);
|
|
59
|
+
|
|
60
|
+
return SwitchMenuItem;
|
|
61
|
+
}(_react2.default.Component);
|
|
62
|
+
|
|
63
|
+
SwitchMenuItem.propTypes = _Switch2.default.propTypes;
|
|
64
|
+
|
|
65
|
+
exports.default = SwitchMenuItem;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var Utilities = {
|
|
7
|
+
hasClass: function hasClass(el, className) {
|
|
8
|
+
if (el.classList) return el.classList.contains(className);else return !!el.className.match(new RegExp('(\\s|^)' + className + '(\\s|$)'));
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
addClass: function addClass(el, className) {
|
|
12
|
+
if (el.classList) el.classList.add(className);else if (!hasClass(el, className)) el.className += " " + className;
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
removeClass: function removeClass(el, className) {
|
|
16
|
+
if (el.classList) el.classList.remove(className);else if (hasClass(el, className)) el.className = el.className.replace(new RegExp('(\\s|^)' + className + '(\\s|$)'), ' ');
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
toggleClass: function toggleClass(element, className) {
|
|
20
|
+
if (!element || !className) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var classString = element.className,
|
|
25
|
+
nameIndex = classString.indexOf(className);
|
|
26
|
+
if (nameIndex == -1) {
|
|
27
|
+
classString += ' ' + className;
|
|
28
|
+
} else {
|
|
29
|
+
classString = classString.substr(0, nameIndex) + classString.substr(nameIndex + className.length);
|
|
30
|
+
}
|
|
31
|
+
element.className = classString;
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
startLoading: function startLoading() {
|
|
35
|
+
document.querySelectorAll(".blue-app-loading")[0].style.display = "block";
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
finishLoading: function finishLoading() {
|
|
39
|
+
document.querySelectorAll(".blue-app-loading")[0].style.display = "";
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
showSuccess: function showSuccess() {
|
|
43
|
+
document.querySelectorAll(".blue-app-status-success")[0].style.display = "block";
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
hideSuccess: function hideSuccess() {
|
|
47
|
+
document.querySelectorAll(".blue-app-status-success")[0].style.display = "";
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
toggleActions: function toggleActions() {
|
|
51
|
+
this.toggleClass(document.querySelector(".blue-app-wrapper"), "active");
|
|
52
|
+
this.toggleClass(document.querySelector(".blue-app-grid"), "wrapper-in");
|
|
53
|
+
|
|
54
|
+
var els = document.querySelectorAll(".blue-app-actions");
|
|
55
|
+
for (var i = 0; i < els.length; i++) {
|
|
56
|
+
this.toggleClass(els[i], "open");
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
resetAlertMessage: function resetAlertMessage() {
|
|
61
|
+
var alertClassName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "info";
|
|
62
|
+
|
|
63
|
+
var alertElement = document.querySelectorAll(".blue-app-status-alert")[0];
|
|
64
|
+
document.querySelectorAll(".blue-app-status-" + alertClassName)[0].style.display = "";
|
|
65
|
+
alertElement.style.display = "";
|
|
66
|
+
this.removeClass(alertElement, "alert-" + (alertClassName == "loading" ? "info" : alertClassName));
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
setAlertMessage: function setAlertMessage(message) {
|
|
70
|
+
var alertClassName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "info";
|
|
71
|
+
|
|
72
|
+
var _this = this;
|
|
73
|
+
|
|
74
|
+
var close = arguments[2];
|
|
75
|
+
var detailText = arguments[3];
|
|
76
|
+
|
|
77
|
+
var alertElement = document.querySelectorAll(".blue-app-status-alert")[0];
|
|
78
|
+
|
|
79
|
+
if (alertClassName.indexOf("alert-") > -1) {
|
|
80
|
+
alertClassName = alertClassName.replace("alert-", "");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
document.querySelectorAll(".blue-app-status-" + alertClassName)[0].style.display = "block";
|
|
84
|
+
alertElement.style.display = "block";
|
|
85
|
+
this.addClass(alertElement, "alert-" + (alertClassName == "loading" ? "info" : alertClassName));
|
|
86
|
+
|
|
87
|
+
alertElement.querySelector(".alert-body").innerHTML = '<h2>' + message + '</h2>';
|
|
88
|
+
if (detailText) {
|
|
89
|
+
alertElement.querySelector(".alert-body").innerHTML += '<span>' + detailText + '</span>';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (close) {
|
|
93
|
+
alertElement.querySelector(".close").style.display = "inline-block";
|
|
94
|
+
alertElement.querySelector(".close").onclick = function () {
|
|
95
|
+
_this.resetAlertMessage(alertClassName);
|
|
96
|
+
};
|
|
97
|
+
} else {
|
|
98
|
+
alertElement.querySelector(".close").style.display = "none";
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
guid: function guid() {
|
|
103
|
+
function s4() {
|
|
104
|
+
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
|
|
105
|
+
}
|
|
106
|
+
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
scrollToTop: function scrollToTop() {
|
|
110
|
+
var routerPage = document.querySelector(".router-page.active");
|
|
111
|
+
|
|
112
|
+
routerPage.scroll({
|
|
113
|
+
behavior: "smooth",
|
|
114
|
+
left: 0,
|
|
115
|
+
top: 0
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
fluentBtnsListener: function fluentBtnsListener(event, btn) {
|
|
120
|
+
var btnBall = btn.querySelector(".fluent-btn-ball");
|
|
121
|
+
var el = btn.getBoundingClientRect();
|
|
122
|
+
var offset = {
|
|
123
|
+
left: el.left + window.scrollX,
|
|
124
|
+
top: el.top + window.scrollY
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
var x = event.pageX - offset.left;
|
|
128
|
+
var y = event.pageY - offset.top;
|
|
129
|
+
|
|
130
|
+
btnBall.style.left = x + "px";
|
|
131
|
+
btnBall.style.top = y + "px";
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
unregisterFluentBtns: null,
|
|
135
|
+
registerFluentBtns: null
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
Utilities.unregisterFluentBtns = function () {
|
|
139
|
+
var btns = document.querySelectorAll(".fluent-btn");
|
|
140
|
+
|
|
141
|
+
btns.forEach(function (btn) {
|
|
142
|
+
btn.removeEventListener("mousemove", function (event) {
|
|
143
|
+
return Utilities.fluentBtnsListener(event, btn);
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
Utilities.registerFluentBtns = function () {
|
|
149
|
+
Utilities.unregisterFluentBtns();
|
|
150
|
+
|
|
151
|
+
var btns = document.querySelectorAll(".fluent-btn");
|
|
152
|
+
|
|
153
|
+
btns.forEach(function (btn) {
|
|
154
|
+
btn.addEventListener("mousemove", function (event) {
|
|
155
|
+
return Utilities.fluentBtnsListener(event, btn);
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
Utilities.fetchData = function (input) {
|
|
161
|
+
var init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
162
|
+
|
|
163
|
+
return fetch(input, init).then(function (response) {
|
|
164
|
+
if (!response.ok) throw response;
|
|
165
|
+
return response;
|
|
166
|
+
}).catch(function (reason) {
|
|
167
|
+
reason.text().then(function (errorMessage) {
|
|
168
|
+
Utilities.setAlertMessage(reason.status + ' - ' + reason.statusText, "danger", true, errorMessage);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
exports.default = Utilities;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
$blue-actions-indicator-height: 2rem !default;
|
|
2
|
+
|
|
3
|
+
.blue-actions {
|
|
4
|
+
--sidebar-bg: transparent;
|
|
5
|
+
|
|
6
|
+
color: $header-color;
|
|
7
|
+
position: fixed;
|
|
8
|
+
right: .5rem;
|
|
9
|
+
z-index: 41;
|
|
10
|
+
transition: height .4s;
|
|
11
|
+
|
|
12
|
+
.blue-app-sidebar-btn {
|
|
13
|
+
color: $header-color;
|
|
14
|
+
|
|
15
|
+
&:hover,
|
|
16
|
+
&:active {
|
|
17
|
+
background-color: $actions-control-bg-hover;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&.closed {
|
|
22
|
+
.blue-actions-featured {
|
|
23
|
+
display: flex;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&.break-sm {
|
|
28
|
+
@include actions-break(map-get($grid-breakpoints, "sm"));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.break-md {
|
|
32
|
+
@include actions-break(map-get($grid-breakpoints, "md"));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&.break-lg {
|
|
36
|
+
@include actions-break(map-get($grid-breakpoints, "lg"));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.break-xl {
|
|
40
|
+
@include actions-break(map-get($grid-breakpoints, "xl"));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.blue-actions-indicator {
|
|
45
|
+
height: $blue-actions-indicator-height;
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
align-items: center;
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
position: relative;
|
|
51
|
+
|
|
52
|
+
&::before {
|
|
53
|
+
content: "";
|
|
54
|
+
width: 2.5rem;
|
|
55
|
+
height: 4px;
|
|
56
|
+
border-radius: 2px;
|
|
57
|
+
background-color: currentColor;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.blue-actions-controls {
|
|
62
|
+
.blue-app-sidebar-btn {
|
|
63
|
+
width: 100%;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.blue-app-sidebar-label {
|
|
67
|
+
display: inline-block;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.blue-actions-featured {
|
|
72
|
+
display: none;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
|
|
75
|
+
> .fluent-btn {
|
|
76
|
+
display: inline-flex;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.blue-app-sidebar-btn {
|
|
81
|
+
margin: 2px;
|
|
82
|
+
|
|
83
|
+
&.has-label {
|
|
84
|
+
width: auto;
|
|
85
|
+
|
|
86
|
+
.blue-app-sidebar-label {
|
|
87
|
+
display: inline-block;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.has-actions {
|
|
94
|
+
&.break-sm {
|
|
95
|
+
@include has-actions(map-get($grid-breakpoints, "sm"));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&.break-md {
|
|
99
|
+
@include has-actions(map-get($grid-breakpoints, "md"));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.break-lg {
|
|
103
|
+
@include has-actions(map-get($grid-breakpoints, "lg"));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&.break-xl {
|
|
107
|
+
@include has-actions(map-get($grid-breakpoints, "xl"));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
.blue-app-actions-menu {
|
|
2
|
+
.nav-link {
|
|
3
|
+
position: relative;
|
|
4
|
+
margin-left: 2px;
|
|
5
|
+
|
|
6
|
+
background-color: var(--action-link-bg-color);
|
|
7
|
+
|
|
8
|
+
&:hover {
|
|
9
|
+
background-color: $bla-button-bg-hover;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.blue-app-actions {
|
|
15
|
+
display: inline;
|
|
16
|
+
transition: background-color 0.5s linear;
|
|
17
|
+
position: absolute;
|
|
18
|
+
left: 0;
|
|
19
|
+
right: 0;
|
|
20
|
+
top: 0;
|
|
21
|
+
padding: 0;
|
|
22
|
+
|
|
23
|
+
&.open {
|
|
24
|
+
left: -48px;
|
|
25
|
+
width: calc(100% + 48px);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.navbar-nav > li > a {
|
|
29
|
+
animation: fadeInDown 0.5s;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.form-switch {
|
|
33
|
+
font-weight: normal;
|
|
34
|
+
height: $normal-size;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.sm {
|
|
38
|
+
@include actions(768px);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&.md {
|
|
42
|
+
@include actions(992px);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&.lg {
|
|
46
|
+
@include actions(1200px);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.blue-app-actions-menu-toggle > span:first-child {
|
|
51
|
+
transform: rotate(90deg);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.blue-app-actions-menu-item {
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
color: inherit;
|
|
58
|
+
}
|