UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

36 lines (35 loc) 1.87 kB
import { jsx as r, jsxs as o, Fragment as m } from "react/jsx-runtime"; import C from "../IconSvg/IconSvg.js"; import { StepStateEnum as u } from "./types.js"; function x(l) { const f = l.stepList.filter((e) => e.child !== !0), h = (e, t, i, c) => { let n = "circle"; return i || c ? { iconDef: n } : (t ? n = "block" : e === u.COMPLETED ? n = "checkCircle" : e === u.ERROR && (n = "errorOutlined"), { iconDef: n }); }, S = (e, t = !1) => { let i = "item"; return e && (i = `${i} pointed `), t && (i = `${i} static`), i; }, s = (e, t, i = !1) => { if (!e || e.child && !i) return /* @__PURE__ */ r(m, {}); const c = (a, g, N) => !a.inProgress && (!g || a.final) ? /* @__PURE__ */ r("button", { className: "btn btn-link", onClick: () => N(a), children: a.title }) : /* @__PURE__ */ r("span", { children: a.title }), n = h(e.state, e.excluded, e.static, e.final), d = S(e.inProgress, e.static); return /* @__PURE__ */ o("div", { className: d, children: [ /* @__PURE__ */ r(C, { icon: n.iconDef }), c(e, t, l.onStepChange) ] }); }; return /* @__PURE__ */ r("div", { className: "SRC-menuLayout json-forms-menu", style: { flex: "1" }, children: /* @__PURE__ */ r("ul", { children: f.map((e, t) => /* @__PURE__ */ o("li", { className: "item-wrap", children: [ s(e, !!l.isWizardMode), e.children && e.children.length > 0 && /* @__PURE__ */ r("div", { className: "subMenu", children: /* @__PURE__ */ r("ul", { children: e.children && e.children.map((i, c) => { const n = l.stepList.find( (d) => d.id === i ); return typeof n > "u" ? /* @__PURE__ */ r(m, {}) : /* @__PURE__ */ r("li", { className: "item-wrap", children: s(n, !!l.isWizardMode, !0) }, `${c}-${i}`); }) }) }) ] }, `${t}-${e.id}`)) }) }); } export { x as default }; //# sourceMappingURL=StepsSideNav.js.map