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

54 lines (53 loc) 1.53 kB
import { jsxs as c, Fragment as T, jsx as o } from "react/jsx-runtime"; import { Typography as d, FormGroup as m, FormControlLabel as _, Checkbox as I, Alert as h } from "@mui/material"; import { ENTITY_VIEW_TYPE_MASK_FILE as l, ENTITY_VIEW_TYPE_MASK_FOLDER as p, ENTITY_VIEW_TYPE_MASK_TABLE as f, ENTITY_VIEW_TYPE_MASK_DATASET as u } from "@sage-bionetworks/synapse-types"; const i = [ ["Files", l], ["Folders", p], ["Tables", f], ["Datasets", u] ]; function A(e) { return i.forEach(([, n]) => { (e & n) !== 0 && (e = e - n); }), e === 0; } function x(e) { const { value: n, onChange: a, disabled: E = !1 } = e, r = !A(n); return /* @__PURE__ */ c(T, { children: [ /* @__PURE__ */ o( d, { variant: "body1", sx: { mt: 2.5, mb: 1.25, fontWeight: 700 }, children: "Include in View" } ), /* @__PURE__ */ o(m, { sx: { gap: 1 }, children: i.map(([t, s]) => /* @__PURE__ */ o( _, { control: /* @__PURE__ */ o(I, {}), label: t, checked: ( // Checked if the mask bit is set (n & s) > 0 ), disabled: r || E, onChange: () => { a(n ^ s); } }, t )) }), r && /* @__PURE__ */ o(h, { severity: "warning", sx: { my: 2.25 }, children: "A custom mask is in use. Changes cannot be made in the UI." }) ] }); } export { x as default, A as isMaskSupportedInUI }; //# sourceMappingURL=EntityViewMaskEditor.js.map