hplx-react-elements-dev 1.1.1 → 1.1.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.
@@ -3,5 +3,5 @@ import "react-date-range/dist/styles.css";
3
3
  import "react-date-range/dist/theme/default.css";
4
4
  import "../calendarView/CalenderViewCSS.css";
5
5
  import { CalenderViewProps } from "../types";
6
- declare const CalendarView: ({ date1, date2, handleDate1, handleDate2, handleSelectCalenderView, }: CalenderViewProps) => JSX.Element;
6
+ declare const CalendarView: ({ date1, date2, handleDate1, handleDate2, handleSelectCalenderView, autoFocus1, autoFocus2, setAutoFocus2, setAutoFocus1, }: CalenderViewProps) => JSX.Element;
7
7
  export default CalendarView;
package/dist/esm/index.js CHANGED
@@ -18624,24 +18624,22 @@ var InputTag = function InputTag(_a) {
18624
18624
  };
18625
18625
 
18626
18626
  var CalendarView = function CalendarView(_a) {
18627
+ // const [date1, setDate1] = useState(new Date());
18628
+ // const [date2, setDate2] = useState(new Date());
18629
+ // const [autoFocus1, setAutoFocus1] = useState(true);
18630
+ // const [autoFocus2, setAutoFocus2] = useState(false);
18627
18631
  var date1 = _a.date1,
18628
18632
  date2 = _a.date2,
18629
18633
  handleDate1 = _a.handleDate1,
18630
18634
  handleDate2 = _a.handleDate2,
18631
- handleSelectCalenderView = _a.handleSelectCalenderView; // const [date1, setDate1] = useState(new Date());
18632
- // const [date2, setDate2] = useState(new Date());
18633
-
18634
- var _b = useState(true),
18635
- autoFocus1 = _b[0],
18636
- setAutoFocus1 = _b[1];
18637
-
18638
- var _c = useState(false),
18639
- autoFocus2 = _c[0],
18640
- setAutoFocus2 = _c[1]; // const [showCalender1, setShowCalender1] = useState(true);
18635
+ handleSelectCalenderView = _a.handleSelectCalenderView,
18636
+ autoFocus1 = _a.autoFocus1,
18637
+ autoFocus2 = _a.autoFocus2,
18638
+ setAutoFocus2 = _a.setAutoFocus2,
18639
+ setAutoFocus1 = _a.setAutoFocus1; // const [showCalender1, setShowCalender1] = useState(true);
18641
18640
  // const [showCalender2, setShowCalender2] = useState(false);
18642
18641
  // const [showCalender2, setShowCalender2] = useState(false);
18643
18642
 
18644
-
18645
18643
  var handleSelect1 = function handleSelect1(selectedValue) {
18646
18644
  setAutoFocus2(true);
18647
18645
  setAutoFocus1(false);
@@ -18686,7 +18684,7 @@ var CalendarView = function CalendarView(_a) {
18686
18684
  }) : jsxRuntime.exports.jsx(InputField, {
18687
18685
  className: "hplxt-text-Gray-400 ".concat(autoFocus1 ? "hplxt-border-Primary-700" : "", " hplxt-border-1 hplxt-rounded-md"),
18688
18686
  inputProps: {
18689
- value: dayjs(date1).format("DD-MMM-YYYY"),
18687
+ value: dayjs(date1).isValid() ? dayjs(date1).format("DD-MMM-YYYY") : "",
18690
18688
  autoFocus: autoFocus1,
18691
18689
  onFocus: function onFocus() {
18692
18690
  return handleFocus1();
@@ -18713,7 +18711,7 @@ var CalendarView = function CalendarView(_a) {
18713
18711
  className: "hplxt-text-Gray-400 ".concat(autoFocus2 ? "hplxt-border-Primary-700" : "", " hplxt-border-1 hplxt-rounded-md"),
18714
18712
  inputProps: {
18715
18713
  placeholder: "To Day",
18716
- value: dayjs(date2).format("DD-MMM-YYYY"),
18714
+ value: dayjs(date2).isValid() ? dayjs(date2).format("DD-MMM-YYYY") : "",
18717
18715
  autoFocus: autoFocus2,
18718
18716
  onFocus: function onFocus() {
18719
18717
  return handleFocus2();
@@ -66,6 +66,10 @@ export interface CalenderViewProps {
66
66
  handleDate1: (val: Date) => void;
67
67
  handleDate2: (val: Date) => void;
68
68
  handleSelectCalenderView?: () => void;
69
+ autoFocus1?: boolean;
70
+ autoFocus2?: boolean;
71
+ setAutoFocus1?: any;
72
+ setAutoFocus2?: any;
69
73
  }
70
74
  export interface InputFieldSplitProps {
71
75
  label?: string;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "frontend",
10
10
  "healthplix"
11
11
  ],
12
- "version": "1.1.1",
12
+ "version": "1.1.2",
13
13
  "main": "dist/esm/index.js",
14
14
  "module": "dist/esm/index.js",
15
15
  "types": "dist/esm/index.d.ts",