UNPKG

myprojectpackageprav

Version:
44 lines 2.9 kB
import { __assign } from "tslib"; import React, { useState, useRef } from "react"; import ActionButtons from '../buttons/actionbutton'; import { workflow } from './workflow-data'; import "./workflow.css"; export default function Workflow() { var workflowItems = workflow.map(function (flowitems) { return React.createElement("li", { className: "d-flex flex-column align-items-center px-2 px-xl-3" }, React.createElement("div", { className: "circle kpi-bg", "status-kpis": flowitems.kpicolorcode }, React.createElement("span", { class: flowitems.icon })), React.createElement("div", { tabIndex: 0, a: true, className: "workflow-title1" }, flowitems.title)); }); /***** Responsive Popup Code Start*****/ var workflowsteps = useRef(null); // const [xpositionvalueupdate, setpopupwidthupdate] = useState(''); // const [popupheight, setpopupheight] = useState('') var _a = useState({ workflowsteps: false, }), showActionPopups = _a[0], setShowActionPopups = _a[1]; var initialValues = ['workflowsteps']; var _b = useState({ workflowsteps: false, }), btnActionshowhide = _b[0], setActionbtnshowhide = _b[1]; var showhide = __assign({}, btnActionshowhide); function popupCloseOpenFunctionality(type, value, top, xposition, left, Ref, elementHeight, offsetWidth) { var _a, _b; initialValues.forEach(function (element) { showhide[element] = false; }); setActionbtnshowhide(showhide); if (type) { setActionbtnshowhide(__assign(__assign({}, showhide), (_a = {}, _a[type] = value, _a))); setShowActionPopups(__assign(__assign({}, showhide), (_b = {}, _b[type] = value, _b))); } } return (React.createElement(React.Fragment, null, React.createElement("div", { className: "ms-auto" }, (btnActionshowhide === null || btnActionshowhide === void 0 ? void 0 : btnActionshowhide.workflowsteps) ? '' : React.createElement("ul", { className: (btnActionshowhide === null || btnActionshowhide === void 0 ? void 0 : btnActionshowhide.workflowsteps) ? 'list-type-none d-flex workflow' : 'list-type-none d-flex workflow workflow-collapsed' }, workflowItems), (btnActionshowhide === null || btnActionshowhide === void 0 ? void 0 : btnActionshowhide.workflowsteps) ? React.createElement("ul", { className: 'list-type-none d-flex workflow' }, workflowItems) : '', React.createElement(ActionButtons, { label: "", name: '', className: 'btn-sm p-0 workflow-icon', icon: "icon-sitemap border-primary color-primary p-2 border-radius4", isClick: 'workflowsteps', type: "button", ref: workflowsteps, popupCloseOpenFunctionality: popupCloseOpenFunctionality, showhide: showActionPopups.workflowsteps })))); } //# sourceMappingURL=workflow.js.map