synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
47 lines (46 loc) • 1.03 kB
JavaScript
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