@up-group-ui/react-controls
Version:
Up shared react controls
44 lines • 5.18 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TopMenuItem = exports.TopMenu = void 0;
var tslib_1 = require("tslib");
var jsx_runtime_1 = require("react/jsx-runtime");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var TopMenu = (function (_super) {
(0, tslib_1.__extends)(TopMenu, _super);
function TopMenu(p, c) {
var _this = _super.call(this, p, c) || this;
_this.state = {};
return _this;
}
TopMenu.prototype.render = function () {
var topMenuItem = [];
if (this.props.childMenuItems && this.props.childMenuItems.length) {
topMenuItem = this.props.childMenuItems.map(function (v, i) {
return (0, jsx_runtime_1.jsx)(TopMenuItem, { title: v.title, icon: v.icon, action: v.action }, i);
});
}
return ((0, jsx_runtime_1.jsxs)("header", (0, tslib_1.__assign)({ className: "main-header" }, { children: [(0, jsx_runtime_1.jsxs)("a", (0, tslib_1.__assign)({ onClick: this.props.onUpClick, className: "logo" }, { children: [(0, jsx_runtime_1.jsx)("span", (0, tslib_1.__assign)({ className: "logo-mini" }, { children: (0, jsx_runtime_1.jsx)("span", { className: "up-logo" }, void 0) }), void 0), (0, jsx_runtime_1.jsxs)("span", (0, tslib_1.__assign)({ className: "logo-lg" }, { children: [(0, jsx_runtime_1.jsx)("span", { className: "up-logo" }, void 0), "OneHome"] }), void 0)] }), void 0), (0, jsx_runtime_1.jsxs)("nav", (0, tslib_1.__assign)({ className: "navbar navbar-static-top", role: "navigation" }, { children: [(0, jsx_runtime_1.jsx)("a", (0, tslib_1.__assign)({ onClick: this.props.onHomeClick, className: "sidebar-toggle", "data-toggle": "", role: "button" }, { children: (0, jsx_runtime_1.jsx)("span", (0, tslib_1.__assign)({ className: "sr-only" }, { children: "Bouton Menu" }), void 0) }), void 0), (0, jsx_runtime_1.jsx)("div", (0, tslib_1.__assign)({ className: "col-md-4" }, { children: (0, jsx_runtime_1.jsxs)("div", (0, tslib_1.__assign)({ className: "input-group" }, { children: [(0, jsx_runtime_1.jsx)("input", { type: "text", className: "form-control", placeholder: "Nom usager, n\u00B0 t\u00E9l\u00E9phone,..." }, void 0), (0, jsx_runtime_1.jsx)("span", (0, tslib_1.__assign)({ className: "input-group-addon", id: "basic-addon2" }, { children: (0, jsx_runtime_1.jsx)("i", { className: "pe pe-7s-search" }, void 0) }), void 0)] }), void 0) }), void 0), (0, jsx_runtime_1.jsx)("div", (0, tslib_1.__assign)({ className: "navbar-custom-menu" }, { children: (0, jsx_runtime_1.jsxs)("ul", (0, tslib_1.__assign)({ className: "nav navbar-nav" }, { children: [topMenuItem, (0, jsx_runtime_1.jsx)("li", (0, tslib_1.__assign)({ className: "dropdown user user-menu open" }, { children: (0, jsx_runtime_1.jsx)("a", (0, tslib_1.__assign)({ id: "imageProfil", className: "dropdown-toggle", "data-toggle": "dropdown", "aria-expanded": "true" }, { children: (0, jsx_runtime_1.jsx)("span", (0, tslib_1.__assign)({ className: "hidden-xs" }, { children: "St\u00E9phane ROMANO" }), void 0) }), void 0) }), void 0), (0, jsx_runtime_1.jsx)("li", (0, tslib_1.__assign)({ title: "R\u00E9glages", "data-toggle": "tooltip", "data-placement": "bottom", "data-original-title": "R\u00E9glages" }, { children: (0, jsx_runtime_1.jsx)("a", (0, tslib_1.__assign)({ onClick: this.props.onReglagesClick, "data-toggle": "control-sidebar" }, { children: (0, jsx_runtime_1.jsx)("i", { className: "pe pe-7s-edit" }, void 0) }), void 0) }), void 0), (0, jsx_runtime_1.jsx)("li", (0, tslib_1.__assign)({ title: "D\u00E9connexion", "data-toggle": "tooltip", "data-placement": "bottom" }, { children: (0, jsx_runtime_1.jsx)("a", (0, tslib_1.__assign)({ onClick: this.props.onDeconnexionClick }, { children: (0, jsx_runtime_1.jsx)("i", { className: "pe pe-7s-power" }, void 0) }), void 0) }), void 0)] }), void 0) }), void 0)] }), void 0)] }), void 0));
};
return TopMenu;
}(react_1.default.Component));
exports.TopMenu = TopMenu;
var TopMenuItem = (function (_super) {
(0, tslib_1.__extends)(TopMenuItem, _super);
function TopMenuItem(p, c) {
var _this = _super.call(this, p, c) || this;
_this.state = {};
return _this;
}
TopMenuItem.prototype.render = function () {
if (typeof this.props.action === 'string') {
return ((0, jsx_runtime_1.jsx)("li", (0, tslib_1.__assign)({ title: this.props.title, "data-toggle": "tooltip", "data-placement": "bottom" }, { children: (0, jsx_runtime_1.jsx)("a", (0, tslib_1.__assign)({ href: this.props.action }, { children: (0, jsx_runtime_1.jsx)("i", { className: this.props.icon }, void 0) }), void 0) }), void 0));
}
else {
return ((0, jsx_runtime_1.jsx)("li", (0, tslib_1.__assign)({ title: this.props.title, "data-toggle": "tooltip", "data-placement": "bottom" }, { children: (0, jsx_runtime_1.jsx)("a", (0, tslib_1.__assign)({ onClick: this.props.action }, { children: (0, jsx_runtime_1.jsx)("i", { className: this.props.icon }, void 0) }), void 0) }), void 0));
}
};
return TopMenuItem;
}(react_1.default.Component));
exports.TopMenuItem = TopMenuItem;
//# sourceMappingURL=UpTopMenu.js.map