lizaui 9.0.9 → 9.0.11

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.
@@ -669,7 +669,10 @@ const CalendarPicker = ({
669
669
  type = "date-picker",
670
670
  size = "md",
671
671
  tileContent = null,
672
- showActionButtons = true
672
+ showActionButtons = true,
673
+ dayPlaceholder = "dd",
674
+ monthPlaceholder = "mm",
675
+ yearPlaceholder = "yyyy"
673
676
  }) => {
674
677
  const [show, setShow] = useState(showCalendar);
675
678
  const inputRef = useRef(0);
@@ -691,7 +694,11 @@ const CalendarPicker = ({
691
694
  const handleChangeToDay = () => {
692
695
  const dateNow = /* @__PURE__ */ new Date();
693
696
  const date = new Date(dateNow.getFullYear(), dateNow.getMonth(), dateNow.getDate(), 0, 0, 0);
694
- handleChange(date);
697
+ if (type === "date-range-picker") {
698
+ handleChange([date, date]);
699
+ } else {
700
+ handleChange(date);
701
+ }
695
702
  };
696
703
  const handleCloseCalendar = () => {
697
704
  if (disabled) return;
@@ -768,7 +775,7 @@ const CalendarPicker = ({
768
775
  CalendarStyle,
769
776
  {
770
777
  color,
771
- className: twMerge(classNameContainer, "relative"),
778
+ className: twMerge(classNameContainer, "relative date-picker-component-container"),
772
779
  onClick: handleOpenCalendar,
773
780
  showcalendar: show.toString(),
774
781
  id: uui,
@@ -803,9 +810,9 @@ const CalendarPicker = ({
803
810
  onKeyDown,
804
811
  onKeyUp,
805
812
  onBlur,
806
- dayPlaceholder: "DD",
807
- monthPlaceholder: "MM",
808
- yearPlaceholder: "YYYY"
813
+ dayPlaceholder,
814
+ monthPlaceholder,
815
+ yearPlaceholder
809
816
  }
810
817
  ) : /* @__PURE__ */ jsx(
811
818
  DateRangePicker,
@@ -827,9 +834,9 @@ const CalendarPicker = ({
827
834
  isOpen: false,
828
835
  onKeyDown,
829
836
  onKeyUp,
830
- dayPlaceholder: "DD",
831
- monthPlaceholder: "MM",
832
- yearPlaceholder: "YYYY"
837
+ dayPlaceholder,
838
+ monthPlaceholder,
839
+ yearPlaceholder
833
840
  }
834
841
  ),
835
842
  !disabled && error ? /* @__PURE__ */ jsx(LabelError, { text: error }) : null