@flozy/editor 8.0.1 → 8.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,9 @@
1
1
  import React from "react";
2
2
  import DatePicker from "react-datepicker";
3
3
  import { useDataView } from "../../Providers/DataViewProvider";
4
+ import { Grid } from "@mui/material";
5
+ import useCommonStyle from "../../../../commonStyle";
6
+ import { useEditorContext } from "../../../../hooks/useMouseMove";
4
7
  import { jsx as _jsx } from "react/jsx-runtime";
5
8
  function isValidDate(dateString) {
6
9
  const date = new Date(dateString);
@@ -16,20 +19,27 @@ const DateType = props => {
16
19
  const {
17
20
  onChange
18
21
  } = useDataView();
22
+ const {
23
+ theme
24
+ } = useEditorContext();
25
+ const classes = useCommonStyle(theme);
19
26
  const handleChange = date => {
20
27
  onChange(rowIndex, {
21
28
  [property]: date
22
29
  });
23
30
  };
24
- return /*#__PURE__*/_jsx(DatePicker, {
25
- disabled: readOnly,
26
- selected: isValidDate(value) ? new Date(value) : "",
27
- onChange: handleChange,
28
- onKeyDown: e => {
29
- e.preventDefault();
30
- console.log(e?.target.value);
31
- },
32
- placeholderText: "MM/DD/YYYY"
31
+ return /*#__PURE__*/_jsx(Grid, {
32
+ sx: classes.datePicker,
33
+ children: /*#__PURE__*/_jsx(DatePicker, {
34
+ disabled: readOnly,
35
+ selected: isValidDate(value) ? new Date(value) : "",
36
+ onChange: handleChange,
37
+ onKeyDown: e => {
38
+ e.preventDefault();
39
+ console.log(e?.target.value);
40
+ },
41
+ placeholderText: "MM/DD/YYYY"
42
+ })
33
43
  });
34
44
  };
35
45
  export default DateType;
@@ -428,16 +428,71 @@ const useCommonStyle = theme => ({
428
428
  width: "100%",
429
429
  "& .react-datepicker__input-container": {
430
430
  "& .MuiInputBase-root": {
431
- background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
431
+ backgroundColor: theme?.palette?.editor?.inputFieldBgColor,
432
432
  "& .MuiInputBase-input": {
433
- background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
434
- color: `${theme?.palette?.editor?.textColor} !important`
433
+ backgroundColor: theme?.palette?.editor?.inputFieldBgColor,
434
+ color: theme?.palette?.editor?.textColor + " !important"
435
435
  },
436
436
  "& .MuiOutlinedInput-notchedOutline": {
437
- border: `1px solid ${theme?.palette?.editor?.signaturePopUpInputFieldBorder} !important`
437
+ border: `1px solid ${theme?.palette?.editor?.signaturePopUpInputFieldBorder || theme?.palette?.divider} !important`,
438
+ borderRadius: "10px"
439
+ },
440
+ "&:hover .MuiOutlinedInput-notchedOutline": {
441
+ borderColor: theme?.palette?.primary?.main
442
+ },
443
+ "&.Mui-focused .MuiOutlinedInput-notchedOutline": {
444
+ borderColor: theme?.palette?.primary?.dark
438
445
  }
439
446
  }
440
447
  }
448
+ },
449
+ "& .react-datepicker": {
450
+ backgroundColor: theme?.palette?.editor?.inputFieldBgColor,
451
+ // borderRadius: "10px",
452
+ border: `1px solid ${theme?.palette?.divider || "#ccc"}`,
453
+ boxShadow: "2px 4px 8px rgba(0, 0, 0, 0.4)",
454
+ color: theme?.palette?.editor?.textColor + " !important"
455
+ },
456
+ "& .react-datepicker__header": {
457
+ backgroundColor: theme?.palette?.editor?.inputFieldBgColor,
458
+ borderBottom: `1px solid ${theme?.palette?.divider || "#ddd"}`,
459
+ color: theme?.palette?.editor?.textColor + " !important"
460
+ },
461
+ "& .react-datepicker__day": {
462
+ color: theme?.palette?.editor?.textColor,
463
+ "&:hover": {
464
+ backgroundColor: theme?.palette?.editor?.menuOptionHoverBackground,
465
+ color: theme?.palette?.editor?.textColor || "#fff"
466
+ }
467
+ },
468
+ "& .react-datepicker__current-month": {
469
+ color: theme?.palette?.editor?.textColor
470
+ },
471
+ "& .react-datepicker__day-name": {
472
+ color: theme?.palette?.editor?.textColor
473
+ },
474
+ "& .react-datepicker__day--selected": {
475
+ background: theme?.palette?.editor?.activeColor,
476
+ color: "#fff",
477
+ "&:hover": {
478
+ background: theme?.palette?.editor?.activeColor,
479
+ color: "#fff"
480
+ }
481
+ },
482
+ "& .react-datepicker__day--keyboard-selected": {
483
+ backgroundColor: "#bad9f1",
484
+ color: "#000",
485
+ "&:hover": {
486
+ backgroundColor: "#bad9f1",
487
+ color: "#000"
488
+ }
489
+ },
490
+ "& .react-datepicker__day--today": {
491
+ fontWeight: "bold",
492
+ borderBottom: `2px solid ${theme?.palette?.editor?.activeColor}`
493
+ },
494
+ "& .react-datepicker__triangle": {
495
+ display: "none"
441
496
  }
442
497
  },
443
498
  signaturePopUpNameField: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "8.0.1",
3
+ "version": "8.0.2",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"