import { t as React, j as jsxRuntimeExports, G as Grid, I as IconButton, aH as SaveOutlinedIcon, d as Box, aL as TabsForReports, B as Button } from "./index-D15x63tD.js";
import { P as PrintIcon, D as DocumentScannerOutlinedIcon } from "./PrintOutlined-B9HvI__H.js";
function DialogTabsForReports({ props }) {
  const reports = React.useRef();
  function PrintReport() {
    let frame;
    if (reports.current) {
      frame = reports.current.querySelector("IFRAME");
    }
    if (frame && frame.contentWindow) {
      frame.contentWindow.print();
    }
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { style: { width: "100%", height: "100%" }, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      Grid,
      {
        style: {
          width: "100%",
          height: "30px",
          borderBottom: "1px solid #C8B58F"
        },
        children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { container: true, justifyContent: "flex-start", alignItems: "center", direction: "row", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            IconButton,
            {
              title: "Печать документа",
              style: {
                height: "30px",
                width: "30px",
                display: props.json.CLSID === "{55D200F8-A5EE-4BB8-B9AD-762B6FB815D1}" ? "none" : ""
              },
              onClick: PrintReport,
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(PrintIcon, {})
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            IconButton,
            {
              title: "Параметры документа",
              disabled: true,
              style: {
                height: "30px",
                width: "30px",
                display: props.json.CLSID === "{55D200F8-A5EE-4BB8-B9AD-762B6FB815D1}" ? "none" : ""
              },
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(DocumentScannerOutlinedIcon, {})
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            IconButton,
            {
              title: "Сохранить в файл",
              disabled: true,
              style: {
                height: "30px",
                width: "30px",
                display: props.json.CLSID === "{55D200F8-A5EE-4BB8-B9AD-762B6FB815D1}" ? "none" : ""
              },
              onClick: () => {
              },
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(SaveOutlinedIcon, {})
            }
          )
        ] })
      }
    ),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      Box,
      {
        style: {
          width: "100%",
          height: props.Buttons === -1 ? "calc(100% - 30px)" : "calc(100% - 40px - 30px)"
        },
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Grid,
          {
            style: {
              width: "100%",
              height: "100%"
            },
            ref: reports,
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(TabsForReports, { reportData: { ...props.jsonData, ...props } })
          }
        )
      }
    ),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      Box,
      {
        style: {
          height: "35px",
          width: "100%",
          marginTop: "5px",
          display: props.Buttons === -1 ? "none" : ""
        },
        children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { container: true, direction: "row", justifyContent: "flex-end", alignItems: "center", spacing: 1, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Button,
            {
              onClick: () => {
              },
              size: "small",
              variant: "outlined",
              style: {
                textTransform: "none",
                display: props.Buttons && (props.Button & 1) === 0 ? "none" : ""
              },
              value: "1",
              className: "button_Modal_Select",
              children: "Выбрать"
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Button,
            {
              size: "small",
              variant: "outlined",
              style: { textTransform: "none", marginRight: "5px" },
              value: "2",
              className: "button_Modal_Close",
              children: "Отмена"
            }
          ) })
        ] })
      }
    )
  ] });
}
export {
  DialogTabsForReports as default
};
//# sourceMappingURL=DialogTabsForReports-BTc98GHA.js.map
