@keyblade/pro-components 1.13.8-alpha.23 → 1.13.8-alpha.25
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/pro-calendar/calendar.vue.d.ts +5 -6
- package/es/pro-calendar/calendar.vue.js +50 -48
- package/es/pro-calendar/header.vue.js +23 -21
- package/es/pro-calendar/index.d.ts +12 -18
- package/es/pro-calendar/inerface.d.ts +6 -5
- package/es/pro-date-range-picker/inerface.d.ts +2 -2
- package/es/pro-dates-picker/index.vue.js +45 -41
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IProCalendarProps } from './inerface';
|
|
2
2
|
import { EMode } from './enum';
|
|
3
|
+
declare function changePageShowDate(type: 'prev' | 'next', unit: EMode): void;
|
|
3
4
|
declare function __VLS_template(): {
|
|
4
5
|
attrs: Partial<{}>;
|
|
5
6
|
slots: Readonly<{
|
|
@@ -45,7 +46,9 @@ declare function __VLS_template(): {
|
|
|
45
46
|
rootEl: HTMLDivElement;
|
|
46
47
|
};
|
|
47
48
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
48
|
-
declare const __VLS_component: import('vue').DefineComponent<IProCalendarProps, {
|
|
49
|
+
declare const __VLS_component: import('vue').DefineComponent<IProCalendarProps, {
|
|
50
|
+
changePageShowDate: typeof changePageShowDate;
|
|
51
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
49
52
|
change: (date: Date) => any;
|
|
50
53
|
"update:modelValue": (date: Date) => any;
|
|
51
54
|
panelChange: (date: Date) => any;
|
|
@@ -54,11 +57,7 @@ declare const __VLS_component: import('vue').DefineComponent<IProCalendarProps,
|
|
|
54
57
|
"onUpdate:modelValue"?: ((date: Date) => any) | undefined;
|
|
55
58
|
onPanelChange?: ((date: Date) => any) | undefined;
|
|
56
59
|
}>, {
|
|
57
|
-
header: boolean |
|
|
58
|
-
hideLeft?: boolean;
|
|
59
|
-
hideRight?: boolean;
|
|
60
|
-
slot?: "start" | "date" | "end";
|
|
61
|
-
};
|
|
60
|
+
header: boolean | import('./inerface').IHeaderObjProps;
|
|
62
61
|
modes: (EMode.month | EMode.year)[];
|
|
63
62
|
defaultMode: EMode.month | EMode.year;
|
|
64
63
|
allowSelect: boolean;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as R, useSlots as U, ref as k, computed as r, watch as X, createElementBlock as i, openBlock as m, mergeProps as v, 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
2
|
import "dayjs";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { getDayjsValue as
|
|
7
|
-
import { getPrefixCls as
|
|
8
|
-
import { useI18n as
|
|
9
|
-
import { getAllDaysByTime as
|
|
3
|
+
import ae from "./month.vue.js";
|
|
4
|
+
import te from "./year.vue.js";
|
|
5
|
+
import oe from "./header.vue.js";
|
|
6
|
+
import { getDayjsValue as N, getNow as le, pickDataAttributes as ne, methods as h } from "@arco-design/web-vue/es/_utils/date";
|
|
7
|
+
import { getPrefixCls as re } from "@arco-design/web-vue/es/_utils/global-config";
|
|
8
|
+
import { useI18n as ue } from "@arco-design/web-vue/es/locale";
|
|
9
|
+
import { getAllDaysByTime as de } from "./month.js";
|
|
10
10
|
import { EMode as l } from "./enum.js";
|
|
11
|
-
import { conclude as
|
|
11
|
+
import { conclude as se } from "vue-global-config";
|
|
12
12
|
import { globalProps as C } from "../global-props.js";
|
|
13
|
-
const
|
|
13
|
+
const Ce = /* @__PURE__ */ R({
|
|
14
14
|
__name: "calendar",
|
|
15
15
|
props: {
|
|
16
16
|
modelValue: {},
|
|
@@ -27,51 +27,51 @@ const we = /* @__PURE__ */ Q({
|
|
|
27
27
|
panel: { type: Boolean, default: !1 }
|
|
28
28
|
},
|
|
29
29
|
emits: ["update:modelValue", "change", "panelChange"],
|
|
30
|
-
setup(
|
|
31
|
-
function
|
|
30
|
+
setup(T, { expose: j, emit: E }) {
|
|
31
|
+
function F(e, o) {
|
|
32
32
|
return e === l.month || e === l.year && !o ? "YYYY-MM-DD" : "YYYY-MM";
|
|
33
33
|
}
|
|
34
|
-
const t =
|
|
35
|
-
|
|
34
|
+
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());
|
|
35
|
+
X(p, (e) => {
|
|
36
36
|
a.value = e;
|
|
37
37
|
});
|
|
38
|
-
const B = r(() =>
|
|
38
|
+
const B = r(() => de(a.value, {
|
|
39
39
|
dayStartOfWeek: t.dayStartOfWeek,
|
|
40
40
|
isWeek: t.isWeek
|
|
41
41
|
}));
|
|
42
|
-
function
|
|
42
|
+
function z(e) {
|
|
43
43
|
a.value = e, s("panelChange", e.toDate());
|
|
44
44
|
}
|
|
45
45
|
function Y(e) {
|
|
46
|
-
M.value = e, s("change", e.toDate()), s("update:modelValue", e.toDate()),
|
|
46
|
+
M.value = e, s("change", e.toDate()), s("update:modelValue", e.toDate()), z(e);
|
|
47
47
|
}
|
|
48
48
|
function _(e, o = !1) {
|
|
49
49
|
o || Y(e);
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
function
|
|
51
|
+
const H = r(() => n.value === l.month ? g("calendar.formatMonth") : n.value === l.year ? g("calendar.formatYear") : "");
|
|
52
|
+
function $(e, o) {
|
|
53
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
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function I(e) {
|
|
56
56
|
const o = h.set(a.value, l.year, e);
|
|
57
57
|
a.value = o, s("panelChange", o.toDate());
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function q(e) {
|
|
60
60
|
const o = h.set(a.value, l.month, e - 1);
|
|
61
61
|
a.value = o, s("panelChange", o.toDate());
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function G(e) {
|
|
64
64
|
V.value = e;
|
|
65
65
|
}
|
|
66
|
-
const
|
|
66
|
+
const J = r(() => [
|
|
67
67
|
d,
|
|
68
68
|
n.value === l.month ? `${d}-mode-month` : `${d}-mode-year`,
|
|
69
69
|
{
|
|
70
70
|
[`${d}-panel`]: t.panel && (n.value === l.month || n.value === l.year)
|
|
71
71
|
}
|
|
72
|
-
]),
|
|
72
|
+
]), K = r(() => t.panel ? { width: t.panelWidth } : {}), L = r(() => ne(t)), Q = r(() => {
|
|
73
73
|
var e;
|
|
74
|
-
return
|
|
74
|
+
return se([t.header, ((e = C.calendar) == null ? void 0 : e.header) || {}]);
|
|
75
75
|
}), y = r(() => {
|
|
76
76
|
var e, o;
|
|
77
77
|
return {
|
|
@@ -79,26 +79,28 @@ const we = /* @__PURE__ */ Q({
|
|
|
79
79
|
isWeek: ((o = C.calendar) == null ? void 0 : o.isWeek) || t.isWeek
|
|
80
80
|
};
|
|
81
81
|
});
|
|
82
|
-
return (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
return j({
|
|
83
|
+
changePageShowDate: $
|
|
84
|
+
}), (e, o) => (m(), i("div", v({
|
|
85
|
+
class: J.value,
|
|
86
|
+
style: K.value
|
|
87
|
+
}, L.value), [
|
|
88
|
+
Z(oe, v(y.value, {
|
|
89
|
+
header: Q.value,
|
|
88
90
|
move: Y,
|
|
89
|
-
"header-value-format":
|
|
91
|
+
"header-value-format": H.value,
|
|
90
92
|
modes: e.modes,
|
|
91
93
|
mode: n.value,
|
|
92
94
|
"page-show-date": a.value,
|
|
93
|
-
onModeChange:
|
|
94
|
-
onYearChange:
|
|
95
|
-
onMonthChange:
|
|
96
|
-
onChangePageShowDate:
|
|
97
|
-
}),
|
|
95
|
+
onModeChange: G,
|
|
96
|
+
onYearChange: I,
|
|
97
|
+
onMonthChange: q,
|
|
98
|
+
onChangePageShowDate: $
|
|
99
|
+
}), O({ _: 2 }, [
|
|
98
100
|
u(D).header ? {
|
|
99
101
|
name: "default",
|
|
100
|
-
fn:
|
|
101
|
-
|
|
102
|
+
fn: P(({ year: c, month: f }) => [
|
|
103
|
+
x(e.$slots, "header", {
|
|
102
104
|
value: { year: c, month: f },
|
|
103
105
|
year: c.toString(),
|
|
104
106
|
month: f.toString().padStart(2, "0")
|
|
@@ -111,22 +113,22 @@ const we = /* @__PURE__ */ Q({
|
|
|
111
113
|
key: 0,
|
|
112
114
|
class: w(`${u(d)}-body`)
|
|
113
115
|
}, [
|
|
114
|
-
(m(),
|
|
116
|
+
(m(), A(ae, v(y.value, {
|
|
115
117
|
key: a.value.month(),
|
|
116
118
|
"page-data": B.value,
|
|
117
119
|
value: p.value,
|
|
118
120
|
mode: n.value,
|
|
119
121
|
"select-handler": _,
|
|
120
122
|
"page-show-date": a.value
|
|
121
|
-
}),
|
|
123
|
+
}), O({ _: 2 }, [
|
|
122
124
|
u(D).default ? {
|
|
123
125
|
name: "default",
|
|
124
|
-
fn:
|
|
125
|
-
|
|
126
|
+
fn: P(({ year: c, month: f, date: b }) => [
|
|
127
|
+
x(e.$slots, "default", {
|
|
126
128
|
year: c.toString(),
|
|
127
129
|
month: f.toString().padStart(2, "0"),
|
|
128
|
-
date:
|
|
129
|
-
value: { year: c, month: f, date:
|
|
130
|
+
date: b.toString().padStart(2, "0"),
|
|
131
|
+
value: { year: c, month: f, date: b }
|
|
130
132
|
})
|
|
131
133
|
]),
|
|
132
134
|
key: "0"
|
|
@@ -137,7 +139,7 @@ const we = /* @__PURE__ */ Q({
|
|
|
137
139
|
key: 1,
|
|
138
140
|
class: w(`${u(d)}-body`)
|
|
139
141
|
}, [
|
|
140
|
-
(m(),
|
|
142
|
+
(m(), A(te, v(y.value, {
|
|
141
143
|
key: a.value.year(),
|
|
142
144
|
"page-data": B.value,
|
|
143
145
|
"page-show-date": a.value,
|
|
@@ -149,10 +151,10 @@ const we = /* @__PURE__ */ Q({
|
|
|
149
151
|
e.panel && e.panelTodayBtn ? (m(), i("div", {
|
|
150
152
|
key: 2,
|
|
151
153
|
class: w(`${u(d)}-footer-btn-wrapper`)
|
|
152
|
-
},
|
|
154
|
+
}, ee(u(g)("today")), 3)) : S("", !0)
|
|
153
155
|
], 16));
|
|
154
156
|
}
|
|
155
157
|
});
|
|
156
158
|
export {
|
|
157
|
-
|
|
159
|
+
Ce as default
|
|
158
160
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as z, useSlots as
|
|
2
|
-
import { Select as F, Radio as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
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
5
|
import L from "@arco-design/web-vue/es/icon/icon-right";
|
|
6
6
|
import { getNow as W } from "@arco-design/web-vue/es/_utils/date";
|
|
7
7
|
import { isArray as j } from "@arco-design/web-vue/es/_utils/is";
|
|
@@ -13,7 +13,6 @@ const ee = /* @__PURE__ */ z({
|
|
|
13
13
|
props: {
|
|
14
14
|
mode: {},
|
|
15
15
|
modes: {},
|
|
16
|
-
headerType: {},
|
|
17
16
|
pageShowDate: {},
|
|
18
17
|
move: { type: Function },
|
|
19
18
|
onYearChange: { type: Function },
|
|
@@ -28,10 +27,13 @@ const ee = /* @__PURE__ */ z({
|
|
|
28
27
|
},
|
|
29
28
|
emits: ["yearChange", "monthChange"],
|
|
30
29
|
setup(B) {
|
|
31
|
-
const l = B,
|
|
30
|
+
const l = B, h = Y(), t = A("calendar"), { t: S } = G(), M = s(() => j(l.modes) ? l.modes.map((e) => ({
|
|
32
31
|
label: S(`datePicker.view.${e}`),
|
|
33
32
|
value: e
|
|
34
|
-
})) : []), N = s(() =>
|
|
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(() => {
|
|
35
37
|
const e = [r.value];
|
|
36
38
|
for (let a = 1; a <= 10; a++)
|
|
37
39
|
e.unshift(r.value - a);
|
|
@@ -41,10 +43,10 @@ const ee = /* @__PURE__ */ z({
|
|
|
41
43
|
}), V = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
42
44
|
return (e, a) => {
|
|
43
45
|
var w, $;
|
|
44
|
-
return v((d(),
|
|
46
|
+
return v((d(), m("div", {
|
|
45
47
|
class: n(`${o(t)}-header`)
|
|
46
48
|
}, [
|
|
47
|
-
o(
|
|
49
|
+
o(h).default && e.header.slot === "start" ? g(e.$slots, "default", {
|
|
48
50
|
key: 0,
|
|
49
51
|
year: r.value,
|
|
50
52
|
month: p.value
|
|
@@ -52,45 +54,45 @@ const ee = /* @__PURE__ */ z({
|
|
|
52
54
|
v(i("div", {
|
|
53
55
|
class: n(`${o(t)}-header-left`)
|
|
54
56
|
}, [
|
|
55
|
-
N.value ? (d(),
|
|
57
|
+
N.value ? (d(), m(C, { key: 0 }, [
|
|
56
58
|
u(o(F), {
|
|
57
59
|
size: "small",
|
|
58
60
|
class: n(`${o(t)}-header-value-year`),
|
|
59
61
|
"default-value": r.value,
|
|
60
62
|
options: P.value,
|
|
61
63
|
onChange: a[0] || (a[0] = (f) => {
|
|
62
|
-
|
|
64
|
+
e.onYearChange(Number(f));
|
|
63
65
|
}),
|
|
64
66
|
"popup-container": `${o(t)}-header`
|
|
65
67
|
}, null, 8, ["class", "default-value", "options", "popup-container"]),
|
|
66
|
-
e.mode === o(k).month ? (d(),
|
|
68
|
+
e.mode === o(k).month ? (d(), E(o(F), {
|
|
67
69
|
key: 0,
|
|
68
70
|
size: "small",
|
|
69
71
|
class: n(`${o(t)}-header-value-month`),
|
|
70
72
|
"default-value": p.value,
|
|
71
73
|
options: V,
|
|
72
74
|
onChange: a[1] || (a[1] = (f) => {
|
|
73
|
-
|
|
75
|
+
e.onMonthChange(Number(f));
|
|
74
76
|
}),
|
|
75
77
|
"popup-container": `${o(t)}-header`
|
|
76
78
|
}, null, 8, ["class", "default-value", "popup-container"])) : y("", !0)
|
|
77
|
-
], 64)) : (d(),
|
|
79
|
+
], 64)) : (d(), m(C, { key: 1 }, [
|
|
78
80
|
i("div", {
|
|
79
81
|
class: n(`${o(t)}-header-icon`),
|
|
80
82
|
role: "button",
|
|
81
83
|
tabindex: "0",
|
|
82
84
|
onClick: a[2] || (a[2] = () => e.onChangePageShowDate("prev", e.mode || o(k).month))
|
|
83
85
|
}, [
|
|
84
|
-
u(o(
|
|
86
|
+
u(o(T))
|
|
85
87
|
], 2),
|
|
86
88
|
i("div", {
|
|
87
89
|
class: n(`${o(t)}-header-value`)
|
|
88
90
|
}, [
|
|
89
|
-
o(
|
|
91
|
+
o(h).default && (e.header.slot === "date" || !e.header.slot) ? g(e.$slots, "default", {
|
|
90
92
|
key: 0,
|
|
91
93
|
year: r.value,
|
|
92
94
|
month: p.value
|
|
93
|
-
}) : (d(),
|
|
95
|
+
}) : (d(), m(C, { key: 1 }, [
|
|
94
96
|
D(b(e.pageShowDate.format(e.headerValueFormat)), 1)
|
|
95
97
|
], 64))
|
|
96
98
|
], 2),
|
|
@@ -103,11 +105,11 @@ const ee = /* @__PURE__ */ z({
|
|
|
103
105
|
u(o(L))
|
|
104
106
|
], 2)
|
|
105
107
|
], 64)),
|
|
106
|
-
u(o(
|
|
108
|
+
u(o(R), {
|
|
107
109
|
size: "small",
|
|
108
110
|
onClick: a[4] || (a[4] = () => e.move(o(W)()))
|
|
109
111
|
}, {
|
|
110
|
-
default:
|
|
112
|
+
default: I(() => [
|
|
111
113
|
D(b(o(S)("datePicker.today")), 1)
|
|
112
114
|
]),
|
|
113
115
|
_: 1
|
|
@@ -118,7 +120,7 @@ const ee = /* @__PURE__ */ z({
|
|
|
118
120
|
v(i("div", {
|
|
119
121
|
class: n(`${o(t)}-header-right`)
|
|
120
122
|
}, [
|
|
121
|
-
u(o(
|
|
123
|
+
u(o(O).Group, {
|
|
122
124
|
size: "small",
|
|
123
125
|
type: "button",
|
|
124
126
|
options: M.value,
|
|
@@ -128,7 +130,7 @@ const ee = /* @__PURE__ */ z({
|
|
|
128
130
|
], 2), [
|
|
129
131
|
[c, !(($ = e.header) != null && $.hideRight)]
|
|
130
132
|
]),
|
|
131
|
-
o(
|
|
133
|
+
o(h).default && e.header.slot === "end" ? g(e.$slots, "default", {
|
|
132
134
|
key: 1,
|
|
133
135
|
year: r.value,
|
|
134
136
|
month: p.value
|
|
@@ -7,16 +7,14 @@ declare const ProCalendar: {
|
|
|
7
7
|
onChange?: ((date: Date) => any) | undefined;
|
|
8
8
|
"onUpdate:modelValue"?: ((date: Date) => any) | undefined;
|
|
9
9
|
onPanelChange?: ((date: Date) => any) | undefined;
|
|
10
|
-
}>, {
|
|
10
|
+
}>, {
|
|
11
|
+
changePageShowDate: (type: "prev" | "next", unit: import('./enum').EMode) => void;
|
|
12
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
13
|
change: (date: Date) => any;
|
|
12
14
|
"update:modelValue": (date: Date) => any;
|
|
13
15
|
panelChange: (date: Date) => any;
|
|
14
16
|
}, import('vue').PublicProps, {
|
|
15
|
-
header: boolean |
|
|
16
|
-
hideLeft?: boolean;
|
|
17
|
-
hideRight?: boolean;
|
|
18
|
-
slot?: "start" | "date" | "end";
|
|
19
|
-
};
|
|
17
|
+
header: boolean | import('./inerface').IHeaderObjProps;
|
|
20
18
|
modes: (import("./enum").EMode.month | import("./enum").EMode.year)[];
|
|
21
19
|
defaultMode: import("./enum").EMode.month | import("./enum").EMode.year;
|
|
22
20
|
allowSelect: boolean;
|
|
@@ -35,12 +33,10 @@ declare const ProCalendar: {
|
|
|
35
33
|
onChange?: ((date: Date) => any) | undefined;
|
|
36
34
|
"onUpdate:modelValue"?: ((date: Date) => any) | undefined;
|
|
37
35
|
onPanelChange?: ((date: Date) => any) | undefined;
|
|
38
|
-
}>, {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
slot?: "start" | "date" | "end";
|
|
43
|
-
};
|
|
36
|
+
}>, {
|
|
37
|
+
changePageShowDate: (type: "prev" | "next", unit: import('./enum').EMode) => void;
|
|
38
|
+
}, {}, {}, {}, {
|
|
39
|
+
header: boolean | import('./inerface').IHeaderObjProps;
|
|
44
40
|
modes: (import("./enum").EMode.month | import("./enum").EMode.year)[];
|
|
45
41
|
defaultMode: import("./enum").EMode.month | import("./enum").EMode.year;
|
|
46
42
|
allowSelect: boolean;
|
|
@@ -56,16 +52,14 @@ declare const ProCalendar: {
|
|
|
56
52
|
onChange?: ((date: Date) => any) | undefined;
|
|
57
53
|
"onUpdate:modelValue"?: ((date: Date) => any) | undefined;
|
|
58
54
|
onPanelChange?: ((date: Date) => any) | undefined;
|
|
59
|
-
}>, {
|
|
55
|
+
}>, {
|
|
56
|
+
changePageShowDate: (type: "prev" | "next", unit: import('./enum').EMode) => void;
|
|
57
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
60
58
|
change: (date: Date) => any;
|
|
61
59
|
"update:modelValue": (date: Date) => any;
|
|
62
60
|
panelChange: (date: Date) => any;
|
|
63
61
|
}, string, {
|
|
64
|
-
header: boolean |
|
|
65
|
-
hideLeft?: boolean;
|
|
66
|
-
hideRight?: boolean;
|
|
67
|
-
slot?: "start" | "date" | "end";
|
|
68
|
-
};
|
|
62
|
+
header: boolean | import('./inerface').IHeaderObjProps;
|
|
69
63
|
modes: (import("./enum").EMode.month | import("./enum").EMode.year)[];
|
|
70
64
|
defaultMode: import("./enum").EMode.month | import("./enum").EMode.year;
|
|
71
65
|
allowSelect: boolean;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { Dayjs } from 'dayjs';
|
|
2
2
|
import { EMode } from './enum';
|
|
3
|
-
|
|
4
|
-
* @zh 隐藏头部
|
|
5
|
-
*/
|
|
6
|
-
type IHeaderProps = boolean | {
|
|
3
|
+
export type IHeaderObjProps = {
|
|
7
4
|
hideLeft?: boolean;
|
|
8
5
|
hideRight?: boolean;
|
|
6
|
+
headerType?: 'select';
|
|
9
7
|
slot?: 'start' | 'date' | 'end';
|
|
10
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* @zh 隐藏头部
|
|
11
|
+
*/
|
|
12
|
+
type IHeaderProps = boolean | IHeaderObjProps;
|
|
11
13
|
interface IProCalendarBase {
|
|
12
14
|
/** 0:周末开始 | 1:周一开始 */
|
|
13
15
|
dayStartOfWeek?: 0 | 1;
|
|
@@ -25,7 +27,6 @@ export interface IProCalendarHeader extends IProCalendarBase {
|
|
|
25
27
|
/** 模式 */
|
|
26
28
|
mode?: EMode.month | EMode.year;
|
|
27
29
|
modes?: (EMode.month | EMode.year)[];
|
|
28
|
-
headerType?: string;
|
|
29
30
|
pageShowDate: Dayjs;
|
|
30
31
|
move: (time: Dayjs) => void;
|
|
31
32
|
/** 年变化 */
|
|
@@ -21,9 +21,9 @@ export interface IProDateRangePickerProps {
|
|
|
21
21
|
hideLabel?: boolean;
|
|
22
22
|
formItemProps?: FormItemInstance;
|
|
23
23
|
/** 日期选择器配置 */
|
|
24
|
-
datePickerProps?: RangePickerProps
|
|
24
|
+
datePickerProps?: Partial<RangePickerProps>;
|
|
25
25
|
/** 时间选择器配置 */
|
|
26
|
-
timePickerProps?: TimePickerProps
|
|
26
|
+
timePickerProps?: Partial<TimePickerProps>;
|
|
27
27
|
/** 自定义禁用开始日期 */
|
|
28
28
|
disabledStartDate?: (params: {
|
|
29
29
|
current: Date;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as N, ref as m, useSlots as A, useAttrs as j, computed as Y, resolveComponent as f, createElementBlock as
|
|
1
|
+
import { defineComponent as N, ref as m, useSlots as A, useAttrs as j, computed as Y, onMounted as O, resolveComponent as f, createElementBlock as T, openBlock as U, normalizeClass as W, createVNode as v, withCtx as u, mergeProps as _, unref as P, withModifiers as q, createSlots as F, createElementVNode as M, normalizeStyle as G, toDisplayString as H, renderList as J, renderSlot as K, normalizeProps as Q, guardReactiveProps as X } from "vue";
|
|
2
2
|
import { conclude as h } from "vue-global-config";
|
|
3
3
|
import { globalProps as C } from "../global-props.js";
|
|
4
|
-
import
|
|
5
|
-
import { initSelected as
|
|
6
|
-
const
|
|
4
|
+
import s from "dayjs";
|
|
5
|
+
import { initSelected as Z, transDatesString as S } from "./util.js";
|
|
6
|
+
const ee = ["onClick"], te = "keyblade-pro-dates-picker", se = /* @__PURE__ */ N({
|
|
7
7
|
__name: "index",
|
|
8
8
|
props: {
|
|
9
9
|
modelValue: {},
|
|
@@ -31,39 +31,43 @@ const Z = ["onClick"], ee = "keyblade-pro-dates-picker", ne = /* @__PURE__ */ N(
|
|
|
31
31
|
datePickerProps: {
|
|
32
32
|
hideTrigger: !0
|
|
33
33
|
}
|
|
34
|
-
}, g = $,
|
|
35
|
-
const { datePickerProps: e, ...a } =
|
|
36
|
-
return h([a, C.datesPicker || {},
|
|
34
|
+
}, g = $, l = V, D = m(), x = m(null), c = m(Z(l.modelValue)), b = A(), w = j(), k = m(), B = Y(() => {
|
|
35
|
+
const { datePickerProps: e, ...a } = l, { datePickerProps: n, ...i } = y;
|
|
36
|
+
return h([a, C.datesPicker || {}, i]);
|
|
37
37
|
}), L = Y(() => {
|
|
38
38
|
var e;
|
|
39
|
-
return h([
|
|
40
|
-
}),
|
|
41
|
-
get: () =>
|
|
39
|
+
return h([l.datePickerProps, ((e = C.datesPicker) == null ? void 0 : e.datePickerProps) || {}, y.datePickerProps]);
|
|
40
|
+
}), o = Y({
|
|
41
|
+
get: () => l.modelValue,
|
|
42
42
|
set: (e) => {
|
|
43
43
|
typeof e == "string" ? g("update:modelValue", e || "") : g("update:modelValue", e || []);
|
|
44
44
|
}
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
45
|
+
});
|
|
46
|
+
O(() => {
|
|
47
|
+
(l.modelValue === null || l.modelValue === void 0) && (o.value = []);
|
|
48
|
+
});
|
|
49
|
+
const R = (e) => {
|
|
50
|
+
var i, p, d;
|
|
51
|
+
const a = s(e).format("YYYY-MM-DD"), n = c.value.findIndex((r) => s(r).format("YYYY-MM-DD") === s(e).format("YYYY-MM-DD"));
|
|
52
|
+
if (n !== -1) {
|
|
53
|
+
if (c.value.splice(n, 1), typeof o.value == "string") {
|
|
54
|
+
const r = a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
55
|
+
let t = (i = S(o.value)) == null ? void 0 : i.replace(new RegExp(`${r}, `, "g"), "");
|
|
56
|
+
t = t == null ? void 0 : t.replace(new RegExp(`${r}`, "g"), ""), t = t == null ? void 0 : t.replace(/^, |, $/g, "").replace(/,{2,}/g, ",").trim(), o.value = t || "";
|
|
57
|
+
} else if (o.value) {
|
|
58
|
+
const r = (p = o.value) == null ? void 0 : p.findIndex((t) => s(t).format("YYYY-MM-DD") === s(e).format("YYYY-MM-DD"));
|
|
59
|
+
r !== -1 && o.value.splice(r, 1);
|
|
56
60
|
}
|
|
57
61
|
k.value = e.getDate();
|
|
58
62
|
} else
|
|
59
|
-
|
|
60
|
-
}, z = (e) => k.value === e.getDate() ? { backgroundColor: "transparent", color: "var(--color-text-1)" } :
|
|
61
|
-
|
|
63
|
+
c.value.length < l.maxLength && (c.value.push(e), typeof o.value == "string" ? o.value += o.value ? `, ${a}` : a : (d = o.value) == null || d.push(a)), k.value = void 0;
|
|
64
|
+
}, z = (e) => k.value === e.getDate() ? { backgroundColor: "transparent", color: "var(--color-text-1)" } : c.value.some((n) => s(n).format("YYYY-MM-DD") === s(e).format("YYYY-MM-DD")) ? { backgroundColor: "rgb(var(--primary-6))", color: "var(--color-white)" } : {}, E = (e) => {
|
|
65
|
+
c.value = [], o.value = typeof o.value == "string" ? "" : [], g("clear", e);
|
|
62
66
|
};
|
|
63
67
|
return (e, a) => {
|
|
64
|
-
const
|
|
65
|
-
return
|
|
66
|
-
class:
|
|
68
|
+
const n = f("icon-calendar"), i = f("a-input"), p = f("a-date-picker"), d = f("a-popover");
|
|
69
|
+
return U(), T("div", {
|
|
70
|
+
class: W(te),
|
|
67
71
|
ref_key: "datePickerRef",
|
|
68
72
|
ref: D
|
|
69
73
|
}, [
|
|
@@ -75,37 +79,37 @@ const Z = ["onClick"], ee = "keyblade-pro-dates-picker", ne = /* @__PURE__ */ N(
|
|
|
75
79
|
content: u(() => [
|
|
76
80
|
v(p, _(L.value, {
|
|
77
81
|
pickerValue: x.value,
|
|
78
|
-
"onUpdate:pickerValue": a[0] || (a[0] = (
|
|
82
|
+
"onUpdate:pickerValue": a[0] || (a[0] = (r) => x.value = r),
|
|
79
83
|
style: { width: "268px" }
|
|
80
|
-
}),
|
|
81
|
-
cell: u(({ date:
|
|
84
|
+
}), F({
|
|
85
|
+
cell: u(({ date: r }) => [
|
|
82
86
|
M("div", {
|
|
83
87
|
class: "arco-picker-date",
|
|
84
|
-
onClick: (t) => R(
|
|
88
|
+
onClick: (t) => R(r)
|
|
85
89
|
}, [
|
|
86
90
|
M("div", {
|
|
87
|
-
style:
|
|
91
|
+
style: G(z(r)),
|
|
88
92
|
class: "arco-picker-date-value"
|
|
89
|
-
},
|
|
90
|
-
], 8,
|
|
93
|
+
}, H(r.getDate()), 5)
|
|
94
|
+
], 8, ee)
|
|
91
95
|
]),
|
|
92
96
|
_: 2
|
|
93
97
|
}, [
|
|
94
|
-
|
|
98
|
+
J(P(b), (r, t) => ({
|
|
95
99
|
name: t,
|
|
96
100
|
fn: u((I) => [
|
|
97
|
-
|
|
101
|
+
K(e.$slots, t, Q(X(I ?? {})))
|
|
98
102
|
])
|
|
99
103
|
}))
|
|
100
104
|
]), 1040, ["pickerValue"])
|
|
101
105
|
]),
|
|
102
106
|
default: u(() => [
|
|
103
|
-
v(
|
|
104
|
-
"model-value": P(S)(
|
|
105
|
-
onClear:
|
|
107
|
+
v(i, _(_(B.value, P(w)), {
|
|
108
|
+
"model-value": P(S)(o.value),
|
|
109
|
+
onClear: q(E, ["stop"])
|
|
106
110
|
}), {
|
|
107
111
|
suffix: u(() => [
|
|
108
|
-
v(
|
|
112
|
+
v(n)
|
|
109
113
|
]),
|
|
110
114
|
_: 1
|
|
111
115
|
}, 16, ["model-value"])
|
|
@@ -117,5 +121,5 @@ const Z = ["onClick"], ee = "keyblade-pro-dates-picker", ne = /* @__PURE__ */ N(
|
|
|
117
121
|
}
|
|
118
122
|
});
|
|
119
123
|
export {
|
|
120
|
-
|
|
124
|
+
se as default
|
|
121
125
|
};
|
package/package.json
CHANGED