@keyblade/pro-components 1.13.8-alpha.27 → 1.13.8-alpha.29
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.js +10 -11
- package/es/pro-calendar/hooks/useCellClassName.js +2 -3
- package/es/pro-calendar/month.js +45 -35
- package/es/pro-calendar/month.vue.js +8 -9
- package/es/pro-calendar/year.vue.js +62 -51
- package/es/pro-date-range-picker/pro-date-range-picker.vue2.js +83 -74
- package/es/pro-dates-picker/index.vue.js +74 -63
- package/es/pro-image-upload/cropper.vue2.js +102 -91
- package/es/pro-image-upload/image-upload.vue.d.ts +1 -1
- package/es/pro-image-upload/image-upload.vue.js +172 -145
- package/es/pro-image-upload/index.d.ts +3 -3
- package/es/pro-keep-alive-router-view/pro-keep-alive-router-view.vue.js +8 -9
- package/es/pro-layout/hooks.d.ts +72 -0
- package/es/pro-layout/hooks.js +117 -80
- package/es/pro-loader/index.vue.js +37 -40
- package/es/pro-loader/interface.d.ts +2 -0
- package/es/pro-menu/interface.d.ts +7 -0
- package/es/pro-reuse-tabs/pro-reuse-tabs.vue.js +18 -18
- package/es/pro-table/index.d.ts +3 -3
- package/es/pro-table/index.vue.d.ts +1 -1
- package/es/pro-table/index.vue.js +21 -21
- package/es/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { defineComponent as R, useSlots as U, ref as k, computed as r, watch as X, createElementBlock as
|
|
2
|
-
import "dayjs";
|
|
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";
|
|
3
2
|
import ae from "./month.vue.js";
|
|
4
3
|
import te from "./year.vue.js";
|
|
5
4
|
import oe from "./header.vue.js";
|
|
@@ -10,7 +9,7 @@ import { getAllDaysByTime as de } from "./month.js";
|
|
|
10
9
|
import { EMode as l } from "./enum.js";
|
|
11
10
|
import { conclude as se } from "vue-global-config";
|
|
12
11
|
import { globalProps as C } from "../global-props.js";
|
|
13
|
-
const
|
|
12
|
+
const we = /* @__PURE__ */ R({
|
|
14
13
|
__name: "calendar",
|
|
15
14
|
props: {
|
|
16
15
|
modelValue: {},
|
|
@@ -81,11 +80,11 @@ const Ce = /* @__PURE__ */ R({
|
|
|
81
80
|
});
|
|
82
81
|
return j({
|
|
83
82
|
changePageShowDate: $
|
|
84
|
-
}), (e, o) => (m(),
|
|
83
|
+
}), (e, o) => (m(), v("div", i({
|
|
85
84
|
class: J.value,
|
|
86
85
|
style: K.value
|
|
87
86
|
}, L.value), [
|
|
88
|
-
Z(oe,
|
|
87
|
+
Z(oe, i(y.value, {
|
|
89
88
|
header: Q.value,
|
|
90
89
|
move: Y,
|
|
91
90
|
"header-value-format": H.value,
|
|
@@ -109,11 +108,11 @@ const Ce = /* @__PURE__ */ R({
|
|
|
109
108
|
key: "0"
|
|
110
109
|
} : void 0
|
|
111
110
|
]), 1040, ["header", "header-value-format", "modes", "mode", "page-show-date"]),
|
|
112
|
-
n.value === u(l).month ? (m(),
|
|
111
|
+
n.value === u(l).month ? (m(), v("div", {
|
|
113
112
|
key: 0,
|
|
114
113
|
class: w(`${u(d)}-body`)
|
|
115
114
|
}, [
|
|
116
|
-
(m(), A(ae,
|
|
115
|
+
(m(), A(ae, i(y.value, {
|
|
117
116
|
key: a.value.month(),
|
|
118
117
|
"page-data": B.value,
|
|
119
118
|
value: p.value,
|
|
@@ -135,11 +134,11 @@ const Ce = /* @__PURE__ */ R({
|
|
|
135
134
|
} : void 0
|
|
136
135
|
]), 1040, ["page-data", "value", "mode", "page-show-date"]))
|
|
137
136
|
], 2)) : S("", !0),
|
|
138
|
-
n.value === u(l).year ? (m(),
|
|
137
|
+
n.value === u(l).year ? (m(), v("div", {
|
|
139
138
|
key: 1,
|
|
140
139
|
class: w(`${u(d)}-body`)
|
|
141
140
|
}, [
|
|
142
|
-
(m(), A(te,
|
|
141
|
+
(m(), A(te, i(y.value, {
|
|
143
142
|
key: a.value.year(),
|
|
144
143
|
"page-data": B.value,
|
|
145
144
|
"page-show-date": a.value,
|
|
@@ -148,7 +147,7 @@ const Ce = /* @__PURE__ */ R({
|
|
|
148
147
|
"select-handler": _
|
|
149
148
|
}), null, 16, ["page-data", "page-show-date", "mode", "value"]))
|
|
150
149
|
], 2)) : S("", !0),
|
|
151
|
-
e.panel && e.panelTodayBtn ? (m(),
|
|
150
|
+
e.panel && e.panelTodayBtn ? (m(), v("div", {
|
|
152
151
|
key: 2,
|
|
153
152
|
class: w(`${u(d)}-footer-btn-wrapper`)
|
|
154
153
|
}, ee(u(g)("today")), 3)) : S("", !0)
|
|
@@ -156,5 +155,5 @@ const Ce = /* @__PURE__ */ R({
|
|
|
156
155
|
}
|
|
157
156
|
});
|
|
158
157
|
export {
|
|
159
|
-
|
|
158
|
+
we as default
|
|
160
159
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "dayjs";
|
|
2
1
|
import { isArray as w } from "@arco-design/web-vue/es/_utils/is";
|
|
3
2
|
import { getNow as u } from "@arco-design/web-vue/es/_utils/date";
|
|
4
3
|
import { EMode as A } from "../enum.js";
|
|
@@ -6,7 +5,7 @@ function o(n, r) {
|
|
|
6
5
|
if (n && w(n))
|
|
7
6
|
return n[r];
|
|
8
7
|
}
|
|
9
|
-
const
|
|
8
|
+
const P = ({
|
|
10
9
|
prefixCls: n,
|
|
11
10
|
mergedValue: r,
|
|
12
11
|
rangeValues: a,
|
|
@@ -37,5 +36,5 @@ const f = ({
|
|
|
37
36
|
];
|
|
38
37
|
};
|
|
39
38
|
export {
|
|
40
|
-
|
|
39
|
+
P as default
|
|
41
40
|
};
|
package/es/pro-calendar/month.js
CHANGED
|
@@ -1,43 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
var w = Object.defineProperty, x = Object.defineProperties;
|
|
2
|
+
var A = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var h = Object.getOwnPropertySymbols;
|
|
4
|
+
var I = Object.prototype.hasOwnProperty, R = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var O = (t, r, a) => r in t ? w(t, r, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[r] = a, l = (t, r) => {
|
|
6
|
+
for (var a in r || (r = {}))
|
|
7
|
+
I.call(r, a) && O(t, a, r[a]);
|
|
8
|
+
if (h)
|
|
9
|
+
for (var a of h(r))
|
|
10
|
+
R.call(r, a) && O(t, a, r[a]);
|
|
11
|
+
return t;
|
|
12
|
+
}, y = (t, r) => x(t, A(r));
|
|
13
|
+
import { methods as i } from "@arco-design/web-vue/es/_utils/date";
|
|
14
|
+
const g = 42, u = (t) => ({
|
|
15
|
+
year: t.year(),
|
|
16
|
+
month: t.month() + 1,
|
|
17
|
+
date: t.date(),
|
|
18
|
+
day: t.day(),
|
|
19
|
+
time: t
|
|
20
|
+
}), T = (t) => ({
|
|
21
|
+
start: u(i.startOf(t, "month")),
|
|
22
|
+
end: u(i.endOf(t, "month")),
|
|
23
|
+
days: t.daysInMonth()
|
|
12
24
|
});
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
25
|
+
function D(t, { dayStartOfWeek: r = 0, isWeek: a }) {
|
|
26
|
+
var c, f, m;
|
|
27
|
+
const s = T(t), d = Array(g).fill(null).map(() => ({})), o = r === 0 ? s.start.day : (s.start.day || 7) - 1;
|
|
28
|
+
d[o] = y(l({}, s.start), {
|
|
17
29
|
isCurrent: !0
|
|
18
|
-
};
|
|
19
|
-
for (let
|
|
20
|
-
|
|
21
|
-
...d(o.subtract(e.start.time, t + 1, "day")),
|
|
30
|
+
});
|
|
31
|
+
for (let e = 0; e < o; e++)
|
|
32
|
+
d[o - e - 1] = y(l({}, u(i.subtract(s.start.time, e + 1, "day"))), {
|
|
22
33
|
isPrev: !0
|
|
23
|
-
};
|
|
24
|
-
for (let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
weekOfYear: u.week()
|
|
34
|
+
});
|
|
35
|
+
for (let e = 0; e < g - o - 1; e++)
|
|
36
|
+
d[o + e + 1] = y(l({}, u(i.add(s.start.time, e + 1, "day"))), {
|
|
37
|
+
isCurrent: e < s.days,
|
|
38
|
+
isNext: e >= s.days - 1
|
|
39
|
+
});
|
|
40
|
+
const n = Array(6).fill(null).map(() => []);
|
|
41
|
+
for (let e = 0; e < 6; e++)
|
|
42
|
+
if (n[e] = d.slice(e * 7, 7 * (e + 1)), a) {
|
|
43
|
+
const k = (f = (c = n == null ? void 0 : n[e]) == null ? void 0 : c[0]) == null ? void 0 : f.time, p = [...n[e] || []];
|
|
44
|
+
(m = n == null ? void 0 : n[e]) == null || m.unshift({
|
|
45
|
+
weekRows: p,
|
|
46
|
+
weekOfYear: k.week()
|
|
37
47
|
});
|
|
38
48
|
}
|
|
39
|
-
return
|
|
49
|
+
return n;
|
|
40
50
|
}
|
|
41
51
|
export {
|
|
42
|
-
|
|
52
|
+
D as getAllDaysByTime
|
|
43
53
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { defineComponent as C, useSlots as D, computed as f, createElementBlock as s, openBlock as n, normalizeClass as o, unref as r, createVNode as O, createElementVNode as i, Fragment as m, renderList as y, createCommentVNode as V, renderSlot as B, createTextVNode as N, toDisplayString as k } from "vue";
|
|
2
|
-
import "dayjs";
|
|
3
2
|
import { dayjs as Y } from "@arco-design/web-vue/es/_utils/date";
|
|
4
3
|
import { padStart as H } from "@arco-design/web-vue/es/_utils/pad";
|
|
5
4
|
import T from "./week.vue.js";
|
|
6
5
|
import b from "./hooks/useCellClassName.js";
|
|
7
6
|
import { getPrefixCls as E } from "@arco-design/web-vue/es/_utils/global-config";
|
|
8
7
|
import { getAllDaysByTime as F } from "./month.js";
|
|
9
|
-
const M = ["onClick"], R = ["onClick"],
|
|
8
|
+
const M = ["onClick"], R = ["onClick"], I = /* @__PURE__ */ C({
|
|
10
9
|
__name: "month",
|
|
11
10
|
props: {
|
|
12
11
|
cell: { type: Boolean },
|
|
@@ -33,10 +32,10 @@ const M = ["onClick"], R = ["onClick"], J = /* @__PURE__ */ C({
|
|
|
33
32
|
})
|
|
34
33
|
);
|
|
35
34
|
function c(e) {
|
|
36
|
-
const d = l.value.year(),
|
|
35
|
+
const d = l.value.year(), u = l.value.month() + 1, p = l.value.week();
|
|
37
36
|
return l.value && e.weekRows.find(
|
|
38
|
-
(a) => a.year === d && a.month ===
|
|
39
|
-
) &&
|
|
37
|
+
(a) => a.year === d && a.month === u
|
|
38
|
+
) && p === e.weekOfYear;
|
|
40
39
|
}
|
|
41
40
|
const $ = f(() => typeof l.current == "number" ? F(
|
|
42
41
|
Y(`${h}-${H(l.current + 1, 2, "0")}-01`),
|
|
@@ -61,8 +60,8 @@ const M = ["onClick"], R = ["onClick"], J = /* @__PURE__ */ C({
|
|
|
61
60
|
i("div", {
|
|
62
61
|
class: o(`${r(t)}-month-cell-body`)
|
|
63
62
|
}, [
|
|
64
|
-
(n(!0), s(m, null, y($.value, (
|
|
65
|
-
key:
|
|
63
|
+
(n(!0), s(m, null, y($.value, (u, p) => (n(), s("div", {
|
|
64
|
+
key: p,
|
|
66
65
|
class: o([
|
|
67
66
|
`${r(t)}-month-row`,
|
|
68
67
|
{
|
|
@@ -70,7 +69,7 @@ const M = ["onClick"], R = ["onClick"], J = /* @__PURE__ */ C({
|
|
|
70
69
|
}
|
|
71
70
|
])
|
|
72
71
|
}, [
|
|
73
|
-
(n(!0), s(m, null, y(
|
|
72
|
+
(n(!0), s(m, null, y(u, (a, S) => (n(), s("div", {
|
|
74
73
|
key: S,
|
|
75
74
|
class: o(g.value(a, !1)),
|
|
76
75
|
onClick: (W) => a.time && !e.isWeek ? e.selectHandler(a.time, !1) : void 0
|
|
@@ -123,5 +122,5 @@ const M = ["onClick"], R = ["onClick"], J = /* @__PURE__ */ C({
|
|
|
123
122
|
}
|
|
124
123
|
});
|
|
125
124
|
export {
|
|
126
|
-
|
|
125
|
+
I as default
|
|
127
126
|
};
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
var V = Object.defineProperty, B = Object.defineProperties;
|
|
2
|
+
var H = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var f = Object.getOwnPropertySymbols;
|
|
4
|
+
var M = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var v = (s, a, t) => a in s ? V(s, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[a] = t, h = (s, a) => {
|
|
6
|
+
for (var t in a || (a = {}))
|
|
7
|
+
M.call(a, t) && v(s, t, a[t]);
|
|
8
|
+
if (f)
|
|
9
|
+
for (var t of f(a))
|
|
10
|
+
O.call(a, t) && v(s, t, a[t]);
|
|
11
|
+
return s;
|
|
12
|
+
}, y = (s, a) => B(s, H(a));
|
|
13
|
+
import { defineComponent as W, computed as d, createElementBlock as u, openBlock as m, normalizeClass as i, unref as l, Fragment as g, renderList as k, createElementVNode as w, toDisplayString as S, createVNode as F } from "vue";
|
|
14
|
+
import { padStart as J } from "@arco-design/web-vue/es/_utils/pad";
|
|
15
|
+
import { dayjs as T } from "@arco-design/web-vue/es/_utils/date";
|
|
16
|
+
import A from "./month.vue.js";
|
|
17
|
+
import E from "./hooks/useCellClassName.js";
|
|
18
|
+
import { getPrefixCls as j } from "@arco-design/web-vue/es/_utils/global-config";
|
|
19
|
+
import { useI18n as z } from "@arco-design/web-vue/es/locale";
|
|
20
|
+
const G = ["onClick"], Q = /* @__PURE__ */ W({
|
|
10
21
|
__name: "year",
|
|
11
22
|
props: {
|
|
12
23
|
mode: {},
|
|
@@ -18,8 +29,8 @@ const O = ["onClick"], G = /* @__PURE__ */ C({
|
|
|
18
29
|
isWeek: { type: Boolean },
|
|
19
30
|
panel: { type: Boolean }
|
|
20
31
|
},
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
32
|
+
setup(s) {
|
|
33
|
+
const a = [
|
|
23
34
|
"January",
|
|
24
35
|
"February",
|
|
25
36
|
"March",
|
|
@@ -32,72 +43,72 @@ const O = ["onClick"], G = /* @__PURE__ */ C({
|
|
|
32
43
|
"October",
|
|
33
44
|
"November",
|
|
34
45
|
"December"
|
|
35
|
-
].map((e,
|
|
46
|
+
].map((e, r) => ({
|
|
36
47
|
name: e,
|
|
37
|
-
value:
|
|
38
|
-
})),
|
|
39
|
-
() =>
|
|
40
|
-
prefixCls:
|
|
41
|
-
mergedValue:
|
|
48
|
+
value: r
|
|
49
|
+
})), t = s, n = j("calendar"), { t: p } = z(), $ = d(
|
|
50
|
+
() => E({
|
|
51
|
+
prefixCls: n,
|
|
52
|
+
mergedValue: t.value,
|
|
42
53
|
panel: !1,
|
|
43
|
-
innerMode:
|
|
54
|
+
innerMode: t.mode,
|
|
44
55
|
rangeValues: [],
|
|
45
56
|
hoverRangeValues: [],
|
|
46
|
-
isSameTime: (e,
|
|
57
|
+
isSameTime: (e, r) => e.isSame(r, "month")
|
|
47
58
|
})
|
|
48
|
-
),
|
|
49
|
-
function
|
|
50
|
-
return
|
|
51
|
-
`${
|
|
59
|
+
), C = d(() => t.pageShowDate.year());
|
|
60
|
+
function c(e) {
|
|
61
|
+
return T(
|
|
62
|
+
`${C.value}-${J(e + 1, 2, "0")}-01`
|
|
52
63
|
);
|
|
53
64
|
}
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
65
|
+
const D = d(() => {
|
|
66
|
+
if (t.panel) {
|
|
56
67
|
const e = [];
|
|
57
|
-
for (let
|
|
58
|
-
e.push(
|
|
68
|
+
for (let r = 0; r < 4; r++)
|
|
69
|
+
e.push(a.slice(r * 3, 3 * (r + 1)));
|
|
59
70
|
return e;
|
|
60
71
|
} else {
|
|
61
72
|
const e = [];
|
|
62
|
-
for (let
|
|
63
|
-
e.push(
|
|
73
|
+
for (let r = 0; r < 3; r++)
|
|
74
|
+
e.push(a.slice(r * 4, 4 * (r + 1)));
|
|
64
75
|
return e;
|
|
65
76
|
}
|
|
66
77
|
});
|
|
67
|
-
return (e,
|
|
68
|
-
class:
|
|
78
|
+
return (e, r) => (m(), u("div", {
|
|
79
|
+
class: i(`${l(n)}-year`)
|
|
69
80
|
}, [
|
|
70
|
-
(
|
|
71
|
-
key:
|
|
72
|
-
class:
|
|
81
|
+
(m(!0), u(g, null, k(D.value, (N, b) => (m(), u("div", {
|
|
82
|
+
key: b,
|
|
83
|
+
class: i(`${l(n)}-year-row`)
|
|
73
84
|
}, [
|
|
74
|
-
(
|
|
75
|
-
key:
|
|
76
|
-
class:
|
|
85
|
+
(m(!0), u(g, null, k(N, (o) => (m(), u("div", {
|
|
86
|
+
key: o.value,
|
|
87
|
+
class: i($.value(y(h({}, o), { time: c(o.value) }), !1))
|
|
77
88
|
}, [
|
|
78
|
-
e.panel ? (
|
|
89
|
+
e.panel ? (m(), u("div", {
|
|
79
90
|
key: 0,
|
|
80
|
-
class:
|
|
81
|
-
onClick: () => e.selectHandler(
|
|
91
|
+
class: i(`${l(n)}-date`),
|
|
92
|
+
onClick: () => e.selectHandler(c(o.value), !1)
|
|
82
93
|
}, [
|
|
83
|
-
|
|
84
|
-
class:
|
|
85
|
-
},
|
|
86
|
-
], 10,
|
|
94
|
+
w("div", {
|
|
95
|
+
class: i(`${l(n)}-date-value`)
|
|
96
|
+
}, S(l(p)(`calendar.month.short.${o.name}`)), 3)
|
|
97
|
+
], 10, G)) : (m(), u("div", {
|
|
87
98
|
key: 1,
|
|
88
|
-
class:
|
|
99
|
+
class: i(`${l(n)}-month-with-days`)
|
|
89
100
|
}, [
|
|
90
|
-
|
|
91
|
-
class:
|
|
92
|
-
},
|
|
93
|
-
|
|
101
|
+
w("div", {
|
|
102
|
+
class: i(`${l(n)}-month-title`)
|
|
103
|
+
}, S(l(p)(`calendar.month.long.${o.name}`)), 3),
|
|
104
|
+
F(A, {
|
|
94
105
|
"page-show-date": e.pageShowDate,
|
|
95
106
|
"page-data": e.pageData,
|
|
96
107
|
"day-start-of-week": e.dayStartOfWeek,
|
|
97
108
|
"select-handler": e.selectHandler,
|
|
98
109
|
"is-week": e.isWeek,
|
|
99
110
|
cell: !0,
|
|
100
|
-
current:
|
|
111
|
+
current: o.value,
|
|
101
112
|
value: e.value,
|
|
102
113
|
mode: e.mode
|
|
103
114
|
}, null, 8, ["page-show-date", "page-data", "day-start-of-week", "select-handler", "is-week", "current", "value", "mode"])
|
|
@@ -108,5 +119,5 @@ const O = ["onClick"], G = /* @__PURE__ */ C({
|
|
|
108
119
|
}
|
|
109
120
|
});
|
|
110
121
|
export {
|
|
111
|
-
|
|
122
|
+
Q as default
|
|
112
123
|
};
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var M = Object.defineProperty, U = Object.defineProperties;
|
|
2
|
+
var $ = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var E = Object.getOwnPropertySymbols;
|
|
4
|
+
var j = Object.prototype.hasOwnProperty, z = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var _ = (s, l, e) => l in s ? M(s, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[l] = e, c = (s, l) => {
|
|
6
|
+
for (var e in l || (l = {}))
|
|
7
|
+
j.call(l, e) && _(s, e, l[e]);
|
|
8
|
+
if (E)
|
|
9
|
+
for (var e of E(l))
|
|
10
|
+
z.call(l, e) && _(s, e, l[e]);
|
|
11
|
+
return s;
|
|
12
|
+
}, p = (s, l) => U(s, $(l));
|
|
13
|
+
import { defineComponent as G, ref as n, computed as v, resolveComponent as T, createElementBlock as J, openBlock as K, normalizeClass as O, createVNode as u, mergeProps as f, withCtx as D, createTextVNode as Q, toDisplayString as W, nextTick as R } from "vue";
|
|
14
|
+
import i from "dayjs";
|
|
15
|
+
import { conclude as B } from "vue-global-config";
|
|
16
|
+
import { globalProps as w } from "../global-props.js";
|
|
17
|
+
import { range as h } from "./pro-date-range-picker.js";
|
|
18
|
+
const X = "keyblade-pro-date-range-picker", de = /* @__PURE__ */ G({
|
|
7
19
|
__name: "pro-date-range-picker",
|
|
8
20
|
props: {
|
|
9
21
|
modelValue: {},
|
|
@@ -21,128 +33,125 @@ const $ = "keyblade-pro-date-range-picker", O = /* @__PURE__ */ x({
|
|
|
21
33
|
disabledEndDate: {}
|
|
22
34
|
},
|
|
23
35
|
emits: ["update:modelValue"],
|
|
24
|
-
setup(
|
|
25
|
-
const e =
|
|
36
|
+
setup(s, { emit: l }) {
|
|
37
|
+
const e = s, y = l, P = n(), b = n(), g = n(), F = n(), m = n(), k = v({
|
|
26
38
|
get: () => e.modelValue[e.startField],
|
|
27
39
|
set: (t) => {
|
|
28
|
-
t ?
|
|
29
|
-
...e.modelValue,
|
|
40
|
+
t ? P.value = "success" : P.value = void 0, y("update:modelValue", p(c({}, e.modelValue), {
|
|
30
41
|
[e.startField]: t
|
|
31
|
-
});
|
|
42
|
+
}));
|
|
32
43
|
}
|
|
33
|
-
}),
|
|
44
|
+
}), S = v({
|
|
34
45
|
get: () => e.modelValue[e.endField],
|
|
35
46
|
set: (t) => {
|
|
36
|
-
t ?
|
|
37
|
-
...e.modelValue,
|
|
47
|
+
t ? b.value = "success" : b.value = void 0, y("update:modelValue", p(c({}, e.modelValue), {
|
|
38
48
|
[e.endField]: t
|
|
39
|
-
});
|
|
49
|
+
}));
|
|
40
50
|
}
|
|
41
|
-
}),
|
|
51
|
+
}), I = (t) => {
|
|
42
52
|
const a = () => {
|
|
43
|
-
var
|
|
53
|
+
var r;
|
|
44
54
|
if (!e.modelValue[e.endField]) return !1;
|
|
45
|
-
let
|
|
46
|
-
return e.intraday && !((
|
|
55
|
+
let o = i(e.modelValue[e.endField]);
|
|
56
|
+
return e.intraday && !((r = e.datePickerProps) != null && r.showTime) && (o = o.add(1, "day")), i(t).isAfter(o);
|
|
47
57
|
};
|
|
48
58
|
return e.disabledStartDate ? e.disabledStartDate({ current: t, enabled: a() }) : a();
|
|
49
|
-
},
|
|
59
|
+
}, N = (t) => {
|
|
50
60
|
const a = () => {
|
|
51
|
-
var
|
|
52
|
-
return e.modelValue[e.startField] ? (e.intraday && ((
|
|
61
|
+
var d;
|
|
62
|
+
return e.modelValue[e.startField] ? (e.intraday && ((d = e.datePickerProps) != null && d.showTime) && t.setDate(t.getDate() + 1), i(t).isBefore(i(e.modelValue[e.startField]))) : !1;
|
|
53
63
|
};
|
|
54
64
|
return e.disabledEndDate ? e.disabledEndDate({ current: t, enabled: a() }) : a();
|
|
55
|
-
},
|
|
65
|
+
}, q = (t) => {
|
|
56
66
|
if (!e.modelValue[e.startField] || !t || !e.intraday) {
|
|
57
|
-
|
|
67
|
+
m.value = {};
|
|
58
68
|
return;
|
|
59
69
|
}
|
|
60
|
-
const a =
|
|
61
|
-
if (!a.isSame(
|
|
62
|
-
|
|
70
|
+
const a = i(e.modelValue[e.startField]), o = i(t);
|
|
71
|
+
if (!a.isSame(o, "day")) {
|
|
72
|
+
m.value = {};
|
|
63
73
|
return;
|
|
64
74
|
}
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
disabledHours: () =>
|
|
68
|
-
disabledMinutes: (
|
|
69
|
-
disabledSeconds: (
|
|
75
|
+
const d = a.hour(), r = a.minute(), H = a.second();
|
|
76
|
+
m.value = {
|
|
77
|
+
disabledHours: () => h(0, d),
|
|
78
|
+
disabledMinutes: (V) => V === d ? h(0, r) : [],
|
|
79
|
+
disabledSeconds: (V, L) => V === d && L === r ? h(0, H) : []
|
|
70
80
|
};
|
|
71
|
-
},
|
|
81
|
+
}, x = () => {
|
|
72
82
|
setTimeout(() => {
|
|
73
83
|
const t = e.modelValue[e.endField], a = e.modelValue[e.startField];
|
|
74
|
-
a && t &&
|
|
75
|
-
var
|
|
76
|
-
const
|
|
77
|
-
|
|
84
|
+
a && t && i(a).isAfter(i(t)) && (k.value = t), !t && a && R(() => {
|
|
85
|
+
var d;
|
|
86
|
+
const o = (d = F.value) == null ? void 0 : d.$el.parentElement.querySelector("input");
|
|
87
|
+
o && o.click();
|
|
78
88
|
});
|
|
79
89
|
});
|
|
80
|
-
},
|
|
90
|
+
}, A = () => {
|
|
81
91
|
setTimeout(() => {
|
|
82
|
-
e.modelValue[e.endField] && !e.modelValue[e.startField] &&
|
|
92
|
+
e.modelValue[e.endField] && !e.modelValue[e.startField] && R(() => {
|
|
83
93
|
var a;
|
|
84
|
-
const t = (a =
|
|
94
|
+
const t = (a = g.value) == null ? void 0 : a.$el.parentElement.querySelector("input");
|
|
85
95
|
t && t.click();
|
|
86
96
|
});
|
|
87
97
|
});
|
|
88
|
-
},
|
|
98
|
+
}, C = v(() => {
|
|
89
99
|
var t, a;
|
|
90
|
-
return {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
};
|
|
100
|
+
return p(c({}, B([e.datePickerProps, (t = w.dateRangePicker) == null ? void 0 : t.datePickerProps, {}])), {
|
|
101
|
+
timePickerProps: B([e.timePickerProps, (a = w.dateRangePicker) == null ? void 0 : a.timePickerProps], {})
|
|
102
|
+
});
|
|
94
103
|
});
|
|
95
104
|
return (t, a) => {
|
|
96
|
-
const
|
|
97
|
-
return
|
|
98
|
-
class:
|
|
105
|
+
const o = T("a-date-picker"), d = T("a-form-item");
|
|
106
|
+
return K(), J("div", {
|
|
107
|
+
class: O(X)
|
|
99
108
|
}, [
|
|
100
|
-
|
|
101
|
-
"validate-status":
|
|
109
|
+
u(d, f(t.formItemProps, {
|
|
110
|
+
"validate-status": P.value,
|
|
102
111
|
field: t.startField,
|
|
103
112
|
"hide-label": t.hideLabel
|
|
104
113
|
}), {
|
|
105
|
-
default:
|
|
106
|
-
|
|
114
|
+
default: D(() => [
|
|
115
|
+
u(o, f({
|
|
107
116
|
ref_key: "startDatePickerRef",
|
|
108
|
-
ref:
|
|
109
|
-
modelValue:
|
|
110
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
111
|
-
},
|
|
117
|
+
ref: g,
|
|
118
|
+
modelValue: k.value,
|
|
119
|
+
"onUpdate:modelValue": a[0] || (a[0] = (r) => k.value = r)
|
|
120
|
+
}, C.value, {
|
|
112
121
|
placeholder: t.startPlaceholder,
|
|
113
|
-
"disabled-date": (
|
|
114
|
-
onChange:
|
|
122
|
+
"disabled-date": (r) => I(r),
|
|
123
|
+
onChange: x
|
|
115
124
|
}), null, 16, ["modelValue", "placeholder", "disabled-date"])
|
|
116
125
|
]),
|
|
117
126
|
_: 1
|
|
118
127
|
}, 16, ["validate-status", "field", "hide-label"]),
|
|
119
|
-
|
|
128
|
+
u(d, {
|
|
120
129
|
"hide-label": "",
|
|
121
130
|
style: { "max-height": "32px", top: "0px" }
|
|
122
131
|
}, {
|
|
123
|
-
default:
|
|
124
|
-
|
|
132
|
+
default: D(() => [
|
|
133
|
+
Q(W(t.separator), 1)
|
|
125
134
|
]),
|
|
126
135
|
_: 1
|
|
127
136
|
}),
|
|
128
|
-
|
|
129
|
-
"validate-status":
|
|
137
|
+
u(d, f(t.formItemProps, {
|
|
138
|
+
"validate-status": b.value,
|
|
130
139
|
field: t.endField,
|
|
131
140
|
"hide-label": "",
|
|
132
141
|
style: { "margin-right": "0px" }
|
|
133
142
|
}), {
|
|
134
|
-
default:
|
|
135
|
-
|
|
143
|
+
default: D(() => [
|
|
144
|
+
u(o, f({
|
|
136
145
|
ref_key: "endDatePickerRef",
|
|
137
|
-
ref:
|
|
138
|
-
modelValue:
|
|
139
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
140
|
-
},
|
|
146
|
+
ref: F,
|
|
147
|
+
modelValue: S.value,
|
|
148
|
+
"onUpdate:modelValue": a[1] || (a[1] = (r) => S.value = r)
|
|
149
|
+
}, C.value, {
|
|
141
150
|
placeholder: t.endPlaceholder,
|
|
142
|
-
"disabled-date": (
|
|
143
|
-
"disabled-time": () =>
|
|
144
|
-
onSelect:
|
|
145
|
-
onChange:
|
|
151
|
+
"disabled-date": (r) => N(r),
|
|
152
|
+
"disabled-time": () => m.value,
|
|
153
|
+
onSelect: q,
|
|
154
|
+
onChange: A
|
|
146
155
|
}), null, 16, ["modelValue", "placeholder", "disabled-date", "disabled-time"])
|
|
147
156
|
]),
|
|
148
157
|
_: 1
|
|
@@ -152,5 +161,5 @@ const $ = "keyblade-pro-date-range-picker", O = /* @__PURE__ */ x({
|
|
|
152
161
|
}
|
|
153
162
|
});
|
|
154
163
|
export {
|
|
155
|
-
|
|
164
|
+
de as default
|
|
156
165
|
};
|