@blueking/date-picker 2.0.0-beta.15 → 2.0.0-beta.16

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/date-picker",
3
- "version": "2.0.0-beta.15",
3
+ "version": "2.0.0-beta.16",
4
4
  "description": "蓝鲸监控平台日期时间选择",
5
5
  "license": "MIT",
6
6
  "author": "Tencent BlueKing",
@@ -0,0 +1,33 @@
1
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
2
+ modelValue: string;
3
+ }>, {
4
+ modelValue: string;
5
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ "update:modelValue": (value: string) => void;
7
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
8
+ modelValue: string;
9
+ }>, {
10
+ modelValue: string;
11
+ }>>> & {
12
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
13
+ }, {
14
+ modelValue: string;
15
+ }, {}>;
16
+ export default _default;
17
+ type __VLS_WithDefaults<P, D> = {
18
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
19
+ default: D[K];
20
+ }> : P[K];
21
+ };
22
+ type __VLS_Prettify<T> = {
23
+ [K in keyof T]: T[K];
24
+ } & {};
25
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
26
+ type __VLS_TypePropsToOption<T> = {
27
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
28
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
29
+ } : {
30
+ type: import('vue').PropType<T[K]>;
31
+ required: true;
32
+ };
33
+ };
@@ -1,5 +1,5 @@
1
- import type { PropType } from 'vue';
2
1
  import type { ICommonTabItem } from '../utils';
2
+ import type { PropType } from 'vue';
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  /** modelValue 选中的tab */
5
5
  modelValue: {
@@ -14,20 +14,24 @@ interface Props {
14
14
  */
15
15
  minDate?: Dayjs;
16
16
  modelValue?: Dayjs;
17
+ showTitle?: boolean;
17
18
  title?: string;
18
19
  }
19
20
  declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
20
21
  format: string;
22
+ showTitle: boolean;
21
23
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
22
24
  "update:modelValue": (date: dayjs.Dayjs) => void;
23
25
  "update:isNow": (args_0: boolean) => void;
24
26
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
25
27
  format: string;
28
+ showTitle: boolean;
26
29
  }>>> & {
27
30
  "onUpdate:modelValue"?: ((date: dayjs.Dayjs) => any) | undefined;
28
31
  "onUpdate:isNow"?: ((args_0: boolean) => any) | undefined;
29
32
  }, {
30
33
  format: string;
34
+ showTitle: boolean;
31
35
  }, {}>;
32
36
  export default _default;
33
37
  type __VLS_WithDefaults<P, D> = {
@@ -1,6 +1,7 @@
1
1
  import { DateMode, type FutureDateValue, type RecentDateValue } from '../utils';
2
2
  import { DateRange } from '../utils/date';
3
3
  interface IProps {
4
+ baselineTime?: string;
4
5
  type: DateMode.FUTURE | DateMode.RECENT;
5
6
  value?: DateRange;
6
7
  }
@@ -36,6 +36,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
36
36
  needTimezone: boolean;
37
37
  }, {}>;
38
38
  export default _default;
39
+
39
40
  type __VLS_WithDefaults<P, D> = {
40
41
  [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
41
42
  default: D[K];
@@ -1,5 +1,5 @@
1
- import { Dayjs } from 'dayjs';
2
1
  import { Ref } from 'vue';
2
+ import { Dayjs } from 'dayjs';
3
3
  import { DateValue } from '../utils';
4
4
  import { DateRange } from '../utils/date';
5
5
  export declare const useValidate: () => {
@@ -1,13 +1,17 @@
1
1
  export declare const naturalDateLangData: {
2
+ readonly 'N \u5929\u524D': "N days ago";
2
3
  readonly 上周: "Last week";
3
4
  readonly 上月: "Last month";
4
5
  readonly 今天: "Today";
5
6
  readonly 今年: "This year";
7
+ readonly 具体时间: "Specific time";
6
8
  readonly '\u524D N \u5468': "Previous N weeks";
7
9
  readonly '\u524D N \u5929': "Previous N days";
8
10
  readonly 前天: "The day before yesterday";
9
11
  readonly 前年: "The year before last";
10
12
  readonly 去年: "Last year";
13
+ readonly 基于: "Based on";
14
+ readonly 天前: "days ago";
11
15
  readonly 昨天: "Yesterday";
12
16
  readonly 本周: "This week";
13
17
  readonly 本月: "This month";
@@ -57,6 +61,7 @@ export declare const langData: {
57
61
  readonly 格式: "Format";
58
62
  readonly 此刻: "now";
59
63
  readonly 浏览器时区: "Browser timezone";
64
+ readonly 的最近: "Last";
60
65
  readonly 确定: "Confirm";
61
66
  readonly 示例: "Example";
62
67
  readonly 结束时间: "End Time";
@@ -74,6 +79,6 @@ export type TimeUnitDateKey = keyof typeof timeUnitLangData;
74
79
  export type ShortTimeUnitDateKey = keyof typeof shortTimeUnitLangData;
75
80
  export type LangKey = keyof typeof langData;
76
81
  export type LangValue = (typeof langData)[LangKey];
77
- export declare const langValueMap: Record<LangValue, "前" | "取消" | "将来" | "常用时间" | "开始时间" | "开始时间不能大于结束时间" | "支持多种时间格式自动转换" | "整" | "无匹配数据" | "日期选择" | "时区设置" | "时差:早 $n 小时" | "时差:晚 $n 小时" | "时间格式支持" | "是否清空最近使用?" | "暂无常用时间" | "暂无最近使用记录" | "最近" | "最近使用" | "未来" | "查看支持格式" | "格式" | "此刻" | "浏览器时区" | "确定" | "示例" | "结束时间" | "自然日期" | "至今" | "请输入" | "请输入搜索(国家,城市,简称)" | "超出可选范围" | "近" | "(至今)" | ",无法选择">;
82
+ export declare const langValueMap: Record<LangValue, "前" | "取消" | "将来" | "常用时间" | "开始时间" | "开始时间不能大于结束时间" | "支持多种时间格式自动转换" | "整" | "无匹配数据" | "日期选择" | "时区设置" | "时差:早 $n 小时" | "时差:晚 $n 小时" | "时间格式支持" | "是否清空最近使用?" | "暂无常用时间" | "暂无最近使用记录" | "最近" | "最近使用" | "未来" | "查看支持格式" | "格式" | "此刻" | "浏览器时区" | "的最近" | "确定" | "示例" | "结束时间" | "自然日期" | "至今" | "请输入" | "请输入搜索(国家,城市,简称)" | "超出可选范围" | "近" | "(至今)" | ",无法选择">;
78
83
  export declare const lang: string;
79
84
  export declare const t: (key: LangKey | NaturalDateKey | ShortTimeUnitDateKey | TimeUnitDateKey) => string;
@@ -26,7 +26,8 @@ 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",
29
- edit = "edit"
29
+ edit = "edit",
30
+ specific = "specific"
30
31
  }
31
32
  export declare const CommonNaturalOptions: ({
32
33
  id: string;
@@ -1,6 +1,7 @@
1
1
  import dayjs, { Dayjs } from 'dayjs';
2
2
  import { DateUnit } from './constant';
3
3
  import { DateMode, DateValue } from './types';
4
+ export declare const baselineDateRegexp: RegExp;
4
5
  export declare const commonDateRegexp: RegExp;
5
6
  export declare const recentDateRegexp: RegExp;
6
7
  export declare const futureDateRegexp: RegExp;
@@ -9,13 +10,25 @@ export declare class DateRange {
9
10
  dateValue: DateValue;
10
11
  format: string;
11
12
  timezome: string;
13
+ endBaselineNum: number | undefined;
14
+ endBaselineTime: string | undefined;
15
+ endBaselineUnit: DateUnit | undefined;
12
16
  endDate: Dayjs | null;
13
17
  endNum: number | undefined;
14
18
  endUnit: DateUnit | undefined;
19
+ startBaselineNum: number | undefined;
20
+ startBaselineTime: string | undefined;
21
+ startBaselineUnit: DateUnit | undefined;
15
22
  startDate: Dayjs | null;
16
23
  startNum: number | undefined;
17
24
  startUnit: DateUnit | undefined;
18
25
  constructor(dateValue?: DateValue, format?: string, timezome?: string);
26
+ get dateMode(): DateMode;
27
+ get endDisplayText(): string;
28
+ get isValidate(): boolean | undefined;
29
+ get recentOrFuturedateNum(): number | undefined;
30
+ get recentOrFuturedateUnit(): "M" | "d" | "h" | "m" | "s" | "w" | "y" | undefined;
31
+ get startDisplayText(): string;
19
32
  dateDuration(): number | undefined;
20
33
  isInValidDateRange(date: DateRange): boolean;
21
34
  toDisplayString(): string;
@@ -29,12 +42,7 @@ export declare class DateRange {
29
42
  transformValue2Dayjs(val: DateValue[number], type?: 'end' | 'start'): dayjs.Dayjs;
30
43
  updateDateValue(dateValue: DateValue, timezome?: string): void;
31
44
  updateFormat(format: string): void;
32
- get dateMode(): DateMode;
33
- get endDisplayText(): string;
34
- get isValidate(): boolean | undefined;
35
- get recentOrFuturedateNum(): number | undefined;
36
- get recentOrFuturedateUnit(): "M" | "d" | "h" | "m" | "s" | "w" | "y" | undefined;
37
- get startDisplayText(): string;
38
45
  }
39
46
  export declare const transformValue2Dayjs: (val: DateValue[number], type?: 'end' | 'start', timezome?: string) => dayjs.Dayjs | undefined;
40
47
  export declare const transformDateRange2Dayjs: (dateValue: DateValue, timezome?: string) => (dayjs.Dayjs | undefined)[];
48
+ export declare const inputVal2Dayjs: (val: string, format: string, defaultDate?: Dayjs) => dayjs.Dayjs;
@@ -1,5 +1,5 @@
1
- export * from './types';
2
1
  export * from './constant';
3
- export * from './utils';
4
- export * from './timezone';
5
2
  export * from './date';
3
+ export * from './timezone';
4
+ export * from './types';
5
+ export * from './utils';
@@ -26,6 +26,6 @@ export interface IDatePickerProps {
26
26
  modelValue: DateValue | undefined;
27
27
  needTimezone?: boolean;
28
28
  timezone?: string;
29
- validDateRange?: DateValue | undefined;
29
+ validDateRange?: DateValue;
30
30
  version?: number | string;
31
31
  }
package/typings/vue3.d.ts CHANGED
@@ -2,6 +2,6 @@ import dayjs from 'dayjs';
2
2
  import DatePicker from './date-picker.vue';
3
3
  export { DatePicker, dayjs };
4
4
  export default DatePicker;
5
- export * from './utils/date';
6
5
  export * from './utils/constant';
6
+ export * from './utils/date';
7
7
  export type * from './utils/types';