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

47 lines (46 loc) 1.03 kB
import { jsx as t } from "react/jsx-runtime"; import l from "../../DateTimePicker/DateTimePicker.js"; import i from "dayjs"; function m({ rowData: n, setRowData: e, disabled: r, colType: u }) { return /* @__PURE__ */ t( l, { disabled: r, value: n ? i(n) : null, onChange: (o) => { o == null ? e(null) : e(u === "number" ? i(o).valueOf() : i(o).toISOString()); }, sx: { // When disabled, allow selecting the entire cell pointerEvents: r ? "none" : void 0, width: "100%", height: "100%", "& .MuiInputBase-root": { height: "100%", backgroundColor: "inherit" } } } ); } function c({ colType: n }) { return { component: ((e) => /* @__PURE__ */ t(m, { ...e, colType: n })), copyValue: ({ rowData: e }) => e, pasteValue: ({ value: e }) => e, disableKeys: !0, keepFocus: !0 }; } export { m as DateTimeCell, c as dateTimeColumn }; //# sourceMappingURL=DateTimeColumn.js.map