synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
107 lines (106 loc) • 2.31 kB
JavaScript
import { jsx as n } from "react/jsx-runtime";
import { Add as s, Close as m, ArrowDownward as l, ArrowUpward as p } from "@mui/icons-material";
import { Button as f, IconButton as d } from "@mui/material";
import y from "@mui/icons-material/ContentCopy";
import { TranslatableString as e } from "@rjsf/utils";
const c = { minWidth: "unset", width: "40px", height: "40px" };
function h({ uiSchema: t, registry: o, ...i }) {
const { translateString: u } = o;
return /* @__PURE__ */ n(
f,
{
title: u(e.AddItemButton),
...i,
color: "primary",
variant: "contained",
sx: c,
children: /* @__PURE__ */ n(s, {})
}
);
}
function B(t) {
switch (t) {
case "copy":
return /* @__PURE__ */ n(y, { fontSize: "inherit" });
case "moveUp":
return /* @__PURE__ */ n(p, { fontSize: "inherit" });
case "moveDown":
return /* @__PURE__ */ n(l, { fontSize: "inherit" });
case "remove":
return /* @__PURE__ */ n(m, { fontSize: "inherit" });
default:
throw new Error(`Unexpected iconType ${t}`);
}
}
function r(t) {
const { iconType: o, buttonType: i, uiSchema: u, ...a } = t;
return /* @__PURE__ */ n(d, { ...a, color: "default", sx: c, children: B(i) });
}
function v(t) {
const {
registry: { translateString: o }
} = t;
return /* @__PURE__ */ n(
r,
{
title: o(e.RemoveButton),
...t,
buttonType: "remove"
}
);
}
function w(t) {
const {
registry: { translateString: o }
} = t;
return /* @__PURE__ */ n(
r,
{
title: o(e.CopyButton),
...t,
buttonType: "copy"
}
);
}
function S(t) {
const {
registry: { translateString: o }
} = t;
return /* @__PURE__ */ n(
r,
{
title: o(e.MoveUpButton),
...t,
buttonType: "moveUp"
}
);
}
function g(t) {
const {
registry: { translateString: o }
} = t;
return /* @__PURE__ */ n(
r,
{
title: o(e.MoveDownButton),
...t,
buttonType: "moveDown"
}
);
}
const C = {
AddButton: h,
RemoveButton: v,
MoveUpButton: S,
MoveDownButton: g,
CopyButton: w
};
export {
h as AddButton,
w as CopyButton,
g as MoveDownButton,
S as MoveUpButton,
v as RemoveButton,
C as default
};
//# sourceMappingURL=ButtonTemplate.js.map