@keyblade/pro-components 1.13.8-alpha.8 → 1.14.0
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/components.d.ts +7 -0
- package/es/global-props.d.ts +21 -2
- package/es/global-props.js +6 -2
- package/es/index.d.ts +7 -0
- package/es/index.js +47 -28
- package/es/inerface.d.ts +5 -1
- package/es/pro-calendar/calendar.vue.d.ts +75 -0
- package/es/pro-calendar/calendar.vue.js +159 -0
- package/es/pro-calendar/calendar.vue3.js +5 -0
- package/es/pro-calendar/enum.d.ts +6 -0
- package/es/pro-calendar/enum.js +4 -0
- package/es/pro-calendar/header.vue.d.ts +35 -0
- package/es/pro-calendar/header.vue.js +146 -0
- package/es/pro-calendar/header.vue2.js +4 -0
- package/es/pro-calendar/hooks/useCellClassName.d.ts +12 -0
- package/es/pro-calendar/hooks/useCellClassName.js +40 -0
- package/es/pro-calendar/index.d.ts +117 -0
- package/es/pro-calendar/index.js +12 -0
- package/es/pro-calendar/interface.d.ts +89 -0
- package/es/pro-calendar/month.d.ts +5 -0
- package/es/pro-calendar/month.js +53 -0
- package/es/pro-calendar/month.vue.d.ts +22 -0
- package/es/pro-calendar/month.vue.js +126 -0
- package/es/pro-calendar/month.vue2.js +4 -0
- package/es/pro-calendar/week.vue.d.ts +3 -0
- package/es/pro-calendar/week.vue.js +34 -0
- package/es/pro-calendar/week.vue2.js +4 -0
- package/es/pro-calendar/year.vue.d.ts +3 -0
- package/es/pro-calendar/year.vue.js +123 -0
- package/es/pro-calendar/year.vue2.js +4 -0
- package/es/pro-date-range-picker/index.d.ts +183 -13
- package/es/pro-date-range-picker/index.js +6 -7
- package/es/pro-date-range-picker/interface.d.ts +38 -0
- package/es/pro-date-range-picker/pro-date-range-picker.vue.d.ts +173 -6
- package/es/pro-date-range-picker/pro-date-range-picker.vue.js +1 -1
- package/es/pro-date-range-picker/pro-date-range-picker.vue2.js +127 -97
- package/es/pro-dates-picker/index.d.ts +49 -0
- package/es/pro-dates-picker/index.js +11 -0
- package/es/pro-dates-picker/index.vue.d.ts +29 -0
- package/es/pro-dates-picker/index.vue.js +135 -0
- package/es/pro-dates-picker/index.vue3.js +5 -0
- package/es/pro-dates-picker/interface.d.ts +38 -0
- package/es/pro-dates-picker/util.d.ts +12 -0
- package/es/pro-dates-picker/util.js +9 -0
- package/es/pro-find-password/enum.d.ts +8 -0
- package/es/pro-find-password/enum.js +4 -0
- package/es/pro-find-password/index.d.ts +11 -0
- package/es/pro-find-password/index.js +11 -0
- package/es/pro-find-password/index.vue.d.ts +4459 -0
- package/es/pro-find-password/index.vue.js +176 -0
- package/es/pro-find-password/index.vue3.js +5 -0
- package/es/pro-find-password/interface.d.ts +45 -0
- package/es/pro-find-password/reset-password.vue.d.ts +591 -0
- package/es/pro-find-password/reset-password.vue.js +179 -0
- package/es/pro-find-password/reset-password.vue2.js +4 -0
- package/es/pro-find-password/verify-user-name.vue.d.ts +795 -0
- package/es/pro-find-password/verify-user-name.vue.js +112 -0
- package/es/pro-find-password/verify-user-name.vue3.js +5 -0
- package/es/pro-footer-bar/index.d.ts +6 -3
- package/es/pro-footer-bar/index.js +6 -7
- package/es/pro-footer-bar/index.vue.d.ts +1 -1
- package/es/pro-footer-bar/index.vue.js +2 -2
- package/es/pro-footer-bar/index.vue2.js +24 -26
- package/es/pro-footer-bar/{inerface.d.ts → interface.d.ts} +1 -0
- package/es/pro-form-group/index.d.ts +7 -6
- package/es/pro-form-group/index.js +6 -8
- package/es/pro-form-group/index.vue.d.ts +2 -2
- package/es/pro-form-group/index.vue.js +1 -1
- package/es/pro-form-group/index.vue2.js +31 -32
- package/es/pro-image-upload/cropper.vue.js +2 -2
- package/es/pro-image-upload/cropper.vue2.js +200 -190
- package/es/pro-image-upload/image-upload.vue.d.ts +1124 -371
- package/es/pro-image-upload/image-upload.vue.js +178 -144
- package/es/pro-image-upload/index.d.ts +1727 -1001
- package/es/pro-image-upload/index.js +6 -8
- package/es/pro-keep-alive-router-view/index.d.ts +1 -0
- package/es/pro-keep-alive-router-view/pro-keep-alive-router-view.vue.js +17 -18
- package/es/pro-layout/hooks.d.ts +80 -1
- package/es/pro-layout/hooks.js +133 -84
- package/es/pro-layout/index.d.ts +9 -6
- package/es/pro-layout/index.js +6 -11
- package/es/pro-layout/pro-layout.vue.d.ts +4 -2
- package/es/pro-layout/pro-layout.vue.js +220 -208
- package/es/pro-loader/index.d.ts +43 -0
- package/es/pro-loader/index.js +11 -0
- package/es/pro-loader/index.vue.d.ts +28 -0
- package/es/pro-loader/index.vue.js +112 -0
- package/es/pro-loader/index.vue3.js +5 -0
- package/es/pro-loader/interface.d.ts +16 -0
- package/es/pro-login/enum.d.ts +6 -0
- package/es/pro-login/enum.js +4 -0
- package/es/pro-login/form-mobile.vue.d.ts +797 -0
- package/es/pro-login/form-mobile.vue.js +146 -0
- package/es/pro-login/form-mobile.vue2.js +4 -0
- package/es/pro-login/form-password.vue.d.ts +584 -0
- package/es/pro-login/form-password.vue.js +99 -0
- package/es/pro-login/form-password.vue2.js +4 -0
- package/es/pro-login/index.d.ts +11 -0
- package/es/pro-login/index.js +11 -0
- package/es/pro-login/index.vue.d.ts +4429 -0
- package/es/pro-login/index.vue.js +105 -0
- package/es/pro-login/index.vue3.js +5 -0
- package/es/pro-login/interface.d.ts +72 -0
- package/es/pro-login/regexp.d.ts +17 -0
- package/es/pro-login/regexp.js +28 -0
- package/es/pro-menu/index.d.ts +18 -80
- package/es/pro-menu/index.js +6 -7
- package/es/pro-menu/interface.d.ts +31 -0
- package/es/pro-menu/menu-item.vue.d.ts +27 -0
- package/es/pro-menu/menu-item.vue.js +35 -0
- package/es/pro-menu/menu-item.vue2.js +4 -0
- package/es/pro-menu/pro-menu-item.vue.d.ts +9 -0
- package/es/pro-menu/pro-menu-item.vue.js +63 -0
- package/es/pro-menu/pro-menu-item.vue2.js +4 -0
- package/es/pro-menu/pro-menu.vue.d.ts +9 -55
- package/es/pro-menu/pro-menu.vue.js +36 -119
- package/es/pro-menu/sub-menu.vue.d.ts +22 -0
- package/es/pro-menu/sub-menu.vue.js +55 -0
- package/es/pro-menu/sub-menu.vue2.js +4 -0
- package/es/pro-menu/util.d.ts +9 -0
- package/es/pro-menu/util.js +7 -0
- package/es/pro-page-container/constant.d.ts +2 -0
- package/es/pro-page-container/constant.js +9 -0
- package/es/pro-page-container/index.d.ts +7 -21
- package/es/pro-page-container/index.js +6 -8
- package/es/pro-page-container/interface.d.ts +12 -0
- package/es/pro-page-container/pro-page-container.vue.d.ts +4 -15
- package/es/pro-page-container/pro-page-container.vue.js +58 -38
- package/es/pro-page-header/constant.d.ts +2 -0
- package/es/pro-page-header/constant.js +13 -0
- package/es/pro-page-header/index.d.ts +12 -146
- package/es/pro-page-header/index.js +6 -8
- package/es/pro-page-header/interface.d.ts +21 -0
- package/es/pro-page-header/pro-page-header.vue.d.ts +18 -103
- package/es/pro-page-header/pro-page-header.vue.js +141 -124
- package/es/pro-reuse-tabs/index.d.ts +8 -6
- package/es/pro-reuse-tabs/index.js +6 -7
- package/es/pro-reuse-tabs/pro-reuse-tabs.vue.d.ts +2 -2
- package/es/pro-reuse-tabs/pro-reuse-tabs.vue.js +33 -35
- package/es/pro-table/index.d.ts +18 -18
- package/es/pro-table/index.js +6 -7
- package/es/pro-table/index.vue.d.ts +6 -6
- package/es/pro-table/index.vue.js +94 -39
- package/es/pro-table/interface.d.ts +73 -65
- package/es/pro-textarea/index.d.ts +7 -5
- package/es/pro-textarea/index.js +5 -6
- package/es/pro-textarea/index.vue.d.ts +1 -1
- package/es/pro-textarea/index.vue.js +1 -1
- package/es/pro-textarea/index.vue2.js +14 -16
- package/es/pro-textarea/{inerface.d.ts → interface.d.ts} +19 -18
- package/es/style.css +1 -1
- package/es/utils.d.ts +6 -0
- package/es/utils.js +7 -0
- package/package.json +5 -4
- package/es/pro-date-range-picker/type.d.ts +0 -22
- package/es/pro-page-container/inerface.d.ts +0 -12
package/es/components.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
declare module 'vue' {
|
|
2
2
|
interface GlobalComponents {
|
|
3
3
|
KbProDateRangePicker: typeof import('./index')['ProDateRangePicker'];
|
|
4
|
+
KbProDatesPicker: typeof import('./index')['ProDatesPicker'];
|
|
4
5
|
KbProImageUpload: typeof import('./index')['ProImageUpload'];
|
|
5
6
|
KbProPageHeader: typeof import('./index')['ProPageHeader'];
|
|
6
7
|
KbProKeepAliveRouterView: typeof import('./index')['ProKeepAliveRouterView'];
|
|
@@ -10,6 +11,12 @@ declare module 'vue' {
|
|
|
10
11
|
KbProReuseTabs: typeof import('./index')['ProReuseTabs'];
|
|
11
12
|
KbProFooterBar: typeof import('./index')['ProFooterBar'];
|
|
12
13
|
KbProTextarea: typeof import('./index')['ProTextarea'];
|
|
14
|
+
KbProTable: typeof import('./index')['ProTable'];
|
|
15
|
+
KbProFormGroup: typeof import('./index')['ProFormGroup'];
|
|
16
|
+
KbProCalendar: typeof import('./index')['ProCalendar'];
|
|
17
|
+
KbProLoader: typeof import('./index')['ProLoader'];
|
|
18
|
+
KbProLogin: typeof import('./index')['ProLogin'];
|
|
19
|
+
KbProFindPassword: typeof import('./index')['ProFindPassword'];
|
|
13
20
|
}
|
|
14
21
|
}
|
|
15
22
|
export {};
|
package/es/global-props.d.ts
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
|
-
import { ProFooterBarProps } from './pro-footer-bar/
|
|
1
|
+
import { ProFooterBarProps } from './pro-footer-bar/interface.ts';
|
|
2
2
|
import { ProTableProps } from './pro-table/interface';
|
|
3
|
-
import { ProTextareaProps } from './pro-textarea';
|
|
3
|
+
import { ProTextareaProps } from './pro-textarea/interface.ts';
|
|
4
|
+
import { ProDateRangePickerProps } from './pro-date-range-picker/interface.ts';
|
|
5
|
+
import { ProCalendarProps } from './pro-calendar/interface.ts';
|
|
6
|
+
import { ProDatesPickerProps } from './pro-dates-picker/interface.ts';
|
|
7
|
+
import { ProLoaderProps } from './pro-loader/interface.ts';
|
|
8
|
+
import { PageContainerProps } from './pro-page-container/interface.ts';
|
|
9
|
+
import { PageHeaderProps } from './pro-page-header/interface.ts';
|
|
4
10
|
export interface GlobalProps {
|
|
5
11
|
footerBar?: ProFooterBarProps;
|
|
12
|
+
dateRangePicker?: ProDateRangePickerProps;
|
|
13
|
+
datesPicker?: ProDatesPickerProps;
|
|
6
14
|
textarea?: ProTextareaProps;
|
|
7
15
|
table?: ProTableProps;
|
|
16
|
+
calendar?: ProCalendarProps;
|
|
17
|
+
loader?: ProLoaderProps;
|
|
18
|
+
/** 页面容器 */
|
|
19
|
+
pageContainer?: PageContainerProps;
|
|
20
|
+
/** 页头 */
|
|
21
|
+
pageHeader?: PageHeaderProps;
|
|
8
22
|
}
|
|
9
23
|
export declare const globalProps: GlobalProps;
|
|
24
|
+
/**
|
|
25
|
+
* 设置全局属性
|
|
26
|
+
* @param _globalProps
|
|
27
|
+
*/
|
|
28
|
+
export declare function setGlobalProps(_globalProps: GlobalProps): void;
|
package/es/global-props.js
CHANGED
package/es/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ declare const _default: {
|
|
|
4
4
|
install(app: App, options?: GlobalProps): void;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
|
+
export { default as ProLogin } from './pro-login';
|
|
8
|
+
export { default as ProFindPassword } from './pro-find-password';
|
|
7
9
|
export { default as ProPageHeader } from './pro-page-header';
|
|
8
10
|
export { default as ProKeepAliveRouterView } from './pro-keep-alive-router-view';
|
|
9
11
|
export { default as ProLayout } from './pro-layout';
|
|
@@ -15,9 +17,14 @@ export { default as ProReuseTabs } from './pro-reuse-tabs';
|
|
|
15
17
|
export type { IProTab } from './pro-reuse-tabs';
|
|
16
18
|
export { default as ProImageUpload } from './pro-image-upload';
|
|
17
19
|
export * from './pro-image-upload';
|
|
20
|
+
export { default as ProDatesPicker } from './pro-dates-picker';
|
|
18
21
|
export { default as ProDateRangePicker } from './pro-date-range-picker';
|
|
19
22
|
export { default as ProTextarea } from './pro-textarea';
|
|
20
23
|
export { default as ProTable } from './pro-table';
|
|
21
24
|
export { default as ProFormGroup } from './pro-form-group';
|
|
25
|
+
export { default as ProCalendar } from './pro-calendar';
|
|
26
|
+
export { default as ProLoader } from './pro-loader';
|
|
22
27
|
export type {} from './components';
|
|
23
28
|
export * from './inerface';
|
|
29
|
+
export * from './utils';
|
|
30
|
+
export * from './global-props.ts';
|
package/es/index.js
CHANGED
|
@@ -1,37 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { ProLogin as e } from "./pro-login/index.js";
|
|
2
|
+
import { ProFindPassword as m } from "./pro-find-password/index.js";
|
|
3
|
+
import { ProPageHeader as t } from "./pro-page-header/index.js";
|
|
4
|
+
import { ProKeepAliveRouterView as s } from "./pro-keep-alive-router-view/index.js";
|
|
5
|
+
import { ProLayout as i } from "./pro-layout/index.js";
|
|
6
|
+
import { ProMenu as f } from "./pro-menu/index.js";
|
|
7
|
+
import { ProPageContainer as P } from "./pro-page-container/index.js";
|
|
6
8
|
import { ProReuseTabs as u } from "./pro-reuse-tabs/index.js";
|
|
7
|
-
import { ProImageUpload as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
9
|
+
import { ProImageUpload as a } from "./pro-image-upload/index.js";
|
|
10
|
+
import { ProDatesPicker as n } from "./pro-dates-picker/index.js";
|
|
11
|
+
import { ProDateRangePicker as l } from "./pro-date-range-picker/index.js";
|
|
12
|
+
import { ProTable as d } from "./pro-table/index.js";
|
|
13
|
+
import { ProTextarea as g } from "./pro-textarea/index.js";
|
|
14
|
+
import { ProFooterBar as x } from "./pro-footer-bar/index.js";
|
|
15
|
+
import { ProFormGroup as p } from "./pro-form-group/index.js";
|
|
16
|
+
import { ProCalendar as b } from "./pro-calendar/index.js";
|
|
17
|
+
import { ProLoader as c } from "./pro-loader/index.js";
|
|
18
|
+
import { globalProps as F } from "./global-props.js";
|
|
19
|
+
import { setGlobalProps as M } from "./global-props.js";
|
|
20
|
+
import { splitStringWithCommaAndSpace as W } from "./utils.js";
|
|
21
|
+
import { EImageUploadInnerBeforeUploadStep as z } from "./pro-image-upload/types.js";
|
|
22
|
+
import { defaultImageUploadOptions as N } from "./pro-image-upload/constant.js";
|
|
23
|
+
import { EProLoginType as X } from "./pro-login/enum.js";
|
|
24
|
+
import { EFindPasswordSteps as Z } from "./pro-find-password/enum.js";
|
|
16
25
|
const v = {
|
|
17
26
|
install(o, r) {
|
|
18
|
-
Object.assign(
|
|
27
|
+
Object.assign(F, r || {}), o.use(e), o.use(m), o.use(t), o.use(s), o.use(i), o.use(x), o.use(f), o.use(P), o.use(u), o.use(a), o.use(n), o.use(l), o.use(g), o.use(d), o.use(p), o.use(b), o.use(c);
|
|
19
28
|
}
|
|
20
29
|
};
|
|
21
30
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
Z as EFindPasswordSteps,
|
|
32
|
+
z as EImageUploadInnerBeforeUploadStep,
|
|
33
|
+
X as EProLoginType,
|
|
34
|
+
b as ProCalendar,
|
|
35
|
+
l as ProDateRangePicker,
|
|
36
|
+
n as ProDatesPicker,
|
|
37
|
+
m as ProFindPassword,
|
|
38
|
+
x as ProFooterBar,
|
|
39
|
+
p as ProFormGroup,
|
|
40
|
+
a as ProImageUpload,
|
|
41
|
+
s as ProKeepAliveRouterView,
|
|
42
|
+
i as ProLayout,
|
|
43
|
+
c as ProLoader,
|
|
44
|
+
e as ProLogin,
|
|
45
|
+
f as ProMenu,
|
|
46
|
+
P as ProPageContainer,
|
|
47
|
+
t as ProPageHeader,
|
|
32
48
|
u as ProReuseTabs,
|
|
33
|
-
|
|
34
|
-
|
|
49
|
+
d as ProTable,
|
|
50
|
+
g as ProTextarea,
|
|
35
51
|
v as default,
|
|
36
|
-
|
|
52
|
+
N as defaultImageUploadOptions,
|
|
53
|
+
F as globalProps,
|
|
54
|
+
M as setGlobalProps,
|
|
55
|
+
W as splitStringWithCommaAndSpace
|
|
37
56
|
};
|
package/es/inerface.d.ts
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export * from './pro-footer-bar/
|
|
1
|
+
export * from './pro-footer-bar/interface';
|
|
2
|
+
export * from './pro-date-range-picker/interface.ts';
|
|
3
|
+
export * from './pro-table/interface';
|
|
4
|
+
export * from './pro-login/interface';
|
|
5
|
+
export * from './pro-find-password/interface.ts';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { IProCalendarProps } from './interface.ts';
|
|
2
|
+
import { EMode } from './enum';
|
|
3
|
+
declare function changePageShowDate(type: 'prev' | 'next', unit: EMode): void;
|
|
4
|
+
declare function __VLS_template(): {
|
|
5
|
+
attrs: Partial<{}>;
|
|
6
|
+
slots: Readonly<{
|
|
7
|
+
default?: (props: {
|
|
8
|
+
year: string;
|
|
9
|
+
month: string;
|
|
10
|
+
date?: string;
|
|
11
|
+
value: {
|
|
12
|
+
year: number;
|
|
13
|
+
month: number;
|
|
14
|
+
date?: number;
|
|
15
|
+
};
|
|
16
|
+
}) => any;
|
|
17
|
+
header?: (props: {
|
|
18
|
+
year: string;
|
|
19
|
+
month: string;
|
|
20
|
+
value: {
|
|
21
|
+
year: number;
|
|
22
|
+
month: number;
|
|
23
|
+
};
|
|
24
|
+
}) => any;
|
|
25
|
+
}> & {
|
|
26
|
+
default?: (props: {
|
|
27
|
+
year: string;
|
|
28
|
+
month: string;
|
|
29
|
+
date?: string;
|
|
30
|
+
value: {
|
|
31
|
+
year: number;
|
|
32
|
+
month: number;
|
|
33
|
+
date?: number;
|
|
34
|
+
};
|
|
35
|
+
}) => any;
|
|
36
|
+
header?: (props: {
|
|
37
|
+
year: string;
|
|
38
|
+
month: string;
|
|
39
|
+
value: {
|
|
40
|
+
year: number;
|
|
41
|
+
month: number;
|
|
42
|
+
};
|
|
43
|
+
}) => any;
|
|
44
|
+
};
|
|
45
|
+
refs: {};
|
|
46
|
+
rootEl: HTMLDivElement;
|
|
47
|
+
};
|
|
48
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
49
|
+
declare const __VLS_component: import('vue').DefineComponent<IProCalendarProps, {
|
|
50
|
+
changePageShowDate: typeof changePageShowDate;
|
|
51
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
52
|
+
change: (date: Date) => any;
|
|
53
|
+
"update:modelValue": (date: Date) => any;
|
|
54
|
+
panelChange: (date: Date) => any;
|
|
55
|
+
}, string, import('vue').PublicProps, Readonly<IProCalendarProps> & Readonly<{
|
|
56
|
+
onChange?: ((date: Date) => any) | undefined;
|
|
57
|
+
"onUpdate:modelValue"?: ((date: Date) => any) | undefined;
|
|
58
|
+
onPanelChange?: ((date: Date) => any) | undefined;
|
|
59
|
+
}>, {
|
|
60
|
+
header: boolean | import('./interface.ts').IHeaderObjProps;
|
|
61
|
+
modes: (EMode.month | EMode.year)[];
|
|
62
|
+
defaultMode: EMode.month | EMode.year;
|
|
63
|
+
allowSelect: boolean;
|
|
64
|
+
panelTodayBtn: boolean;
|
|
65
|
+
dayStartOfWeek: 0 | 1;
|
|
66
|
+
isWeek: boolean;
|
|
67
|
+
panel: boolean;
|
|
68
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
69
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
70
|
+
export default _default;
|
|
71
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
72
|
+
new (): {
|
|
73
|
+
$slots: S;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { defineComponent as R, useSlots as U, ref as k, computed as r, watch as X, createElementBlock as v, openBlock as m, mergeProps as i, createVNode as Z, createCommentVNode as S, createSlots as O, withCtx as P, unref as u, renderSlot as x, normalizeClass as w, createBlock as A, toDisplayString as ee } from "vue";
|
|
2
|
+
import ae from "./month.vue.js";
|
|
3
|
+
import te from "./year.vue.js";
|
|
4
|
+
import oe from "./header.vue.js";
|
|
5
|
+
import { getDayjsValue as N, getNow as le, pickDataAttributes as ne, methods as h } from "@arco-design/web-vue/es/_utils/date";
|
|
6
|
+
import { getPrefixCls as re } from "@arco-design/web-vue/es/_utils/global-config";
|
|
7
|
+
import { useI18n as ue } from "@arco-design/web-vue/es/locale";
|
|
8
|
+
import { getAllDaysByTime as de } from "./month.js";
|
|
9
|
+
import { EMode as l } from "./enum.js";
|
|
10
|
+
import { conclude as se } from "vue-global-config";
|
|
11
|
+
import { globalProps as C } from "../global-props.js";
|
|
12
|
+
const we = /* @__PURE__ */ R({
|
|
13
|
+
__name: "calendar",
|
|
14
|
+
props: {
|
|
15
|
+
modelValue: {},
|
|
16
|
+
defaultValue: {},
|
|
17
|
+
mode: {},
|
|
18
|
+
defaultMode: { default: l.month },
|
|
19
|
+
modes: { default: () => [l.month, l.year] },
|
|
20
|
+
header: { type: [Boolean, Object], default: !0 },
|
|
21
|
+
allowSelect: { type: Boolean, default: !0 },
|
|
22
|
+
panelWidth: {},
|
|
23
|
+
panelTodayBtn: { type: Boolean, default: !1 },
|
|
24
|
+
dayStartOfWeek: { default: 0 },
|
|
25
|
+
isWeek: { type: Boolean, default: !1 },
|
|
26
|
+
panel: { type: Boolean, default: !1 }
|
|
27
|
+
},
|
|
28
|
+
emits: ["update:modelValue", "change", "panelChange"],
|
|
29
|
+
setup(T, { expose: j, emit: E }) {
|
|
30
|
+
function F(e, o) {
|
|
31
|
+
return e === l.month || e === l.year && !o ? "YYYY-MM-DD" : "YYYY-MM";
|
|
32
|
+
}
|
|
33
|
+
const t = T, s = E, D = U(), d = re("calendar"), { t: g } = ue(), V = k(t.defaultMode), n = r(() => t.mode ? t.mode : V.value), W = r(() => F(n.value, t.panel)), M = k(N(t.defaultValue || Date.now(), W.value)), p = r(() => t.modelValue ? N(t.modelValue, W.value) : M.value), a = k(p.value || le());
|
|
34
|
+
X(p, (e) => {
|
|
35
|
+
a.value = e;
|
|
36
|
+
});
|
|
37
|
+
const B = r(() => de(a.value, {
|
|
38
|
+
dayStartOfWeek: t.dayStartOfWeek,
|
|
39
|
+
isWeek: t.isWeek
|
|
40
|
+
}));
|
|
41
|
+
function z(e) {
|
|
42
|
+
a.value = e, s("panelChange", e.toDate());
|
|
43
|
+
}
|
|
44
|
+
function Y(e) {
|
|
45
|
+
M.value = e, s("change", e.toDate()), s("update:modelValue", e.toDate()), z(e);
|
|
46
|
+
}
|
|
47
|
+
function _(e, o = !1) {
|
|
48
|
+
o || Y(e);
|
|
49
|
+
}
|
|
50
|
+
const H = r(() => n.value === l.month ? g("calendar.formatMonth") : n.value === l.year ? g("calendar.formatYear") : "");
|
|
51
|
+
function $(e, o) {
|
|
52
|
+
e.includes("prev") && (a.value = h.subtract(a.value, 1, o)), e.includes("next") && (a.value = h.add(a.value, 1, o)), s("panelChange", a.value.toDate());
|
|
53
|
+
}
|
|
54
|
+
function I(e) {
|
|
55
|
+
const o = h.set(a.value, l.year, e);
|
|
56
|
+
a.value = o, s("panelChange", o.toDate());
|
|
57
|
+
}
|
|
58
|
+
function q(e) {
|
|
59
|
+
const o = h.set(a.value, l.month, e - 1);
|
|
60
|
+
a.value = o, s("panelChange", o.toDate());
|
|
61
|
+
}
|
|
62
|
+
function G(e) {
|
|
63
|
+
V.value = e;
|
|
64
|
+
}
|
|
65
|
+
const J = r(() => [
|
|
66
|
+
d,
|
|
67
|
+
n.value === l.month ? `${d}-mode-month` : `${d}-mode-year`,
|
|
68
|
+
{
|
|
69
|
+
[`${d}-panel`]: t.panel && (n.value === l.month || n.value === l.year)
|
|
70
|
+
}
|
|
71
|
+
]), K = r(() => t.panel ? { width: t.panelWidth } : {}), L = r(() => ne(t)), Q = r(() => {
|
|
72
|
+
var e;
|
|
73
|
+
return se([t.header, ((e = C.calendar) == null ? void 0 : e.header) || {}]);
|
|
74
|
+
}), y = r(() => {
|
|
75
|
+
var e, o;
|
|
76
|
+
return {
|
|
77
|
+
dayStartOfWeek: ((e = C.calendar) == null ? void 0 : e.dayStartOfWeek) || t.dayStartOfWeek,
|
|
78
|
+
isWeek: ((o = C.calendar) == null ? void 0 : o.isWeek) || t.isWeek
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
return j({
|
|
82
|
+
changePageShowDate: $
|
|
83
|
+
}), (e, o) => (m(), v("div", i({
|
|
84
|
+
class: J.value,
|
|
85
|
+
style: K.value
|
|
86
|
+
}, L.value), [
|
|
87
|
+
Z(oe, i(y.value, {
|
|
88
|
+
header: Q.value,
|
|
89
|
+
move: Y,
|
|
90
|
+
"header-value-format": H.value,
|
|
91
|
+
modes: e.modes,
|
|
92
|
+
mode: n.value,
|
|
93
|
+
"page-show-date": a.value,
|
|
94
|
+
onModeChange: G,
|
|
95
|
+
onYearChange: I,
|
|
96
|
+
onMonthChange: q,
|
|
97
|
+
onChangePageShowDate: $
|
|
98
|
+
}), O({ _: 2 }, [
|
|
99
|
+
u(D).header ? {
|
|
100
|
+
name: "default",
|
|
101
|
+
fn: P(({ year: c, month: f }) => [
|
|
102
|
+
x(e.$slots, "header", {
|
|
103
|
+
value: { year: c, month: f },
|
|
104
|
+
year: c.toString(),
|
|
105
|
+
month: f.toString().padStart(2, "0")
|
|
106
|
+
})
|
|
107
|
+
]),
|
|
108
|
+
key: "0"
|
|
109
|
+
} : void 0
|
|
110
|
+
]), 1040, ["header", "header-value-format", "modes", "mode", "page-show-date"]),
|
|
111
|
+
n.value === u(l).month ? (m(), v("div", {
|
|
112
|
+
key: 0,
|
|
113
|
+
class: w(`${u(d)}-body`)
|
|
114
|
+
}, [
|
|
115
|
+
(m(), A(ae, i(y.value, {
|
|
116
|
+
key: a.value.month(),
|
|
117
|
+
"page-data": B.value,
|
|
118
|
+
value: p.value,
|
|
119
|
+
mode: n.value,
|
|
120
|
+
"select-handler": _,
|
|
121
|
+
"page-show-date": a.value
|
|
122
|
+
}), O({ _: 2 }, [
|
|
123
|
+
u(D).default ? {
|
|
124
|
+
name: "default",
|
|
125
|
+
fn: P(({ year: c, month: f, date: b }) => [
|
|
126
|
+
x(e.$slots, "default", {
|
|
127
|
+
year: c.toString(),
|
|
128
|
+
month: f.toString().padStart(2, "0"),
|
|
129
|
+
date: b.toString().padStart(2, "0"),
|
|
130
|
+
value: { year: c, month: f, date: b }
|
|
131
|
+
})
|
|
132
|
+
]),
|
|
133
|
+
key: "0"
|
|
134
|
+
} : void 0
|
|
135
|
+
]), 1040, ["page-data", "value", "mode", "page-show-date"]))
|
|
136
|
+
], 2)) : S("", !0),
|
|
137
|
+
n.value === u(l).year ? (m(), v("div", {
|
|
138
|
+
key: 1,
|
|
139
|
+
class: w(`${u(d)}-body`)
|
|
140
|
+
}, [
|
|
141
|
+
(m(), A(te, i(y.value, {
|
|
142
|
+
key: a.value.year(),
|
|
143
|
+
"page-data": B.value,
|
|
144
|
+
"page-show-date": a.value,
|
|
145
|
+
mode: n.value,
|
|
146
|
+
value: p.value,
|
|
147
|
+
"select-handler": _
|
|
148
|
+
}), null, 16, ["page-data", "page-show-date", "mode", "value"]))
|
|
149
|
+
], 2)) : S("", !0),
|
|
150
|
+
e.panel && e.panelTodayBtn ? (m(), v("div", {
|
|
151
|
+
key: 2,
|
|
152
|
+
class: w(`${u(d)}-footer-btn-wrapper`)
|
|
153
|
+
}, ee(u(g)("today")), 3)) : S("", !0)
|
|
154
|
+
], 16));
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
export {
|
|
158
|
+
we as default
|
|
159
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IProCalendarHeader } from './interface.ts';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {
|
|
6
|
+
year: number;
|
|
7
|
+
month: number;
|
|
8
|
+
}): any;
|
|
9
|
+
default?(_: {
|
|
10
|
+
year: number;
|
|
11
|
+
month: number;
|
|
12
|
+
}): any;
|
|
13
|
+
default?(_: {
|
|
14
|
+
year: number;
|
|
15
|
+
month: number;
|
|
16
|
+
}): any;
|
|
17
|
+
};
|
|
18
|
+
refs: {};
|
|
19
|
+
rootEl: HTMLDivElement;
|
|
20
|
+
};
|
|
21
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
22
|
+
declare const __VLS_component: import('vue').DefineComponent<IProCalendarHeader, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
23
|
+
yearChange: (year: number) => any;
|
|
24
|
+
monthChange: (month: number) => any;
|
|
25
|
+
}, string, import('vue').PublicProps, Readonly<IProCalendarHeader> & Readonly<{
|
|
26
|
+
onYearChange?: ((year: number) => any) | undefined;
|
|
27
|
+
onMonthChange?: ((month: number) => any) | undefined;
|
|
28
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
29
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { defineComponent as z, useSlots as Y, computed as s, withDirectives as v, createElementBlock as m, openBlock as d, normalizeClass as n, unref as o, renderSlot as g, createCommentVNode as y, createElementVNode as i, createVNode as u, Fragment as C, createBlock as E, createTextVNode as D, toDisplayString as b, withCtx as I, vShow as c } from "vue";
|
|
2
|
+
import { Select as F, Radio as O } from "@arco-design/web-vue";
|
|
3
|
+
import R from "@arco-design/web-vue/es/button";
|
|
4
|
+
import T from "@arco-design/web-vue/es/icon/icon-left";
|
|
5
|
+
import L from "@arco-design/web-vue/es/icon/icon-right";
|
|
6
|
+
import { getNow as W } from "@arco-design/web-vue/es/_utils/date";
|
|
7
|
+
import { isArray as j } from "@arco-design/web-vue/es/_utils/is";
|
|
8
|
+
import { getPrefixCls as A } from "@arco-design/web-vue/es/_utils/global-config";
|
|
9
|
+
import { useI18n as G } from "@arco-design/web-vue/es/locale";
|
|
10
|
+
import { EMode as k } from "./enum.js";
|
|
11
|
+
const ee = /* @__PURE__ */ z({
|
|
12
|
+
__name: "header",
|
|
13
|
+
props: {
|
|
14
|
+
mode: {},
|
|
15
|
+
modes: {},
|
|
16
|
+
pageShowDate: {},
|
|
17
|
+
move: { type: Function },
|
|
18
|
+
onYearChange: { type: Function },
|
|
19
|
+
onMonthChange: { type: Function },
|
|
20
|
+
onChangePageShowDate: { type: Function },
|
|
21
|
+
onModeChange: { type: Function },
|
|
22
|
+
headerValueFormat: {},
|
|
23
|
+
header: { type: [Boolean, Object] },
|
|
24
|
+
dayStartOfWeek: {},
|
|
25
|
+
isWeek: { type: Boolean },
|
|
26
|
+
panel: { type: Boolean }
|
|
27
|
+
},
|
|
28
|
+
emits: ["yearChange", "monthChange"],
|
|
29
|
+
setup(B) {
|
|
30
|
+
const l = B, h = Y(), t = A("calendar"), { t: S } = G(), M = s(() => j(l.modes) ? l.modes.map((e) => ({
|
|
31
|
+
label: S(`datePicker.view.${e}`),
|
|
32
|
+
value: e
|
|
33
|
+
})) : []), N = s(() => {
|
|
34
|
+
var e;
|
|
35
|
+
return ((e = l.header) == null ? void 0 : e.headerType) === "select";
|
|
36
|
+
}), r = s(() => l.pageShowDate.year()), p = s(() => l.pageShowDate.month() + 1), P = s(() => {
|
|
37
|
+
const e = [r.value];
|
|
38
|
+
for (let a = 1; a <= 10; a++)
|
|
39
|
+
e.unshift(r.value - a);
|
|
40
|
+
for (let a = 1; a < 10; a++)
|
|
41
|
+
e.push(r.value + a);
|
|
42
|
+
return e;
|
|
43
|
+
}), V = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
44
|
+
return (e, a) => {
|
|
45
|
+
var w, $;
|
|
46
|
+
return v((d(), m("div", {
|
|
47
|
+
class: n(`${o(t)}-header`)
|
|
48
|
+
}, [
|
|
49
|
+
o(h).default && e.header.slot === "start" ? g(e.$slots, "default", {
|
|
50
|
+
key: 0,
|
|
51
|
+
year: r.value,
|
|
52
|
+
month: p.value
|
|
53
|
+
}) : y("", !0),
|
|
54
|
+
v(i("div", {
|
|
55
|
+
class: n(`${o(t)}-header-left`)
|
|
56
|
+
}, [
|
|
57
|
+
N.value ? (d(), m(C, { key: 0 }, [
|
|
58
|
+
u(o(F), {
|
|
59
|
+
size: "small",
|
|
60
|
+
class: n(`${o(t)}-header-value-year`),
|
|
61
|
+
"default-value": r.value,
|
|
62
|
+
options: P.value,
|
|
63
|
+
onChange: a[0] || (a[0] = (f) => {
|
|
64
|
+
e.onYearChange(Number(f));
|
|
65
|
+
}),
|
|
66
|
+
"popup-container": `${o(t)}-header`
|
|
67
|
+
}, null, 8, ["class", "default-value", "options", "popup-container"]),
|
|
68
|
+
e.mode === o(k).month ? (d(), E(o(F), {
|
|
69
|
+
key: 0,
|
|
70
|
+
size: "small",
|
|
71
|
+
class: n(`${o(t)}-header-value-month`),
|
|
72
|
+
"default-value": p.value,
|
|
73
|
+
options: V,
|
|
74
|
+
onChange: a[1] || (a[1] = (f) => {
|
|
75
|
+
e.onMonthChange(Number(f));
|
|
76
|
+
}),
|
|
77
|
+
"popup-container": `${o(t)}-header`
|
|
78
|
+
}, null, 8, ["class", "default-value", "popup-container"])) : y("", !0)
|
|
79
|
+
], 64)) : (d(), m(C, { key: 1 }, [
|
|
80
|
+
i("div", {
|
|
81
|
+
class: n(`${o(t)}-header-icon`),
|
|
82
|
+
role: "button",
|
|
83
|
+
tabindex: "0",
|
|
84
|
+
onClick: a[2] || (a[2] = () => e.onChangePageShowDate("prev", e.mode || o(k).month))
|
|
85
|
+
}, [
|
|
86
|
+
u(o(T))
|
|
87
|
+
], 2),
|
|
88
|
+
i("div", {
|
|
89
|
+
class: n(`${o(t)}-header-value`)
|
|
90
|
+
}, [
|
|
91
|
+
o(h).default && (e.header.slot === "date" || !e.header.slot) ? g(e.$slots, "default", {
|
|
92
|
+
key: 0,
|
|
93
|
+
year: r.value,
|
|
94
|
+
month: p.value
|
|
95
|
+
}) : (d(), m(C, { key: 1 }, [
|
|
96
|
+
D(b(e.pageShowDate.format(e.headerValueFormat)), 1)
|
|
97
|
+
], 64))
|
|
98
|
+
], 2),
|
|
99
|
+
i("div", {
|
|
100
|
+
role: "button",
|
|
101
|
+
tabindex: "0",
|
|
102
|
+
class: n(`${o(t)}-header-icon`),
|
|
103
|
+
onClick: a[3] || (a[3] = () => e.onChangePageShowDate("next", e.mode || o(k).month))
|
|
104
|
+
}, [
|
|
105
|
+
u(o(L))
|
|
106
|
+
], 2)
|
|
107
|
+
], 64)),
|
|
108
|
+
u(o(R), {
|
|
109
|
+
size: "small",
|
|
110
|
+
onClick: a[4] || (a[4] = () => e.move(o(W)()))
|
|
111
|
+
}, {
|
|
112
|
+
default: I(() => [
|
|
113
|
+
D(b(o(S)("datePicker.today")), 1)
|
|
114
|
+
]),
|
|
115
|
+
_: 1
|
|
116
|
+
})
|
|
117
|
+
], 2), [
|
|
118
|
+
[c, !((w = e.header) != null && w.hideLeft)]
|
|
119
|
+
]),
|
|
120
|
+
v(i("div", {
|
|
121
|
+
class: n(`${o(t)}-header-right`)
|
|
122
|
+
}, [
|
|
123
|
+
u(o(O).Group, {
|
|
124
|
+
size: "small",
|
|
125
|
+
type: "button",
|
|
126
|
+
options: M.value,
|
|
127
|
+
onChange: e.onModeChange,
|
|
128
|
+
"model-value": e.mode
|
|
129
|
+
}, null, 8, ["options", "onChange", "model-value"])
|
|
130
|
+
], 2), [
|
|
131
|
+
[c, !(($ = e.header) != null && $.hideRight)]
|
|
132
|
+
]),
|
|
133
|
+
o(h).default && e.header.slot === "end" ? g(e.$slots, "default", {
|
|
134
|
+
key: 1,
|
|
135
|
+
year: r.value,
|
|
136
|
+
month: p.value
|
|
137
|
+
}) : y("", !0)
|
|
138
|
+
], 2)), [
|
|
139
|
+
[c, e.header]
|
|
140
|
+
]);
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
export {
|
|
145
|
+
ee as default
|
|
146
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const useClassName: ({ prefixCls, mergedValue, rangeValues, hoverRangeValues, panel, isSameTime, innerMode, }: {
|
|
2
|
+
prefixCls: any;
|
|
3
|
+
mergedValue: any;
|
|
4
|
+
rangeValues: any;
|
|
5
|
+
hoverRangeValues: any;
|
|
6
|
+
panel: any;
|
|
7
|
+
isSameTime: any;
|
|
8
|
+
innerMode: any;
|
|
9
|
+
}) => (cellDateObj: any, disabled: any) => (string | {
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
})[];
|
|
12
|
+
export default useClassName;
|