akanjs 2.1.0-rc.4 → 2.1.0-rc.6
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/package.json +1 -1
- package/ui/DatePicker.tsx +7 -6
- package/ui/Refresh.tsx +3 -1
package/package.json
CHANGED
package/ui/DatePicker.tsx
CHANGED
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
import { type Dayjs, dayjs } from "akanjs/base";
|
|
3
3
|
import { clsx, msg } from "akanjs/client";
|
|
4
4
|
import { lazy } from "akanjs/webkit";
|
|
5
|
-
import { useEffect, useRef } from "react";
|
|
5
|
+
import { type FocusEvent, useEffect, useRef } from "react";
|
|
6
6
|
import { AiOutlineSwapRight } from "react-icons/ai";
|
|
7
7
|
|
|
8
|
+
const reactDatePickerPackage = "react-datepicker";
|
|
8
9
|
const reactDatePickerStylePath = "react-datepicker/dist/react-datepicker.css";
|
|
9
10
|
|
|
10
11
|
const ReactDatePicker = lazy(
|
|
11
12
|
async () => {
|
|
12
|
-
await import(
|
|
13
|
-
return import(
|
|
13
|
+
await import(reactDatePickerStylePath);
|
|
14
|
+
return import(reactDatePickerPackage);
|
|
14
15
|
},
|
|
15
16
|
{ ssr: false },
|
|
16
17
|
);
|
|
@@ -58,7 +59,7 @@ export const DatePicker = ({
|
|
|
58
59
|
className={clsx("input text-center", className)}
|
|
59
60
|
selected={value ? value.toDate() : new Date()}
|
|
60
61
|
disabledKeyboardNavigation
|
|
61
|
-
onFocus={(e) => {
|
|
62
|
+
onFocus={(e: FocusEvent<HTMLInputElement>) => {
|
|
62
63
|
|
|
63
64
|
if (clickNum.current % 2 === 0) e.target.blur();
|
|
64
65
|
clickNum.current++;
|
|
@@ -67,7 +68,7 @@ export const DatePicker = ({
|
|
|
67
68
|
showTimeSelect={showTime}
|
|
68
69
|
popperPlacement={placement}
|
|
69
70
|
timeIntervals={timeIntervals}
|
|
70
|
-
filterDate={(date) => (!disabledDate?.(dayjs(date)) ? true : false)}
|
|
71
|
+
filterDate={(date: Date) => (!disabledDate?.(dayjs(date)) ? true : false)}
|
|
71
72
|
dateFormat={format}
|
|
72
73
|
/>
|
|
73
74
|
);
|
|
@@ -119,7 +120,7 @@ const RangePicker = ({
|
|
|
119
120
|
onChange={handleStartDateChange}
|
|
120
121
|
showTimeSelect={showTime}
|
|
121
122
|
timeIntervals={timeIntervals}
|
|
122
|
-
filterDate={(date) => (!disabledDate?.(dayjs(date)) ? true : false)}
|
|
123
|
+
filterDate={(date: Date) => (!disabledDate?.(dayjs(date)) ? true : false)}
|
|
123
124
|
dateFormat={format}
|
|
124
125
|
/>
|
|
125
126
|
<AiOutlineSwapRight className="text-3xl text-gray-400" />
|
package/ui/Refresh.tsx
CHANGED
|
@@ -3,7 +3,9 @@ import { lazy } from "akanjs/webkit";
|
|
|
3
3
|
import type { ReactElement } from "react";
|
|
4
4
|
import { BiLoaderAlt } from "react-icons/bi";
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const pullToRefreshPackage = "react-simple-pull-to-refresh";
|
|
7
|
+
|
|
8
|
+
const PullToRefresh = lazy(() => import(pullToRefreshPackage), { ssr: false });
|
|
7
9
|
|
|
8
10
|
interface RefreshProps {
|
|
9
11
|
children: ReactElement;
|