sprint-asia-custom-component 0.1.73 → 0.1.74
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.
- package/dist/index.js +5 -2
- package/package.json +1 -1
- package/src/components/datepicker/index.js +33 -37
package/dist/index.js
CHANGED
|
@@ -23816,14 +23816,17 @@
|
|
|
23816
23816
|
endDate,
|
|
23817
23817
|
onChangeEndDate,
|
|
23818
23818
|
isRequired,
|
|
23819
|
-
title
|
|
23819
|
+
title,
|
|
23820
|
+
className
|
|
23820
23821
|
}) => {
|
|
23821
23822
|
const onChange = dates => {
|
|
23822
23823
|
const [start, end] = dates;
|
|
23823
23824
|
onChangeStartDate(start);
|
|
23824
23825
|
onChangeEndDate(end);
|
|
23825
23826
|
};
|
|
23826
|
-
return /*#__PURE__*/React__default["default"].createElement("div",
|
|
23827
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
23828
|
+
className: `w-full ${className}`
|
|
23829
|
+
}, title && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
23827
23830
|
className: "flex"
|
|
23828
23831
|
}, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
23829
23832
|
className: "text-sm font-normal text-black mb-1"
|
package/package.json
CHANGED
|
@@ -1,46 +1,42 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import DatePicker from "react-datepicker";
|
|
3
|
-
import
|
|
3
|
+
import "react-datepicker/dist/react-datepicker.css";
|
|
4
4
|
import { PiCalendarBlankDuotone } from "react-icons/pi";
|
|
5
5
|
|
|
6
|
-
const CustomDatePicker = ({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
onChangeEndDate
|
|
11
|
-
|
|
12
|
-
title
|
|
13
|
-
}) => {
|
|
14
|
-
const onChange = (dates) => {
|
|
15
|
-
const [start, end] = dates
|
|
16
|
-
onChangeStartDate(start)
|
|
17
|
-
onChangeEndDate(end)
|
|
18
|
-
};
|
|
6
|
+
const CustomDatePicker = ({ startDate, onChangeStartDate, endDate, onChangeEndDate, isRequired, title, className }) => {
|
|
7
|
+
const onChange = (dates) => {
|
|
8
|
+
const [start, end] = dates;
|
|
9
|
+
onChangeStartDate(start);
|
|
10
|
+
onChangeEndDate(end);
|
|
11
|
+
};
|
|
19
12
|
|
|
20
13
|
return (
|
|
21
|
-
<div>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</div>
|
|
27
|
-
)}
|
|
28
|
-
<div className="cursor-pointer py-1 border border-neutral40 bg-neutral20 rounded-md w-fit flex items-center">
|
|
29
|
-
<div className="p-2">
|
|
30
|
-
<PiCalendarBlankDuotone size={16} className="text-neutral300"/>
|
|
31
|
-
</div>
|
|
32
|
-
<DatePicker
|
|
33
|
-
selected={startDate}
|
|
34
|
-
onChange={onChange}
|
|
35
|
-
startDate={startDate}
|
|
36
|
-
endDate={endDate}
|
|
37
|
-
selectsRange
|
|
38
|
-
utcOffset={0}
|
|
39
|
-
dateFormat="d MMM yyyy"
|
|
40
|
-
className="cursor-pointer bg-neutral20 text-neutral300 rounded-md pr-2 focus:outline-none text-sm"
|
|
41
|
-
/>
|
|
14
|
+
<div className={`w-full ${className}`}>
|
|
15
|
+
{title && (
|
|
16
|
+
<div className="flex">
|
|
17
|
+
<p className="text-sm font-normal text-black mb-1">{title}</p>
|
|
18
|
+
{isRequired && <p className="text-sm font-normal text-danger500 ml-1">*</p>}
|
|
42
19
|
</div>
|
|
20
|
+
)}
|
|
21
|
+
|
|
22
|
+
<div className="cursor-pointer py-1 border border-neutral40 bg-neutral20 rounded-md w-fit flex items-center">
|
|
23
|
+
<div className="p-2">
|
|
24
|
+
<PiCalendarBlankDuotone size={16} className="text-neutral300" />
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<DatePicker
|
|
28
|
+
selected={startDate}
|
|
29
|
+
onChange={onChange}
|
|
30
|
+
startDate={startDate}
|
|
31
|
+
endDate={endDate}
|
|
32
|
+
selectsRange
|
|
33
|
+
utcOffset={0}
|
|
34
|
+
dateFormat="d MMM yyyy"
|
|
35
|
+
className="cursor-pointer bg-neutral20 text-neutral300 rounded-md pr-2 focus:outline-none text-sm"
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
43
38
|
</div>
|
|
44
|
-
)
|
|
39
|
+
);
|
|
40
|
+
};
|
|
45
41
|
|
|
46
|
-
export default CustomDatePicker;
|
|
42
|
+
export default CustomDatePicker;
|