UNPKG

taxonium-component

Version:

React component for exploring large phylogenetic trees in the browser

54 lines (53 loc) 2.44 kB
import { jsxs as s, jsx as a } from "react/jsx-runtime"; import { useState as t } from "react"; import { o as q, m as w, a as F, D as A, T as S, c as D, F as N, d as E, B as C, u as k, e as I } from "./JBrowsePanel-BNE3gNW1.js"; import { F as l } from "./FormControlLabel-CfHqydvH.js"; import { C as h } from "./Checkbox-D7_LksK2.js"; const R = w()({ dialogContent: { width: "40em" } }), G = q(function({ model: o, handleClose: n }) { const { classes: y } = R(), [r, v] = t(""), [d, b] = t(!0), [u, f] = t(!0), [p, x] = t(!0); let c; try { new RegExp(r); } catch (e) { c = e; } return s(F.Dialog, { maxWidth: "xl", open: !0, onClose: n, title: "Sequence search", children: [s(A, { className: y.dialogContent, children: [a(S, { children: "Supply a sequence to search for. A track will be created with the resulting matches once submitted. You can also supply regex style expressions e.g. AACT(C|T)." }), a(D, { value: r, onChange: (e) => { v(e.target.value); }, helperText: "Sequence search pattern" }), s(N, { children: [a(l, { control: a(h, { checked: d, onChange: (e) => { b(e.target.checked); } }), label: "Search forward strand" }), a(l, { control: a(h, { checked: u, onChange: (e) => { f(e.target.checked); } }), label: "Search reverse strand" }), a(l, { control: a(h, { checked: p, onChange: (e) => { x(e.target.checked); } }), label: "Case insensitive" })] }), c ? a(S, { color: "error", children: `${c}` }) : null] }), s(E, { children: [a(C, { onClick: () => { var e; if (r) { const m = `sequence_search_${+Date.now()}`, i = k.getSession(o), { assemblyManager: T } = i, g = o.assemblyNames[0]; k.isSessionWithAddTracks(i) && (i.addTrackConf({ trackId: m, name: `Sequence search ${r}`, assemblyNames: [g], type: "FeatureTrack", adapter: { type: "SequenceSearchAdapter", search: r, searchForward: d, searchReverse: u, caseInsensitive: p, sequenceAdapter: I((e = T.get(g)) === null || e === void 0 ? void 0 : e.configuration.sequence.adapter) } }), o.showTrack(m)); } n(); }, variant: "contained", color: "primary", children: "Submit" }), a(C, { onClick: () => { n(); }, variant: "contained", color: "secondary", children: "Close" })] })] }); }); export { G as default }; //# sourceMappingURL=SequenceSearchDialog-B6UDBVkR.js.map