@blueking/date-picker 2.0.0-beta.2 → 2.0.0-beta.20
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/README.md +11 -10
- package/package.json +17 -79
- package/typings/components/baseline-select.vue.d.ts +33 -0
- package/typings/components/common-tab.vue.d.ts +1 -1
- package/typings/components/date-panel.vue.d.ts +4 -0
- package/typings/components/panel-wrapper.vue.d.ts +1 -1
- package/typings/components/recent-picker.vue.d.ts +1 -0
- package/typings/date-picker.vue.d.ts +7 -7
- package/typings/hooks/use-validate.d.ts +10 -0
- package/typings/lang/lang.d.ts +8 -1
- package/typings/utils/constant.d.ts +3 -2
- package/typings/utils/date.d.ts +15 -6
- package/typings/utils/index.d.ts +3 -3
- package/typings/utils/store.d.ts +1 -1
- package/typings/utils/types.d.ts +3 -2
- package/typings/utils/utils.d.ts +1 -0
- package/typings/vue2.d.ts +17 -1
- package/typings/vue3.d.ts +2 -1
- package/vue2/config.json +1 -1
- package/vue2/index.es.min.js +21887 -16735
- package/vue2/index.iife.min.js +34880 -76
- package/vue2/index.umd.min.js +27835 -57
- package/vue2/vue2.css +3233 -1
- package/vue3/config.json +1 -1
- package/vue3/index.es.min.js +2518 -1429
- package/vue3/index.iife.min.js +28409 -57
- package/vue3/index.umd.min.js +4400 -2
- package/vue3/vue3.css +762 -1
package/README.md
CHANGED
|
@@ -80,16 +80,17 @@ export default {
|
|
|
80
80
|
|
|
81
81
|
### 属性列表
|
|
82
82
|
|
|
83
|
-
| 属性名
|
|
84
|
-
|
|
|
85
|
-
| behavior
|
|
86
|
-
| commonUseList
|
|
87
|
-
| disabled
|
|
88
|
-
| format
|
|
89
|
-
| modelValue
|
|
90
|
-
| needTimezone
|
|
91
|
-
| timezone
|
|
92
|
-
|
|
|
83
|
+
| 属性名 | 描述 | 属性类型 | 默认值 |
|
|
84
|
+
| -------------- | ----------------------- | ----------------------------------------------------------------- | ---------- |
|
|
85
|
+
| behavior | 组件展示风格 | `'normal' \| 'simplicity'` | 'normal' |
|
|
86
|
+
| commonUseList | 常用列表 | `DateValue[]` | |
|
|
87
|
+
| disabled | 是否禁用 | `boolean` | |
|
|
88
|
+
| format | 日期转换显示格式 | `string` | |
|
|
89
|
+
| modelValue | 日期值 | `DateValue \| dayjs.Dayjs[] \| number[] \| string[] \| undefined` | |
|
|
90
|
+
| needTimezone | 是否展示时区 | `boolean` | |
|
|
91
|
+
| timezone | 时区值 | `string` | 浏览器时区 |
|
|
92
|
+
| validDateRange | 有效可选的日期范围 | `DateValue \| undefined` | |
|
|
93
|
+
| version | 版本号 用于控制本地缓存 | `number \| string` | '1.0' |
|
|
93
94
|
|
|
94
95
|
### 事件列表
|
|
95
96
|
|
package/package.json
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blueking/date-picker",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.20",
|
|
4
4
|
"description": "蓝鲸监控平台日期时间选择",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Tencent BlueKing",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"types": "./typings/vue3.d.ts",
|
|
10
|
-
"import": "./
|
|
11
|
-
"default": "./
|
|
10
|
+
"import": "./vue3/index.es.min.js",
|
|
11
|
+
"default": "./vue3/index.es.min.js"
|
|
12
12
|
},
|
|
13
13
|
"./vue3": {
|
|
14
14
|
"types": "./typings/vue3.d.ts",
|
|
15
|
-
"import": "./
|
|
16
|
-
"default": "./
|
|
15
|
+
"import": "./vue3/index.es.min.js",
|
|
16
|
+
"default": "./vue3/index.es.min.js"
|
|
17
17
|
},
|
|
18
18
|
"./vue2": {
|
|
19
19
|
"types": "./typings/vue2.d.ts",
|
|
20
|
-
"import": "./
|
|
21
|
-
"default": "./
|
|
22
|
-
}
|
|
20
|
+
"import": "./vue2/index.es.min.js",
|
|
21
|
+
"default": "./vue2/index.es.min.js"
|
|
22
|
+
},
|
|
23
|
+
"./vue3/*": "./vue3/*",
|
|
24
|
+
"./vue2/*": "./vue2/*"
|
|
23
25
|
},
|
|
24
26
|
"typesVersions": {
|
|
25
27
|
"*": {
|
|
@@ -35,8 +37,8 @@
|
|
|
35
37
|
}
|
|
36
38
|
},
|
|
37
39
|
"types": "./typings/vue3.d.ts",
|
|
38
|
-
"
|
|
39
|
-
"unpkg": "
|
|
40
|
+
"module": "./vue3/index.es.min.js",
|
|
41
|
+
"unpkg": "./vue3/index.es.min.js",
|
|
40
42
|
"files": [
|
|
41
43
|
"vue2",
|
|
42
44
|
"vue3",
|
|
@@ -46,80 +48,16 @@
|
|
|
46
48
|
"access": "public",
|
|
47
49
|
"registry": "https://registry.npmjs.org/"
|
|
48
50
|
},
|
|
49
|
-
"
|
|
50
|
-
"@blueking/bkui-library": "0.0.0-beta.
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"@types/node": "^20.12.3",
|
|
55
|
-
"@types/prompts": "^2.4.9",
|
|
56
|
-
"@types/semver": "^7.5.8",
|
|
57
|
-
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
|
58
|
-
"@typescript-eslint/parser": "^7.5.0",
|
|
59
|
-
"@vitejs/plugin-vue": "^5.0.4",
|
|
60
|
-
"bkui-vue": "1.0.3-beta.25",
|
|
61
|
-
"eslint": "^8.57.0",
|
|
62
|
-
"eslint-config-prettier": "^9.1.0",
|
|
63
|
-
"eslint-config-tencent": "^1.0.4",
|
|
64
|
-
"eslint-plugin-codecc": "^0.3.0",
|
|
65
|
-
"eslint-plugin-perfectionist": "^2.7.0",
|
|
66
|
-
"eslint-plugin-prettier": "^5.1.3",
|
|
67
|
-
"eslint-plugin-vue": "^9.24.0",
|
|
68
|
-
"execa": "^8.0.1",
|
|
69
|
-
"less": "^4.2.0",
|
|
70
|
-
"lint-staged": "^15.2.2",
|
|
71
|
-
"npm-run-all": "^4.1.5",
|
|
72
|
-
"picocolors": "^1.0.0",
|
|
73
|
-
"postcss-html": "^1.6.0",
|
|
74
|
-
"postcss-scss": "^4.0.9",
|
|
75
|
-
"prettier": "^3.2.5",
|
|
76
|
-
"prompts": "^2.4.2",
|
|
77
|
-
"sass": "^1.72.0",
|
|
78
|
-
"semver": "^7.6.0",
|
|
79
|
-
"simple-git-hooks": "^2.11.1",
|
|
80
|
-
"stylelint": "^16.3.1",
|
|
81
|
-
"stylelint-config-recess-order": "^5.0.0",
|
|
82
|
-
"stylelint-config-recommended-vue": "1.5.0",
|
|
83
|
-
"stylelint-config-standard": "^36.0.0",
|
|
84
|
-
"stylelint-order": "^6.0.4",
|
|
85
|
-
"stylelint-scss": "^6.2.1",
|
|
86
|
-
"terser": "^5.30.2",
|
|
87
|
-
"ts-node": "^10.9.2",
|
|
88
|
-
"tslib": "^2.6.2",
|
|
89
|
-
"tsx": "^4.7.1",
|
|
90
|
-
"typescript": "^5.4.3",
|
|
91
|
-
"vite": "^5.2.7",
|
|
92
|
-
"vite-bundle-visualizer": "^1.1.0",
|
|
93
|
-
"vite-plugin-css-injected-by-js": "^3.5.0",
|
|
94
|
-
"vite-plugin-inspect": "^0.8.3",
|
|
95
|
-
"vue": "^3.4.21",
|
|
96
|
-
"vue-eslint-parser": "^9.4.2",
|
|
97
|
-
"vue-tsc": "^2.0.7",
|
|
98
|
-
"zip-a-folder": "^3.1.6"
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"@blueking/bkui-library": "^0.0.0-beta.4",
|
|
53
|
+
"bkui-vue": "^1.0.3-beta.38",
|
|
54
|
+
"dayjs": "^1.11.10",
|
|
55
|
+
"vue": "^3"
|
|
99
56
|
},
|
|
100
57
|
"engines": {
|
|
101
58
|
"node": ">=18.16.0"
|
|
102
59
|
},
|
|
103
|
-
"browserslist": [
|
|
104
|
-
"> 0.5%",
|
|
105
|
-
"last 2 versions",
|
|
106
|
-
"Firefox ESR",
|
|
107
|
-
"not dead"
|
|
108
|
-
],
|
|
109
|
-
"simple-git-hooks": {
|
|
110
|
-
"pre-commit": "lint-staged",
|
|
111
|
-
"commit-msg": "node scripts/verify.commit.mjs"
|
|
112
|
-
},
|
|
113
|
-
"lint-staged": {
|
|
114
|
-
"*.{js,json}": [
|
|
115
|
-
"prettier --write"
|
|
116
|
-
],
|
|
117
|
-
"*.ts?(x)": [
|
|
118
|
-
"eslint --fix"
|
|
119
|
-
]
|
|
120
|
-
},
|
|
121
60
|
"scripts": {
|
|
122
|
-
"release": "tsx scripts/release.ts",
|
|
123
61
|
"dev": "vite --mode development -c scripts/vite.dev.ts",
|
|
124
62
|
"build": "tsx ./scripts/vite.build.ts",
|
|
125
63
|
"dts": "vue-tsc --project tsconfig.dts.json",
|
|
@@ -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
|
+
};
|
|
@@ -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> = {
|
|
@@ -13,8 +13,8 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
|
13
13
|
needTimezone?: boolean | undefined;
|
|
14
14
|
timezone?: string | undefined;
|
|
15
15
|
}>>> & {
|
|
16
|
-
"onUpdate:timezone"?: ((value: string, timezoneInfo: ITimezoneItem) => any) | undefined;
|
|
17
16
|
onChange?: ((value: DateValue) => any) | undefined;
|
|
17
|
+
"onUpdate:timezone"?: ((value: string, timezoneInfo: ITimezoneItem) => any) | undefined;
|
|
18
18
|
}, {}, {}>;
|
|
19
19
|
export default _default;
|
|
20
20
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import 'bkui-vue/lib/styles/reset.css';
|
|
2
1
|
import dayjs from 'dayjs';
|
|
3
2
|
import { type DateValue, type IDatePickerProps } from './utils';
|
|
4
3
|
import { type ITimezoneItem } from './utils/timezone';
|
|
5
4
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<IDatePickerProps>, {
|
|
6
5
|
behavior: string;
|
|
7
|
-
commonUseList:
|
|
6
|
+
commonUseList: () => DateValue[];
|
|
8
7
|
format: string;
|
|
9
8
|
needTimezone: boolean;
|
|
10
9
|
version: string;
|
|
@@ -12,31 +11,32 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
12
11
|
handleHidePanel: () => void;
|
|
13
12
|
handleShowPanel: () => void;
|
|
14
13
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
-
"update:modelValue": (value:
|
|
14
|
+
"update:modelValue": (value: DateValue | undefined, info: {
|
|
16
15
|
dayjs: dayjs.Dayjs | null;
|
|
17
16
|
formatText: string | null;
|
|
18
17
|
}[]) => void;
|
|
19
18
|
"update:timezone": (value: string, timezoneInfo: ITimezoneItem) => void;
|
|
20
19
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<IDatePickerProps>, {
|
|
21
20
|
behavior: string;
|
|
22
|
-
commonUseList:
|
|
21
|
+
commonUseList: () => DateValue[];
|
|
23
22
|
format: string;
|
|
24
23
|
needTimezone: boolean;
|
|
25
24
|
version: string;
|
|
26
25
|
}>>> & {
|
|
27
|
-
"onUpdate:modelValue"?: ((value:
|
|
26
|
+
"onUpdate:modelValue"?: ((value: DateValue | undefined, info: {
|
|
28
27
|
dayjs: dayjs.Dayjs | null;
|
|
29
28
|
formatText: string | null;
|
|
30
29
|
}[]) => any) | undefined;
|
|
31
30
|
"onUpdate:timezone"?: ((value: string, timezoneInfo: ITimezoneItem) => any) | undefined;
|
|
32
31
|
}, {
|
|
32
|
+
format: string;
|
|
33
|
+
version: string | number;
|
|
33
34
|
behavior: "normal" | "simplicity";
|
|
34
35
|
commonUseList: DateValue[];
|
|
35
|
-
format: string;
|
|
36
36
|
needTimezone: boolean;
|
|
37
|
-
version: string | number;
|
|
38
37
|
}, {}>;
|
|
39
38
|
export default _default;
|
|
39
|
+
|
|
40
40
|
type __VLS_WithDefaults<P, D> = {
|
|
41
41
|
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
42
42
|
default: D[K];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { DateValue } from '../utils';
|
|
3
|
+
import { DateRange } from '../utils/date';
|
|
4
|
+
export declare const useValidate: () => {
|
|
5
|
+
validDateRange: import("vue").Ref<DateRange | undefined>;
|
|
6
|
+
validMsg: import("vue").ComputedRef<string>;
|
|
7
|
+
validateDateRange: (validDate: DateRange) => boolean;
|
|
8
|
+
validateDateValue: (validDate: DateValue) => boolean;
|
|
9
|
+
validateDayjs: (validDate: Dayjs) => boolean;
|
|
10
|
+
};
|
package/typings/lang/lang.d.ts
CHANGED
|
@@ -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";
|
|
@@ -64,14 +69,16 @@ export declare const langData: {
|
|
|
64
69
|
readonly 至今: "so far";
|
|
65
70
|
readonly 请输入: "Please enter";
|
|
66
71
|
readonly '\u8BF7\u8F93\u5165\u641C\u7D22\uFF08\u56FD\u5BB6\uFF0C\u57CE\u5E02\uFF0C\u7B80\u79F0\uFF09': "Please enter search (country, city, abbreviation)";
|
|
72
|
+
readonly 超出可选范围: "Out of range";
|
|
67
73
|
readonly 近: "Last";
|
|
68
74
|
readonly '\uFF08\u81F3\u4ECA\uFF09': " so far";
|
|
75
|
+
readonly '\uFF0C\u65E0\u6CD5\u9009\u62E9': ", cannot be selected";
|
|
69
76
|
};
|
|
70
77
|
export type NaturalDateKey = keyof typeof naturalDateLangData;
|
|
71
78
|
export type TimeUnitDateKey = keyof typeof timeUnitLangData;
|
|
72
79
|
export type ShortTimeUnitDateKey = keyof typeof shortTimeUnitLangData;
|
|
73
80
|
export type LangKey = keyof typeof langData;
|
|
74
81
|
export type LangValue = (typeof langData)[LangKey];
|
|
75
|
-
export declare const langValueMap: Record<LangValue, "前" | "取消" | "将来" | "常用时间" | "开始时间" | "开始时间不能大于结束时间" | "支持多种时间格式自动转换" | "整" | "无匹配数据" | "日期选择" | "时区设置" | "时差:早 $n 小时" | "时差:晚 $n 小时" | "时间格式支持" | "是否清空最近使用?" | "暂无常用时间" | "暂无最近使用记录" | "最近" | "最近使用" | "未来" | "查看支持格式" | "格式" | "此刻" | "浏览器时区" | "确定" | "示例" | "结束时间" | "自然日期" | "至今" | "请输入" | "请输入搜索(国家,城市,简称)" | "近" | "(至今)">;
|
|
82
|
+
export declare const langValueMap: Record<LangValue, "前" | "取消" | "将来" | "常用时间" | "开始时间" | "开始时间不能大于结束时间" | "支持多种时间格式自动转换" | "整" | "无匹配数据" | "日期选择" | "时区设置" | "时差:早 $n 小时" | "时差:晚 $n 小时" | "时间格式支持" | "是否清空最近使用?" | "暂无常用时间" | "暂无最近使用记录" | "最近" | "最近使用" | "未来" | "查看支持格式" | "格式" | "此刻" | "浏览器时区" | "的最近" | "确定" | "示例" | "结束时间" | "自然日期" | "至今" | "请输入" | "请输入搜索(国家,城市,简称)" | "超出可选范围" | "近" | "(至今)" | ",无法选择">;
|
|
76
83
|
export declare const lang: string;
|
|
77
84
|
export declare const t: (key: LangKey | NaturalDateKey | ShortTimeUnitDateKey | TimeUnitDateKey) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateMode, DateValue } from './
|
|
1
|
+
import { DateMode, DateValue } from './types';
|
|
2
2
|
export declare const DateUnitList: readonly [{
|
|
3
3
|
readonly id: "s";
|
|
4
4
|
readonly name: 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;
|
package/typings/utils/date.d.ts
CHANGED
|
@@ -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,14 +10,27 @@ 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;
|
|
33
|
+
isInValidDateRange(date: DateRange): boolean;
|
|
20
34
|
toDisplayString(): string;
|
|
21
35
|
toEmitValue(): [
|
|
22
36
|
DateValue,
|
|
@@ -28,12 +42,7 @@ export declare class DateRange {
|
|
|
28
42
|
transformValue2Dayjs(val: DateValue[number], type?: 'end' | 'start'): dayjs.Dayjs;
|
|
29
43
|
updateDateValue(dateValue: DateValue, timezome?: string): void;
|
|
30
44
|
updateFormat(format: string): void;
|
|
31
|
-
get dateMode(): DateMode;
|
|
32
|
-
get endDisplayText(): string;
|
|
33
|
-
get isValidate(): boolean | undefined;
|
|
34
|
-
get recentOrFuturedateNum(): number | undefined;
|
|
35
|
-
get recentOrFuturedateUnit(): "M" | "d" | "h" | "m" | "s" | "w" | "y" | undefined;
|
|
36
|
-
get startDisplayText(): string;
|
|
37
45
|
}
|
|
38
46
|
export declare const transformValue2Dayjs: (val: DateValue[number], type?: 'end' | 'start', timezome?: string) => dayjs.Dayjs | undefined;
|
|
39
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;
|
package/typings/utils/index.d.ts
CHANGED
package/typings/utils/store.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type StoreType = 'local' | 'session';
|
|
|
5
5
|
* @param storeKey store key
|
|
6
6
|
* @returns store value list
|
|
7
7
|
*/
|
|
8
|
-
export declare const getStoreDateList: (storeKey: string, type?: StoreType) =>
|
|
8
|
+
export declare const getStoreDateList: (storeKey: string, type?: StoreType) => any[];
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
11
|
* @param val store value
|
package/typings/utils/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Dayjs } from 'dayjs';
|
|
2
2
|
import { DateUnit, NowConstant } from './constant';
|
|
3
3
|
export interface ICommonTabItem {
|
|
4
4
|
id: string;
|
|
@@ -23,8 +23,9 @@ export interface IDatePickerProps {
|
|
|
23
23
|
commonUseList?: DateValue[];
|
|
24
24
|
disabled?: boolean;
|
|
25
25
|
format?: string;
|
|
26
|
-
modelValue: DateValue |
|
|
26
|
+
modelValue: DateValue | undefined;
|
|
27
27
|
needTimezone?: boolean;
|
|
28
28
|
timezone?: string;
|
|
29
|
+
validDateRange?: DateValue;
|
|
29
30
|
version?: number | string;
|
|
30
31
|
}
|
package/typings/utils/utils.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface IDatePickerProvider {
|
|
|
9
9
|
t: (key: LangKey) => string;
|
|
10
10
|
timezoneInfo: ComputedRef<ITimezoneItem>;
|
|
11
11
|
version: ComputedRef<number | string>;
|
|
12
|
+
vildateTimeRange: ComputedRef<DateValue | undefined>;
|
|
12
13
|
}
|
|
13
14
|
export declare const DATE_PICKER_PROVIDER_KEY: InjectionKey<IDatePickerProvider>;
|
|
14
15
|
export declare const useDatePickerProvider: (data: IDatePickerProvider) => void;
|
package/typings/vue2.d.ts
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: {
|
|
2
|
+
beforeDestroy(): void;
|
|
3
|
+
created(): void;
|
|
4
|
+
data(): {
|
|
5
|
+
app: null;
|
|
6
|
+
unWatchStack: never[];
|
|
7
|
+
};
|
|
8
|
+
methods: {
|
|
9
|
+
handleHidePanel(): void;
|
|
10
|
+
handleShowPanel(): void;
|
|
11
|
+
};
|
|
12
|
+
mounted(): void;
|
|
13
|
+
name: string;
|
|
14
|
+
props: any;
|
|
15
|
+
render(createElement: any): any;
|
|
16
|
+
};
|
|
2
17
|
export default _default;
|
|
3
18
|
export * from './utils/date';
|
|
4
19
|
export * from './utils/constant';
|
|
20
|
+
export type * from './utils/types';
|
package/typings/vue3.d.ts
CHANGED
|
@@ -2,5 +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
|
+
export type * from './utils/types';
|
package/vue2/config.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"blueking-date-picker
|
|
1
|
+
{"type":"blueking-date-picker","name":"blueking-date-picker","displayName":"蓝鲸监控平台日期组件","framework":"vue2","props":{"behavior":{"type":"string","val":"normal","options":["normal","simplicity"],"tips":"组件展示风格"},"commonUseList":{"type":"array","tips":"常用列表"},"disabled":{"type":"boolean","tips":"是否禁用"},"format":{"type":"string","tips":"日期转换显示格式"},"modelValue":{"type":"array","val":["now-1d","now"],"tips":"日期值"},"needTimezone":{"type":"boolean","tips":"是否展示时区"},"timezone":{"type":"string","tips":"时区值"},"version":{"type":["number","string"],"val":"1.0","tips":"版本号 用于控制本地缓存"}},"events":[{"name":"update:modelValue","tips":"响应组件的点击事件"},{"name":"update:timezone","tips":"更新时区值的事件,以及时区信息"}]}
|