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