UNPKG

myprojectpackageprav

Version:
85 lines 6.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var react_1 = require("react"); var actionbutton_1 = tslib_1.__importDefault(require("../buttons/actionbutton")); require("./helpdesk.css"); var popupTop = ''; var xpositionvalue = ''; var offsetLeftValue = ''; var offsetTopValue = ''; var elementHeightValue = ''; var offsetWidthValue = ''; function Helpdesk() { /***** Responsive Popup Code Start*****/ var helpdesk = (0, react_1.useRef)(null); var popupbtnRef = (0, react_1.useRef)(null); var _a = (0, react_1.useState)(''), xpositionvalueupdate = _a[0], setpopupwidthupdate = _a[1]; var _b = (0, react_1.useState)(1), popupheight = _b[0], setpopupheight = _b[1]; var _c = (0, react_1.useState)({ helpdesk: false, }), showActionPopups = _c[0], setShowActionPopups = _c[1]; var initialValues = ['helpdesk']; var _d = (0, react_1.useState)({ helpdesk: false, }), btnActionshowhide = _d[0], setActionbtnshowhide = _d[1]; (0, react_1.useEffect)(function () { setpopupheight(window.innerHeight - (offsetTopValue + 58)); var popupwidthdata = popupbtnRef.current ? popupbtnRef.current.offsetWidth : 0; // setpopupwidth(popupwidthdata) if (popupwidthdata < xpositionvalue) { xpositionvalue = xpositionvalue - popupwidthdata; setpopupwidthupdate(xpositionvalue); } else if (popupwidthdata > offsetLeftValue && popupwidthdata < (window.innerWidth - (offsetLeftValue + offsetWidthValue))) { xpositionvalue = offsetLeftValue; setpopupwidthupdate(xpositionvalue); } else if (popupwidthdata > offsetLeftValue && popupwidthdata > (window.innerWidth - (offsetLeftValue + offsetWidthValue))) { xpositionvalue = 0; setpopupwidthupdate(xpositionvalue); } }, [showActionPopups]); var showhide = tslib_1.__assign({}, btnActionshowhide); function popupCloseOpenFunctionality(type, value, top, xposition, left, Ref, elementHeight, offsetWidth) { var _a, _b; popupTop = top; xpositionvalue = xposition; offsetLeftValue = left; offsetTopValue = top; elementHeightValue = elementHeight; offsetWidthValue = offsetWidth; initialValues.forEach(function (element) { showhide[element] = false; }); setActionbtnshowhide(showhide); if (type) { setActionbtnshowhide(tslib_1.__assign(tslib_1.__assign({}, showhide), (_a = {}, _a[type] = value, _a))); setShowActionPopups(tslib_1.__assign(tslib_1.__assign({}, showhide), (_b = {}, _b[type] = value, _b))); } } return (React.createElement(React.Fragment, null, React.createElement("div", { className: "help-desk" }, React.createElement("div", { className: "mx-2" }, React.createElement(actionbutton_1.default, { label: "Help Desk", name: 'Help Desk', className: (btnActionshowhide === null || btnActionshowhide === void 0 ? void 0 : btnActionshowhide.helpdesk) ? 'btn-border btn btn-sm font-0 font-md-14 btn-border-radius3 p-relative popup-arrow' : 'btn-border btn btn-sm font-0 font-md-14 btn-border-radius3 p-relative', icon: "icon-helpdesk color-primary font-16 me-md-1 bold", isClick: 'helpdesk', type: "button", ref: helpdesk, popupCloseOpenFunctionality: popupCloseOpenFunctionality, showhide: showActionPopups.helpdesk, id: undefined, props: undefined, inputProps: undefined, onClick: undefined, reference: undefined, btnclassName: undefined, badgeinfo: undefined, badge: undefined, ricon: undefined, "aria-label": undefined })), (btnActionshowhide === null || btnActionshowhide === void 0 ? void 0 : btnActionshowhide.helpdesk) ? React.createElement("div", { className: 'popup p-relative', ref: popupbtnRef, style: { top: popupTop + 8, position: "absolute", overflow: "auto", left: xpositionvalueupdate, maxHeight: popupheight } }, React.createElement("div", { className: "p-relative" }, React.createElement("h3", { tabIndex: 0, "aria-lable": "System Help Desk" }, "System Help Desk"), React.createElement("div", { className: "pt-2 d-flex align-items-center", id: "helpdesk-timings", tabIndex: 0, "aria-aria-labelledby": "helpdesk-timings" }, React.createElement("div", { className: "icon-timing me-1" }), React.createElement("div", null, React.createElement("p", { className: "font-12 subtitle-color1" }, "Hours of operation:"), React.createElement("p", null, "8 AM - 6 PM EST "))), React.createElement("p", { className: "d-flex align-items-center pt-2" }, React.createElement("span", { className: "icon-mail me-1" }), React.createElement("a", { title: "info@rhybus.com", href: "mailto:info@rhybus.com", className: "links" }, "info@rhybus.com")), React.createElement("p", { className: "d-flex align-items-center pt-2" }, React.createElement("span", { className: "icon-phone me-1" }), React.createElement("a", { title: "(123)555-6789", href: "tel:(123)555-6789" }, "(123)555-6789")), React.createElement("div", { className: 'close' }, React.createElement(actionbutton_1.default, { label: "Cancel", name: "", className: 'btn-bgcolor6 whitetext p-0 btn btn-sm font-0 btn-border-radius3', icon: "icon-close font-8 p-1", type: "button", isClick: 'helpdesk', ref: helpdesk, popupCloseOpenFunctionality: popupCloseOpenFunctionality, showhide: showActionPopups.helpdesk, id: undefined, props: undefined, inputProps: undefined, onClick: undefined, reference: undefined, btnclassName: undefined, badgeinfo: undefined, badge: undefined, ricon: undefined, "aria-label": undefined })))) : ''))); } exports.default = Helpdesk; //# sourceMappingURL=helpdesk.js.map