@pisell/date-picker 1.0.113 → 3.0.1
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/es/ActionBar/index.d.ts +1 -0
- package/es/CustomCalendarHeader/index.d.ts +2 -0
- package/es/DesktopDateRangePicker/DesktopDateRangePicker.d.ts +7 -0
- package/es/Dialog/index.d.ts +2 -0
- package/es/Drawer/index.d.ts +11 -0
- package/es/MobileDateRangePicker/MobileDateRangePicker.d.ts +7 -0
- package/es/PisellDateRangePicker/index.d.ts +83 -0
- package/es/PisellDateRangePicker/index.js +5 -5
- package/es/Shortcuts/index.d.ts +15 -0
- package/es/Toolbar/index.d.ts +3 -0
- package/es/browserSelect/index.d.ts +15 -0
- package/es/hooks/useDocumentVisibility.d.ts +2 -0
- package/es/hooks/useNextDay.d.ts +2 -0
- package/es/hooks/useUpdateEffect.d.ts +2 -0
- package/es/icon/ChevronLeft.d.ts +5 -0
- package/es/icon/ChevronLeftDouble.d.ts +5 -0
- package/es/icon/ChevronRight.d.ts +5 -0
- package/es/icon/ChevronRightDouble.d.ts +5 -0
- package/es/icon/CloseCircle.d.ts +5 -0
- package/es/locales/en-US.d.ts +26 -0
- package/es/locales/zh-CN.d.ts +26 -0
- package/es/locales/zh-TW.d.ts +26 -0
- package/lib/ActionBar/index.d.ts +1 -0
- package/lib/CustomCalendarHeader/index.d.ts +2 -0
- package/lib/DesktopDateRangePicker/DesktopDateRangePicker.d.ts +7 -0
- package/lib/Dialog/index.d.ts +2 -0
- package/lib/Drawer/index.d.ts +11 -0
- package/lib/MobileDateRangePicker/MobileDateRangePicker.d.ts +7 -0
- package/lib/PisellDateRangePicker/index.d.ts +83 -0
- package/lib/PisellDateRangePicker/index.js +3 -3
- package/lib/Shortcuts/index.d.ts +15 -0
- package/lib/Toolbar/index.d.ts +3 -0
- package/lib/browserSelect/index.d.ts +15 -0
- package/lib/hooks/useDocumentVisibility.d.ts +2 -0
- package/lib/hooks/useNextDay.d.ts +2 -0
- package/lib/hooks/useUpdateEffect.d.ts +2 -0
- package/lib/icon/ChevronLeft.d.ts +5 -0
- package/lib/icon/ChevronLeftDouble.d.ts +5 -0
- package/lib/icon/ChevronRight.d.ts +5 -0
- package/lib/icon/ChevronRightDouble.d.ts +5 -0
- package/lib/icon/CloseCircle.d.ts +5 -0
- package/lib/locales/en-US.d.ts +26 -0
- package/lib/locales/zh-CN.d.ts +26 -0
- package/lib/locales/zh-TW.d.ts +26 -0
- package/package.json +2 -2
package/es/ActionBar/index.d.ts
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DesktopDateRangePickerProps } from './DesktopDateRangePicker.types';
|
|
3
|
+
declare type DesktopDateRangePickerComponent = (<TDate>(props: DesktopDateRangePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
4
|
+
propTypes?: any;
|
|
5
|
+
};
|
|
6
|
+
declare const DesktopDateRangePicker: DesktopDateRangePickerComponent;
|
|
7
|
+
export { DesktopDateRangePicker };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
interface DrawerProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
height?: number;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const Drawer: (props: DrawerProps) => JSX.Element | null;
|
|
11
|
+
export default Drawer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MobileDateRangePickerProps } from './MobileDateRangePicker.types';
|
|
3
|
+
declare type MobileDateRangePickerComponent = (<TDate>(props: MobileDateRangePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
4
|
+
propTypes?: any;
|
|
5
|
+
};
|
|
6
|
+
declare const MobileDateRangePicker: MobileDateRangePickerComponent;
|
|
7
|
+
export { MobileDateRangePicker };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ButtonProps } from 'antd';
|
|
4
|
+
import { PopperPlacementType } from '@mui/base/Popper/Popper.types';
|
|
5
|
+
import { PresetType } from '../Shortcuts';
|
|
6
|
+
import 'dayjs/locale/zh-cn';
|
|
7
|
+
import 'dayjs/locale/en';
|
|
8
|
+
import 'dayjs/locale/zh-tw';
|
|
9
|
+
import './index.less';
|
|
10
|
+
export interface PisellDateRangePickerProps {
|
|
11
|
+
/** 再次选择日期时是否清除结束时间 */
|
|
12
|
+
clearEndOnSelection?: boolean;
|
|
13
|
+
/** 日期选择确认回调 */
|
|
14
|
+
onChange?: (day: (Dayjs | null)[] | string) => void;
|
|
15
|
+
/** 日期改变回调 此处只为了组件外拿到当前日期项进行状态操作 通常情况下只使用onChange来拿value */
|
|
16
|
+
onDateChange?: (day: (Dayjs | null)[]) => void;
|
|
17
|
+
/** 日期选择值 */
|
|
18
|
+
value?: Dayjs[] | string;
|
|
19
|
+
/** 日期选择默认值 */
|
|
20
|
+
defaultValue?: Dayjs[];
|
|
21
|
+
/** 快捷选择项 */
|
|
22
|
+
presets?: PresetType[];
|
|
23
|
+
/** 类名 */
|
|
24
|
+
className?: string;
|
|
25
|
+
/** 是否显示时间选择 这里参数为antd TimePickerProps */
|
|
26
|
+
showTime?: boolean | {
|
|
27
|
+
defaultValue: Dayjs;
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
}[];
|
|
30
|
+
/** 占位符 */
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
/** 是否禁用日期 */
|
|
33
|
+
disabledDate?: (day: Dayjs, position: 'start' | 'end', value: Dayjs[]) => boolean;
|
|
34
|
+
/** 日期格式 */
|
|
35
|
+
format?: string;
|
|
36
|
+
/** 后缀图标 */
|
|
37
|
+
suffixIcon?: React.ReactNode;
|
|
38
|
+
/** 是否显示边框 */
|
|
39
|
+
bordered?: boolean;
|
|
40
|
+
/** 是否打开日期选择 */
|
|
41
|
+
open?: boolean;
|
|
42
|
+
/** 关闭回调 */
|
|
43
|
+
onClose?: () => void;
|
|
44
|
+
/** 打开回调 */
|
|
45
|
+
onOpen?: () => void;
|
|
46
|
+
/** 弹窗宽度 */
|
|
47
|
+
popupWidth?: number;
|
|
48
|
+
/** 最小日期 */
|
|
49
|
+
minDate?: Dayjs;
|
|
50
|
+
/** 最大日期 */
|
|
51
|
+
maxDate?: Dayjs;
|
|
52
|
+
/** 月份切换事件 */
|
|
53
|
+
onMonthChange?: (value: Dayjs) => void;
|
|
54
|
+
/** 额外的弹出日历 className */
|
|
55
|
+
popupClassName?: string;
|
|
56
|
+
/** 默认显示月份 */
|
|
57
|
+
defaultCalendarMonth?: Dayjs;
|
|
58
|
+
/** ok 按钮 props */
|
|
59
|
+
okButtonProps?: ButtonProps;
|
|
60
|
+
/** cancel 按钮 props */
|
|
61
|
+
cancelButtonProps?: ButtonProps;
|
|
62
|
+
/**
|
|
63
|
+
* CSS media query when `Mobile` mode will be changed to `Desktop`.
|
|
64
|
+
* @default '@media (pointer: fine)'
|
|
65
|
+
* @example '@media (min-width: 720px)' or theme.breakpoints.up("sm")
|
|
66
|
+
*/
|
|
67
|
+
desktopModeMediaQuery?: string;
|
|
68
|
+
style?: React.CSSProperties;
|
|
69
|
+
/** 是否展示清除按钮 */
|
|
70
|
+
allowClear?: boolean;
|
|
71
|
+
/** true 将弹窗当前DOM层次结构下 false 追加到body */
|
|
72
|
+
disablePortal?: boolean;
|
|
73
|
+
/** 弹窗放置位置 */
|
|
74
|
+
placement?: PopperPlacementType;
|
|
75
|
+
/** 输入框只读 */
|
|
76
|
+
inputReadOnly: boolean;
|
|
77
|
+
/** 使用快捷筛选时返回快捷字符串 */
|
|
78
|
+
returnShortcutString?: boolean;
|
|
79
|
+
isHideCustomSelect?: boolean;
|
|
80
|
+
endDateDays?: number;
|
|
81
|
+
}
|
|
82
|
+
declare const PisellDateRangePicker: (props: PisellDateRangePickerProps) => JSX.Element;
|
|
83
|
+
export default PisellDateRangePicker;
|
|
@@ -85,8 +85,8 @@ var PisellDateRangePicker = function PisellDateRangePicker(props) {
|
|
|
85
85
|
returnShortcutString = _props$returnShortcut === void 0 ? false : _props$returnShortcut,
|
|
86
86
|
_props$isHideCustomSe = props.isHideCustomSelect,
|
|
87
87
|
isHideCustomSelect = _props$isHideCustomSe === void 0 ? false : _props$isHideCustomSe,
|
|
88
|
-
_props$
|
|
89
|
-
|
|
88
|
+
_props$endDateDays = props.endDateDays,
|
|
89
|
+
endDateDays = _props$endDateDays === void 0 ? 0 : _props$endDateDays;
|
|
90
90
|
var _useState = useState(propsOpen !== null && propsOpen !== void 0 ? propsOpen : false),
|
|
91
91
|
_useState2 = _slicedToArray(_useState, 2),
|
|
92
92
|
open = _useState2[0],
|
|
@@ -168,9 +168,9 @@ var PisellDateRangePicker = function PisellDateRangePicker(props) {
|
|
|
168
168
|
if (rangePosition === 'start') {
|
|
169
169
|
newVal = [newVal[0], newVal[0]];
|
|
170
170
|
|
|
171
|
-
//
|
|
172
|
-
if (
|
|
173
|
-
newVal = [newVal[0], dayjs(newVal[0]).add(
|
|
171
|
+
// 默认结束日期为开始日期加n天
|
|
172
|
+
if (endDateDays) {
|
|
173
|
+
newVal = [newVal[0], dayjs(newVal[0]).add(endDateDays, 'day')];
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
if (!newVal[1]) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./index.less";
|
|
2
|
+
import { Dayjs } from "dayjs";
|
|
3
|
+
export declare type PresetType = {
|
|
4
|
+
label?: string;
|
|
5
|
+
getValue?: () => [Dayjs, Dayjs];
|
|
6
|
+
value: [Dayjs, Dayjs] | "today" | "yesterday" | "last_3_days" | "last_7_days" | "last_30_days" | "last_90_days" | "last_180_days" | "tomorrow" | "next_3_days" | "next_7_days" | "next_30_days" | "next_90_days" | "next_180_days";
|
|
7
|
+
key?: string;
|
|
8
|
+
};
|
|
9
|
+
interface ShortcutsProps {
|
|
10
|
+
items: PresetType[];
|
|
11
|
+
onChange: (day: [Dayjs, Dayjs], changeImportance?: "accept" | "set") => void;
|
|
12
|
+
changeImportance?: "accept" | "set";
|
|
13
|
+
}
|
|
14
|
+
declare const Shortcuts: (props: ShortcutsProps) => JSX.Element | null;
|
|
15
|
+
export default Shortcuts;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
interface BrowserSelectProps extends React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement> {
|
|
4
|
+
options: any[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @title: 系统级别的下拉框
|
|
8
|
+
* @description:
|
|
9
|
+
* @param {BrowserSelectProps} props
|
|
10
|
+
* @return {*}
|
|
11
|
+
* @Author: zhiwei.Wang
|
|
12
|
+
* @Date: 2024-01-30 16:43
|
|
13
|
+
*/
|
|
14
|
+
declare const BrowserSelect: (props: BrowserSelectProps) => JSX.Element;
|
|
15
|
+
export default BrowserSelect;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'action-bar-cancel': string;
|
|
3
|
+
'action-bar-apply': string;
|
|
4
|
+
'action-bar-start.time': string;
|
|
5
|
+
'action-bar-end.time': string;
|
|
6
|
+
'toolbar-date-range-shortcut-custom': string;
|
|
7
|
+
"toolbar-date-range-shortcut-date-range": string;
|
|
8
|
+
"toolbar-date-range-shortcut-starting": string;
|
|
9
|
+
"toolbar-date-range-shortcut-ending": string;
|
|
10
|
+
"toolbar-date-range-shortcut-today": string;
|
|
11
|
+
"toolbar-date-range-shortcut-yesterday": string;
|
|
12
|
+
"toolbar-date-range-shortcut-tomorrow": string;
|
|
13
|
+
"toolbar-date-range-shortcut-last-3-days": string;
|
|
14
|
+
"toolbar-date-range-shortcut-last-7-days": string;
|
|
15
|
+
"toolbar-date-range-shortcut-last-30-days": string;
|
|
16
|
+
"toolbar-date-range-shortcut-last-90-days": string;
|
|
17
|
+
"toolbar-date-range-shortcut-last-180-days": string;
|
|
18
|
+
"toolbar-date-range-shortcut-next-3-days": string;
|
|
19
|
+
"toolbar-date-range-shortcut-next-7-days": string;
|
|
20
|
+
"toolbar-date-range-shortcut-next-30-days": string;
|
|
21
|
+
"toolbar-date-range-shortcut-next-90-days": string;
|
|
22
|
+
"toolbar-date-range-shortcut-next-180-days": string;
|
|
23
|
+
"toolbar-date-range-invalid-start-date": string;
|
|
24
|
+
"toolbar-date-range-invalid-end-date": string;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"action-bar-cancel": string;
|
|
3
|
+
"action-bar-apply": string;
|
|
4
|
+
"action-bar-start.time": string;
|
|
5
|
+
"action-bar-end.time": string;
|
|
6
|
+
"toolbar-date-range-shortcut-date-range": string;
|
|
7
|
+
"toolbar-date-range-shortcut-starting": string;
|
|
8
|
+
"toolbar-date-range-shortcut-ending": string;
|
|
9
|
+
"toolbar-date-range-shortcut-custom": string;
|
|
10
|
+
"toolbar-date-range-shortcut-today": string;
|
|
11
|
+
"toolbar-date-range-shortcut-yesterday": string;
|
|
12
|
+
"toolbar-date-range-shortcut-tomorrow": string;
|
|
13
|
+
"toolbar-date-range-shortcut-last-3-days": string;
|
|
14
|
+
"toolbar-date-range-shortcut-last-7-days": string;
|
|
15
|
+
"toolbar-date-range-shortcut-last-30-days": string;
|
|
16
|
+
"toolbar-date-range-shortcut-last-90-days": string;
|
|
17
|
+
"toolbar-date-range-shortcut-last-180-days": string;
|
|
18
|
+
"toolbar-date-range-shortcut-next-3-days": string;
|
|
19
|
+
"toolbar-date-range-shortcut-next-7-days": string;
|
|
20
|
+
"toolbar-date-range-shortcut-next-30-days": string;
|
|
21
|
+
"toolbar-date-range-shortcut-next-90-days": string;
|
|
22
|
+
"toolbar-date-range-shortcut-next-180-days": string;
|
|
23
|
+
"toolbar-date-range-invalid-start-date": string;
|
|
24
|
+
"toolbar-date-range-invalid-end-date": string;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'action-bar-cancel': string;
|
|
3
|
+
'action-bar-apply': string;
|
|
4
|
+
'action-bar-start.time': string;
|
|
5
|
+
'action-bar-end.time': string;
|
|
6
|
+
'toolbar-date-range-shortcut-custom': string;
|
|
7
|
+
"toolbar-date-range-shortcut-date-range": string;
|
|
8
|
+
"toolbar-date-range-shortcut-starting": string;
|
|
9
|
+
"toolbar-date-range-shortcut-ending": string;
|
|
10
|
+
"toolbar-date-range-shortcut-today": string;
|
|
11
|
+
"toolbar-date-range-shortcut-yesterday": string;
|
|
12
|
+
"toolbar-date-range-shortcut-tomorrow": string;
|
|
13
|
+
"toolbar-date-range-shortcut-last-3-days": string;
|
|
14
|
+
"toolbar-date-range-shortcut-last-7-days": string;
|
|
15
|
+
"toolbar-date-range-shortcut-last-30-days": string;
|
|
16
|
+
"toolbar-date-range-shortcut-last-90-days": string;
|
|
17
|
+
"toolbar-date-range-shortcut-last-180-days": string;
|
|
18
|
+
"toolbar-date-range-shortcut-next-3-days": string;
|
|
19
|
+
"toolbar-date-range-shortcut-next-7-days": string;
|
|
20
|
+
"toolbar-date-range-shortcut-next-30-days": string;
|
|
21
|
+
"toolbar-date-range-shortcut-next-90-days": string;
|
|
22
|
+
"toolbar-date-range-shortcut-next-180-days": string;
|
|
23
|
+
"toolbar-date-range-invalid-start-date": string;
|
|
24
|
+
"toolbar-date-range-invalid-end-date": string;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
package/lib/ActionBar/index.d.ts
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DesktopDateRangePickerProps } from './DesktopDateRangePicker.types';
|
|
3
|
+
declare type DesktopDateRangePickerComponent = (<TDate>(props: DesktopDateRangePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
4
|
+
propTypes?: any;
|
|
5
|
+
};
|
|
6
|
+
declare const DesktopDateRangePicker: DesktopDateRangePickerComponent;
|
|
7
|
+
export { DesktopDateRangePicker };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
interface DrawerProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
height?: number;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const Drawer: (props: DrawerProps) => JSX.Element | null;
|
|
11
|
+
export default Drawer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MobileDateRangePickerProps } from './MobileDateRangePicker.types';
|
|
3
|
+
declare type MobileDateRangePickerComponent = (<TDate>(props: MobileDateRangePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
4
|
+
propTypes?: any;
|
|
5
|
+
};
|
|
6
|
+
declare const MobileDateRangePicker: MobileDateRangePickerComponent;
|
|
7
|
+
export { MobileDateRangePicker };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ButtonProps } from 'antd';
|
|
4
|
+
import { PopperPlacementType } from '@mui/base/Popper/Popper.types';
|
|
5
|
+
import { PresetType } from '../Shortcuts';
|
|
6
|
+
import 'dayjs/locale/zh-cn';
|
|
7
|
+
import 'dayjs/locale/en';
|
|
8
|
+
import 'dayjs/locale/zh-tw';
|
|
9
|
+
import './index.less';
|
|
10
|
+
export interface PisellDateRangePickerProps {
|
|
11
|
+
/** 再次选择日期时是否清除结束时间 */
|
|
12
|
+
clearEndOnSelection?: boolean;
|
|
13
|
+
/** 日期选择确认回调 */
|
|
14
|
+
onChange?: (day: (Dayjs | null)[] | string) => void;
|
|
15
|
+
/** 日期改变回调 此处只为了组件外拿到当前日期项进行状态操作 通常情况下只使用onChange来拿value */
|
|
16
|
+
onDateChange?: (day: (Dayjs | null)[]) => void;
|
|
17
|
+
/** 日期选择值 */
|
|
18
|
+
value?: Dayjs[] | string;
|
|
19
|
+
/** 日期选择默认值 */
|
|
20
|
+
defaultValue?: Dayjs[];
|
|
21
|
+
/** 快捷选择项 */
|
|
22
|
+
presets?: PresetType[];
|
|
23
|
+
/** 类名 */
|
|
24
|
+
className?: string;
|
|
25
|
+
/** 是否显示时间选择 这里参数为antd TimePickerProps */
|
|
26
|
+
showTime?: boolean | {
|
|
27
|
+
defaultValue: Dayjs;
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
}[];
|
|
30
|
+
/** 占位符 */
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
/** 是否禁用日期 */
|
|
33
|
+
disabledDate?: (day: Dayjs, position: 'start' | 'end', value: Dayjs[]) => boolean;
|
|
34
|
+
/** 日期格式 */
|
|
35
|
+
format?: string;
|
|
36
|
+
/** 后缀图标 */
|
|
37
|
+
suffixIcon?: React.ReactNode;
|
|
38
|
+
/** 是否显示边框 */
|
|
39
|
+
bordered?: boolean;
|
|
40
|
+
/** 是否打开日期选择 */
|
|
41
|
+
open?: boolean;
|
|
42
|
+
/** 关闭回调 */
|
|
43
|
+
onClose?: () => void;
|
|
44
|
+
/** 打开回调 */
|
|
45
|
+
onOpen?: () => void;
|
|
46
|
+
/** 弹窗宽度 */
|
|
47
|
+
popupWidth?: number;
|
|
48
|
+
/** 最小日期 */
|
|
49
|
+
minDate?: Dayjs;
|
|
50
|
+
/** 最大日期 */
|
|
51
|
+
maxDate?: Dayjs;
|
|
52
|
+
/** 月份切换事件 */
|
|
53
|
+
onMonthChange?: (value: Dayjs) => void;
|
|
54
|
+
/** 额外的弹出日历 className */
|
|
55
|
+
popupClassName?: string;
|
|
56
|
+
/** 默认显示月份 */
|
|
57
|
+
defaultCalendarMonth?: Dayjs;
|
|
58
|
+
/** ok 按钮 props */
|
|
59
|
+
okButtonProps?: ButtonProps;
|
|
60
|
+
/** cancel 按钮 props */
|
|
61
|
+
cancelButtonProps?: ButtonProps;
|
|
62
|
+
/**
|
|
63
|
+
* CSS media query when `Mobile` mode will be changed to `Desktop`.
|
|
64
|
+
* @default '@media (pointer: fine)'
|
|
65
|
+
* @example '@media (min-width: 720px)' or theme.breakpoints.up("sm")
|
|
66
|
+
*/
|
|
67
|
+
desktopModeMediaQuery?: string;
|
|
68
|
+
style?: React.CSSProperties;
|
|
69
|
+
/** 是否展示清除按钮 */
|
|
70
|
+
allowClear?: boolean;
|
|
71
|
+
/** true 将弹窗当前DOM层次结构下 false 追加到body */
|
|
72
|
+
disablePortal?: boolean;
|
|
73
|
+
/** 弹窗放置位置 */
|
|
74
|
+
placement?: PopperPlacementType;
|
|
75
|
+
/** 输入框只读 */
|
|
76
|
+
inputReadOnly: boolean;
|
|
77
|
+
/** 使用快捷筛选时返回快捷字符串 */
|
|
78
|
+
returnShortcutString?: boolean;
|
|
79
|
+
isHideCustomSelect?: boolean;
|
|
80
|
+
endDateDays?: number;
|
|
81
|
+
}
|
|
82
|
+
declare const PisellDateRangePicker: (props: PisellDateRangePickerProps) => JSX.Element;
|
|
83
|
+
export default PisellDateRangePicker;
|
|
@@ -99,7 +99,7 @@ var PisellDateRangePicker = (props) => {
|
|
|
99
99
|
inputReadOnly = true,
|
|
100
100
|
returnShortcutString = false,
|
|
101
101
|
isHideCustomSelect = false,
|
|
102
|
-
|
|
102
|
+
endDateDays = 0
|
|
103
103
|
} = props;
|
|
104
104
|
const [open, setOpen] = (0, import_react.useState)(propsOpen ?? false);
|
|
105
105
|
const { locale } = (0, import_react.useContext)(import_LocaleContext.LocaleContext) || {};
|
|
@@ -166,8 +166,8 @@ var PisellDateRangePicker = (props) => {
|
|
|
166
166
|
if (!clearEndOnSelection && !["time", "write", "shortcuts"].includes(type)) {
|
|
167
167
|
if (rangePosition === "start") {
|
|
168
168
|
newVal = [newVal[0], newVal[0]];
|
|
169
|
-
if (
|
|
170
|
-
newVal = [newVal[0], (0, import_dayjs.default)(newVal[0]).add(
|
|
169
|
+
if (endDateDays) {
|
|
170
|
+
newVal = [newVal[0], (0, import_dayjs.default)(newVal[0]).add(endDateDays, "day")];
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
if (!newVal[1]) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./index.less";
|
|
2
|
+
import { Dayjs } from "dayjs";
|
|
3
|
+
export declare type PresetType = {
|
|
4
|
+
label?: string;
|
|
5
|
+
getValue?: () => [Dayjs, Dayjs];
|
|
6
|
+
value: [Dayjs, Dayjs] | "today" | "yesterday" | "last_3_days" | "last_7_days" | "last_30_days" | "last_90_days" | "last_180_days" | "tomorrow" | "next_3_days" | "next_7_days" | "next_30_days" | "next_90_days" | "next_180_days";
|
|
7
|
+
key?: string;
|
|
8
|
+
};
|
|
9
|
+
interface ShortcutsProps {
|
|
10
|
+
items: PresetType[];
|
|
11
|
+
onChange: (day: [Dayjs, Dayjs], changeImportance?: "accept" | "set") => void;
|
|
12
|
+
changeImportance?: "accept" | "set";
|
|
13
|
+
}
|
|
14
|
+
declare const Shortcuts: (props: ShortcutsProps) => JSX.Element | null;
|
|
15
|
+
export default Shortcuts;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
interface BrowserSelectProps extends React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement> {
|
|
4
|
+
options: any[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @title: 系统级别的下拉框
|
|
8
|
+
* @description:
|
|
9
|
+
* @param {BrowserSelectProps} props
|
|
10
|
+
* @return {*}
|
|
11
|
+
* @Author: zhiwei.Wang
|
|
12
|
+
* @Date: 2024-01-30 16:43
|
|
13
|
+
*/
|
|
14
|
+
declare const BrowserSelect: (props: BrowserSelectProps) => JSX.Element;
|
|
15
|
+
export default BrowserSelect;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'action-bar-cancel': string;
|
|
3
|
+
'action-bar-apply': string;
|
|
4
|
+
'action-bar-start.time': string;
|
|
5
|
+
'action-bar-end.time': string;
|
|
6
|
+
'toolbar-date-range-shortcut-custom': string;
|
|
7
|
+
"toolbar-date-range-shortcut-date-range": string;
|
|
8
|
+
"toolbar-date-range-shortcut-starting": string;
|
|
9
|
+
"toolbar-date-range-shortcut-ending": string;
|
|
10
|
+
"toolbar-date-range-shortcut-today": string;
|
|
11
|
+
"toolbar-date-range-shortcut-yesterday": string;
|
|
12
|
+
"toolbar-date-range-shortcut-tomorrow": string;
|
|
13
|
+
"toolbar-date-range-shortcut-last-3-days": string;
|
|
14
|
+
"toolbar-date-range-shortcut-last-7-days": string;
|
|
15
|
+
"toolbar-date-range-shortcut-last-30-days": string;
|
|
16
|
+
"toolbar-date-range-shortcut-last-90-days": string;
|
|
17
|
+
"toolbar-date-range-shortcut-last-180-days": string;
|
|
18
|
+
"toolbar-date-range-shortcut-next-3-days": string;
|
|
19
|
+
"toolbar-date-range-shortcut-next-7-days": string;
|
|
20
|
+
"toolbar-date-range-shortcut-next-30-days": string;
|
|
21
|
+
"toolbar-date-range-shortcut-next-90-days": string;
|
|
22
|
+
"toolbar-date-range-shortcut-next-180-days": string;
|
|
23
|
+
"toolbar-date-range-invalid-start-date": string;
|
|
24
|
+
"toolbar-date-range-invalid-end-date": string;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"action-bar-cancel": string;
|
|
3
|
+
"action-bar-apply": string;
|
|
4
|
+
"action-bar-start.time": string;
|
|
5
|
+
"action-bar-end.time": string;
|
|
6
|
+
"toolbar-date-range-shortcut-date-range": string;
|
|
7
|
+
"toolbar-date-range-shortcut-starting": string;
|
|
8
|
+
"toolbar-date-range-shortcut-ending": string;
|
|
9
|
+
"toolbar-date-range-shortcut-custom": string;
|
|
10
|
+
"toolbar-date-range-shortcut-today": string;
|
|
11
|
+
"toolbar-date-range-shortcut-yesterday": string;
|
|
12
|
+
"toolbar-date-range-shortcut-tomorrow": string;
|
|
13
|
+
"toolbar-date-range-shortcut-last-3-days": string;
|
|
14
|
+
"toolbar-date-range-shortcut-last-7-days": string;
|
|
15
|
+
"toolbar-date-range-shortcut-last-30-days": string;
|
|
16
|
+
"toolbar-date-range-shortcut-last-90-days": string;
|
|
17
|
+
"toolbar-date-range-shortcut-last-180-days": string;
|
|
18
|
+
"toolbar-date-range-shortcut-next-3-days": string;
|
|
19
|
+
"toolbar-date-range-shortcut-next-7-days": string;
|
|
20
|
+
"toolbar-date-range-shortcut-next-30-days": string;
|
|
21
|
+
"toolbar-date-range-shortcut-next-90-days": string;
|
|
22
|
+
"toolbar-date-range-shortcut-next-180-days": string;
|
|
23
|
+
"toolbar-date-range-invalid-start-date": string;
|
|
24
|
+
"toolbar-date-range-invalid-end-date": string;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'action-bar-cancel': string;
|
|
3
|
+
'action-bar-apply': string;
|
|
4
|
+
'action-bar-start.time': string;
|
|
5
|
+
'action-bar-end.time': string;
|
|
6
|
+
'toolbar-date-range-shortcut-custom': string;
|
|
7
|
+
"toolbar-date-range-shortcut-date-range": string;
|
|
8
|
+
"toolbar-date-range-shortcut-starting": string;
|
|
9
|
+
"toolbar-date-range-shortcut-ending": string;
|
|
10
|
+
"toolbar-date-range-shortcut-today": string;
|
|
11
|
+
"toolbar-date-range-shortcut-yesterday": string;
|
|
12
|
+
"toolbar-date-range-shortcut-tomorrow": string;
|
|
13
|
+
"toolbar-date-range-shortcut-last-3-days": string;
|
|
14
|
+
"toolbar-date-range-shortcut-last-7-days": string;
|
|
15
|
+
"toolbar-date-range-shortcut-last-30-days": string;
|
|
16
|
+
"toolbar-date-range-shortcut-last-90-days": string;
|
|
17
|
+
"toolbar-date-range-shortcut-last-180-days": string;
|
|
18
|
+
"toolbar-date-range-shortcut-next-3-days": string;
|
|
19
|
+
"toolbar-date-range-shortcut-next-7-days": string;
|
|
20
|
+
"toolbar-date-range-shortcut-next-30-days": string;
|
|
21
|
+
"toolbar-date-range-shortcut-next-90-days": string;
|
|
22
|
+
"toolbar-date-range-shortcut-next-180-days": string;
|
|
23
|
+
"toolbar-date-range-invalid-start-date": string;
|
|
24
|
+
"toolbar-date-range-invalid-end-date": string;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/date-picker",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.less"
|
|
6
6
|
],
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"antd": "^5.5.0",
|
|
27
27
|
"react": "^18.0.0",
|
|
28
28
|
"react-dom": "^18.0.0",
|
|
29
|
-
"@pisell/utils": "1.0.
|
|
29
|
+
"@pisell/utils": "1.0.42"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"es",
|