@blueking/date-picker 0.0.29 → 0.0.31
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/components/common-submit.vue.d.ts +15 -10
- package/dist/components/date-panel.vue.d.ts +30 -31
- package/dist/components/date-picker.vue.d.ts +16 -12
- package/dist/components/natural-picker.vue.d.ts +16 -11
- package/dist/components/panel-wrapper.vue.d.ts +20 -24
- package/dist/components/recent-picker.vue.d.ts +29 -21
- package/dist/components/timezone-picker.vue.d.ts +15 -10
- package/dist/date-picker.vue.d.ts +36 -65
- package/dist/lang/lang.d.ts +39 -32
- package/dist/typings/constant.d.ts +28 -16
- package/dist/typings/date.d.ts +36 -0
- package/dist/typings/index.d.ts +2 -0
- package/dist/typings/store.d.ts +1 -1
- package/dist/typings/types.d.ts +11 -1
- package/dist/typings/utils.d.ts +0 -31
- package/dist/vue2-full.es.js +10881 -10820
- package/dist/vue2-light.es.js +11172 -11111
- package/dist/vue3-full.es.js +10564 -10506
- package/dist/vue3-light.es.js +1345 -1287
- package/package.json +25 -21
- package/dist/test.vue.d.ts +0 -2
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { DateMode } from './index';
|
|
2
2
|
export declare const DateUnitList: readonly [{
|
|
3
3
|
readonly id: "s";
|
|
4
|
-
readonly name:
|
|
4
|
+
readonly name: string;
|
|
5
5
|
}, {
|
|
6
6
|
readonly id: "m";
|
|
7
|
-
readonly name:
|
|
7
|
+
readonly name: string;
|
|
8
8
|
}, {
|
|
9
9
|
readonly id: "h";
|
|
10
|
-
readonly name:
|
|
10
|
+
readonly name: string;
|
|
11
11
|
}, {
|
|
12
12
|
readonly id: "d";
|
|
13
|
-
readonly name:
|
|
13
|
+
readonly name: string;
|
|
14
14
|
}, {
|
|
15
15
|
readonly id: "w";
|
|
16
|
-
readonly name:
|
|
16
|
+
readonly name: string;
|
|
17
17
|
}, {
|
|
18
18
|
readonly id: "M";
|
|
19
|
-
readonly name:
|
|
19
|
+
readonly name: string;
|
|
20
20
|
}, {
|
|
21
21
|
readonly id: "y";
|
|
22
|
-
readonly name:
|
|
22
|
+
readonly name: string;
|
|
23
23
|
}];
|
|
24
24
|
export type DateUnit = (typeof DateUnitList)[number]['id'];
|
|
25
|
-
export declare const dateUnit: "
|
|
25
|
+
export declare const dateUnit: "M" | "d" | "h" | "m" | "s" | "w" | "y";
|
|
26
26
|
export declare enum NaturalOptionType {
|
|
27
27
|
custom = "custom",
|
|
28
28
|
default = "default",
|
|
@@ -30,16 +30,16 @@ export declare enum NaturalOptionType {
|
|
|
30
30
|
}
|
|
31
31
|
export declare const CommonNaturalOptions: ({
|
|
32
32
|
id: string;
|
|
33
|
-
name:
|
|
33
|
+
name: string;
|
|
34
34
|
type: NaturalOptionType;
|
|
35
35
|
prefix?: undefined;
|
|
36
36
|
suffix?: undefined;
|
|
37
37
|
unit?: undefined;
|
|
38
38
|
} | {
|
|
39
39
|
id: string;
|
|
40
|
-
name:
|
|
41
|
-
prefix:
|
|
42
|
-
suffix:
|
|
40
|
+
name: string;
|
|
41
|
+
prefix: string;
|
|
42
|
+
suffix: string;
|
|
43
43
|
type: NaturalOptionType;
|
|
44
44
|
unit: string;
|
|
45
45
|
})[];
|
|
@@ -49,18 +49,30 @@ export declare enum NaturalUnit {
|
|
|
49
49
|
}
|
|
50
50
|
export declare const naturalUnitOptions: readonly [{
|
|
51
51
|
readonly id: NaturalUnit.ALL;
|
|
52
|
-
readonly name:
|
|
52
|
+
readonly name: string;
|
|
53
53
|
}, {
|
|
54
54
|
readonly id: NaturalUnit.NOW;
|
|
55
|
-
readonly name:
|
|
55
|
+
readonly name: string;
|
|
56
56
|
}];
|
|
57
57
|
export declare const panels: {
|
|
58
58
|
id: string;
|
|
59
|
-
name:
|
|
59
|
+
name: string;
|
|
60
60
|
}[];
|
|
61
61
|
export declare const datePickTabList: {
|
|
62
62
|
id: DateMode;
|
|
63
|
-
name:
|
|
63
|
+
name: string;
|
|
64
64
|
}[];
|
|
65
65
|
export declare const getStoreKey: (key?: number | string) => string;
|
|
66
66
|
export declare const dateFormatList: string[];
|
|
67
|
+
export declare const naturalDateShortcutMap: {
|
|
68
|
+
readonly 'now/M~now/M': string;
|
|
69
|
+
readonly 'now/d~now/d': string;
|
|
70
|
+
readonly 'now/w~now/w': string;
|
|
71
|
+
readonly 'now/y~now/y': string;
|
|
72
|
+
readonly 'now-1M/M~now-1M/M': string;
|
|
73
|
+
readonly 'now-1d/d~now-1d/d': string;
|
|
74
|
+
readonly 'now-1w/w~now-1w/w': string;
|
|
75
|
+
readonly 'now-1y/y~now-1y/y': string;
|
|
76
|
+
readonly 'now-2d/d~now-2d/d': string;
|
|
77
|
+
readonly 'now-2y/y~now-2y/y': string;
|
|
78
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import dayjs, { Dayjs } from 'dayjs';
|
|
2
|
+
import { DateUnit } from './constant';
|
|
3
|
+
import { DateMode, DateValue } from './types';
|
|
4
|
+
export declare const commonDateRegexp: RegExp;
|
|
5
|
+
export declare const recentDateRegexp: RegExp;
|
|
6
|
+
export declare const futureDateRegexp: RegExp;
|
|
7
|
+
export declare const naturalDateRegexp: RegExp;
|
|
8
|
+
export declare class DateRange {
|
|
9
|
+
dateValue: DateValue;
|
|
10
|
+
format: string;
|
|
11
|
+
endDate: Dayjs | null;
|
|
12
|
+
endNum: number | undefined;
|
|
13
|
+
endUnit: DateUnit | undefined;
|
|
14
|
+
startDate: Dayjs | null;
|
|
15
|
+
startNum: number | undefined;
|
|
16
|
+
startUnit: DateUnit | undefined;
|
|
17
|
+
constructor(dateValue?: DateValue, format?: string);
|
|
18
|
+
dateDuration(): number | undefined;
|
|
19
|
+
toDisplayString(): string;
|
|
20
|
+
toEmitValue(): [
|
|
21
|
+
DateValue,
|
|
22
|
+
{
|
|
23
|
+
dayjs: Dayjs | null;
|
|
24
|
+
formatText: null | string;
|
|
25
|
+
}[]
|
|
26
|
+
];
|
|
27
|
+
transformValue2Dayjs(value: DateValue[number], type?: 'end' | 'start'): dayjs.Dayjs;
|
|
28
|
+
updateDateValue(dateValue: DateValue): void;
|
|
29
|
+
updateFormat(format: string): void;
|
|
30
|
+
get dateMode(): DateMode;
|
|
31
|
+
get isValidate(): boolean | undefined;
|
|
32
|
+
get recentOrFuturedateNum(): number | undefined;
|
|
33
|
+
get recentOrFuturedateUnit(): "M" | "d" | "h" | "m" | "s" | "w" | "y" | undefined;
|
|
34
|
+
}
|
|
35
|
+
export declare const transformValue2Dayjs: (value: DateValue[number], type?: 'end' | 'start') => dayjs.Dayjs | undefined;
|
|
36
|
+
export declare const transformDateRange2Dayjs: (dateValue: DateValue) => (dayjs.Dayjs | undefined)[];
|
package/dist/typings/index.d.ts
CHANGED
package/dist/typings/store.d.ts
CHANGED
|
@@ -11,4 +11,4 @@ export declare const getStoreDateList: (storeKey: string) => any[];
|
|
|
11
11
|
* @param storeKey store key
|
|
12
12
|
* @returns void
|
|
13
13
|
*/
|
|
14
|
-
export declare const setStoreDateList: (val: DateValue | string[], storeKey: string) => void;
|
|
14
|
+
export declare const setStoreDateList: (val: DateValue | number[] | string[], storeKey: string) => void;
|
package/dist/typings/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import dayjs, { type Dayjs } from 'dayjs';
|
|
1
2
|
import { DateUnit } from './constant';
|
|
2
3
|
export interface ICommonTabItem {
|
|
3
4
|
id: string;
|
|
@@ -16,4 +17,13 @@ export type FutureDateValue = ['now', FutureValue];
|
|
|
16
17
|
export type NaturalSelectDate = `${RecentValue}/${DateUnit}`;
|
|
17
18
|
export type NaturalDateValue = [NaturalSelectDate, 'now' | NaturalSelectDate];
|
|
18
19
|
export type CommonDateValue = [string, string];
|
|
19
|
-
export type DateValue =
|
|
20
|
+
export type DateValue = [Dayjs | number | string, Dayjs | number | string];
|
|
21
|
+
export interface IDatePickerProps {
|
|
22
|
+
behavior?: 'normal' | 'simplicity';
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
format?: string;
|
|
25
|
+
modelValue: DateValue | dayjs.Dayjs[] | number[] | string[] | undefined;
|
|
26
|
+
needTimezone?: boolean;
|
|
27
|
+
timezone?: string;
|
|
28
|
+
version?: number | string;
|
|
29
|
+
}
|
package/dist/typings/utils.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
1
|
import { ComputedRef, InjectionKey } from 'vue';
|
|
3
2
|
import { LangKey } from '../lang/lang';
|
|
4
3
|
import { ITimezoneItem } from './timezone';
|
|
5
|
-
import { DateMode, DateValue } from './types';
|
|
6
|
-
export declare const recentDateRegexp: RegExp;
|
|
7
|
-
export declare const naturalDateRegexp: RegExp;
|
|
8
|
-
export declare const commonDateRegexp: RegExp;
|
|
9
4
|
export interface IDatePickerProvider {
|
|
10
5
|
format: ComputedRef<string>;
|
|
11
6
|
storeKey: ComputedRef<string>;
|
|
@@ -15,29 +10,3 @@ export interface IDatePickerProvider {
|
|
|
15
10
|
export declare const DATE_PICKER_PROVIDER_KEY: InjectionKey<IDatePickerProvider>;
|
|
16
11
|
export declare const useDatePickerProvider: (data: IDatePickerProvider) => void;
|
|
17
12
|
export declare const useDatePickertInject: () => IDatePickerProvider | undefined;
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @param value 日期值
|
|
21
|
-
* @param format 日期格式
|
|
22
|
-
* @returns 日期值对应展示字符串
|
|
23
|
-
*/
|
|
24
|
-
export declare const getDateValueToString: (value: DateValue | undefined, format: string) => string;
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @param value 日期值
|
|
28
|
-
* @returns 日期值对应展示模式
|
|
29
|
-
*/
|
|
30
|
-
export declare const getDateValueMode: (value: DateValue | undefined) => DateMode;
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
* @param value 日期值
|
|
34
|
-
* @param format 日期格式
|
|
35
|
-
* @returns 日期值对应 dayjs 对象
|
|
36
|
-
*/
|
|
37
|
-
export declare const transformDateValueToDayjs: (value: DateValue | string[] | undefined) => dayjs.Dayjs[];
|
|
38
|
-
export declare const transformDateToDayjs: (value: string, type?: 'end' | 'start') => dayjs.Dayjs | undefined;
|
|
39
|
-
/**
|
|
40
|
-
* @param val 日期值
|
|
41
|
-
* @returns 日期值是否有效
|
|
42
|
-
*/
|
|
43
|
-
export declare const isValidDateValue: (val: DateValue | string[] | undefined) => boolean;
|