@quoreadmin/ui 1.5.0 → 1.5.1
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/dist/index.css +1 -1
- package/dist/index10.js +24 -24
- package/dist/index136.js +104 -103
- package/dist/index138.js +1 -1
- package/dist/index140.js +4 -4
- package/dist/index167.js +14 -14
- package/dist/index168.js +3 -3
- package/dist/index171.js +4 -4
- package/dist/index178.js +10 -10
- package/dist/index180.js +10 -10
- package/dist/index184.js +17 -17
- package/dist/index185.js +5826 -1078
- package/dist/index186.js +209 -0
- package/dist/index187.js +19 -5922
- package/dist/index188.js +10 -199
- package/dist/index189.js +1180 -25
- package/dist/index192.js +2 -2
- package/dist/index194.js +14 -14
- package/dist/index195.js +1 -1
- package/dist/index196.js +1 -1
- package/dist/index197.js +3 -3
- package/dist/index198.js +6 -6
- package/dist/index199.js +84 -29
- package/dist/index200.js +400 -109
- package/dist/index201.js +22 -36
- package/dist/index202.js +33 -26
- package/dist/index203.js +111 -31
- package/dist/index204.js +36 -9
- package/dist/index205.js +26 -19
- package/dist/index206.js +36 -10
- package/dist/index207.js +9 -10
- package/dist/index208.js +18 -50
- package/dist/index209.js +10 -43
- package/dist/index210.js +10 -4
- package/dist/index211.js +48 -36
- package/dist/index212.js +43 -21
- package/dist/index213.js +3 -87
- package/dist/index214.js +35 -403
- package/dist/index215.js +21 -22
- package/dist/index216.js +152 -3623
- package/dist/index217.js +226 -53
- package/dist/index218.js +37 -77
- package/dist/index219.js +10 -52
- package/dist/index220.js +119 -207
- package/dist/index221.js +38 -10
- package/dist/index222.js +79 -56
- package/dist/index223.js +20 -61
- package/dist/index224.js +20 -54
- package/dist/index225.js +20 -75
- package/dist/index226.js +19 -722
- package/dist/index227.js +20 -39
- package/dist/index228.js +22 -64
- package/dist/index229.js +22 -11
- package/dist/index230.js +20 -705
- package/dist/index231.js +792 -776
- package/dist/index232.js +701 -21
- package/dist/index233.js +176 -22
- package/dist/index234.js +15 -13
- package/dist/index235.js +20 -836
- package/dist/index236.js +19 -701
- package/dist/index237.js +3 -176
- package/dist/index238.js +186 -19
- package/dist/index239.js +131 -18
- package/dist/index240.js +160 -21
- package/dist/index241.js +1223 -20
- package/dist/index242.js +9 -9
- package/dist/index243.js +15 -13
- package/dist/index244.js +20 -3
- package/dist/index245.js +21 -186
- package/dist/index246.js +28 -132
- package/dist/index247.js +19 -160
- package/dist/index248.js +20 -1223
- package/dist/index249.js +2 -127
- package/dist/index250.js +2 -20
- package/dist/index251.js +3632 -22
- package/dist/index252.js +55 -20
- package/dist/index253.js +77 -22
- package/dist/index254.js +46 -32
- package/dist/index255.js +215 -29
- package/dist/index256.js +10 -20
- package/dist/index257.js +57 -20
- package/dist/index258.js +61 -2
- package/dist/index259.js +54 -2
- package/dist/index260.js +74 -160
- package/dist/index261.js +707 -212
- package/dist/index262.js +39 -37
- package/dist/index263.js +64 -10
- package/dist/index264.js +11 -22
- package/dist/index265.js +689 -183
- package/dist/index266.js +813 -63
- package/dist/index267.js +21 -33
- package/dist/index268.js +184 -25
- package/dist/index269.js +69 -79
- package/dist/index270.js +34 -20
- package/dist/index271.js +39 -19
- package/dist/index278.js +2 -235
- package/dist/index279.js +78 -5
- package/dist/index280.js +76 -131
- package/dist/index281.js +21 -67
- package/dist/index282.js +926 -78
- package/dist/index283.js +21 -28
- package/dist/index284.js +18 -7
- package/dist/index285.js +19 -74
- package/dist/index286.js +68 -3
- package/dist/index287.js +19 -2
- package/dist/index288.js +18 -82
- package/dist/index289.js +51 -51
- package/dist/index290.js +21 -5
- package/dist/index291.js +21 -4
- package/dist/index292.js +62 -178
- package/dist/index293.js +229 -57
- package/dist/index294.js +6 -75
- package/dist/index295.js +123 -1507
- package/dist/index296.js +61 -379
- package/dist/index297.js +81 -2725
- package/dist/index298.js +26 -83
- package/dist/index299.js +9 -3770
- package/dist/index300.js +72 -57
- package/dist/index301.js +4 -15
- package/dist/index302.js +2 -84
- package/dist/index303.js +74 -193
- package/dist/index304.js +54 -246
- package/dist/index305.js +5 -78
- package/dist/index306.js +4 -78
- package/dist/index307.js +178 -21
- package/dist/index308.js +56 -928
- package/dist/index309.js +75 -22
- package/dist/index310.js +1518 -20
- package/dist/index311.js +386 -20
- package/dist/index312.js +2731 -69
- package/dist/index313.js +86 -19
- package/dist/index314.js +3770 -19
- package/dist/index315.js +56 -50
- package/dist/index316.js +15 -22
- package/dist/index317.js +83 -21
- package/dist/index318.js +201 -62
- package/dist/index319.js +246 -2
- package/dist/index320.js +1 -1
- package/dist/index321.js +1 -1
- package/dist/index322.js +1 -1
- package/dist/index328.js +1 -1
- package/dist/index333.js +1 -1
- package/dist/index338.js +2 -2
- package/dist/index343.js +1 -1
- package/dist/index344.js +2 -2
- package/dist/index349.js +35 -19
- package/dist/index350.js +19 -55
- package/dist/index351.js +19 -28
- package/dist/index352.js +63 -6
- package/dist/index353.js +36 -51
- package/dist/index354.js +21 -6
- package/dist/index355.js +55 -11
- package/dist/index356.js +29 -7
- package/dist/index357.js +6 -27
- package/dist/index358.js +52 -2
- package/dist/index359.js +5 -69
- package/dist/index360.js +11 -166
- package/dist/index361.js +7 -37
- package/dist/index362.js +28 -20
- package/dist/index363.js +2 -20
- package/dist/index364.js +67 -61
- package/dist/index365.js +166 -36
- package/dist/index366.js +17 -13
- package/dist/index367.js +31 -7
- package/dist/index368.js +10 -30
- package/dist/index369.js +3 -10
- package/dist/index370.js +3 -3
- package/dist/index371.js +13 -4
- package/dist/index372.js +7 -12
- package/dist/index373.js +11 -4
- package/dist/index374.js +5 -33
- package/dist/index375.js +33 -31
- package/dist/index376.js +29 -26
- package/dist/index377.js +26 -59
- package/dist/index378.js +59 -96
- package/dist/index381.js +97 -16
- package/dist/index382.js +1 -1
- package/dist/index387.js +1 -1
- package/dist/index388.js +2 -2
- package/dist/index75.js +185 -182
- package/dist/src/components/calendar/calendar.d.ts +65 -37
- package/dist/src/components/calendar/calendar.stories.d.ts +13 -6
- package/dist/src/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/index190.js +0 -20
package/dist/index75.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as ae, ref as O, computed as D, watch as V } from "vue";
|
|
2
|
+
const x = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], A = [
|
|
3
3
|
"January",
|
|
4
4
|
"February",
|
|
5
5
|
"March",
|
|
@@ -12,7 +12,7 @@ const B = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], E = [
|
|
|
12
12
|
"October",
|
|
13
13
|
"November",
|
|
14
14
|
"December"
|
|
15
|
-
],
|
|
15
|
+
], S = [
|
|
16
16
|
"Jan",
|
|
17
17
|
"Feb",
|
|
18
18
|
"Mar",
|
|
@@ -25,7 +25,7 @@ const B = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], E = [
|
|
|
25
25
|
"Oct",
|
|
26
26
|
"Nov",
|
|
27
27
|
"Dec"
|
|
28
|
-
],
|
|
28
|
+
], le = ae({
|
|
29
29
|
name: "QCalendar",
|
|
30
30
|
props: {
|
|
31
31
|
/** Currently selected date(s) - single Date or array for range */
|
|
@@ -38,10 +38,31 @@ const B = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], E = [
|
|
|
38
38
|
type: Boolean,
|
|
39
39
|
default: !1
|
|
40
40
|
},
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Start date of the calendar view.
|
|
43
|
+
* When provided with endDate, enables multi-month display.
|
|
44
|
+
* The calendar will show all weeks from startDate to endDate.
|
|
45
|
+
*/
|
|
46
|
+
startDate: {
|
|
47
|
+
type: Date,
|
|
48
|
+
default: null
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* End date of the calendar view.
|
|
52
|
+
* When provided with startDate, enables multi-month display.
|
|
53
|
+
*/
|
|
54
|
+
endDate: {
|
|
55
|
+
type: Date,
|
|
56
|
+
default: null
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* Which months to consider as "primary" (not greyed out).
|
|
60
|
+
* Array of {month, year} objects where month is 0-11.
|
|
61
|
+
* If not provided, derives from startDate/endDate range.
|
|
62
|
+
*/
|
|
63
|
+
primaryMonths: {
|
|
64
|
+
type: Array,
|
|
65
|
+
default: null
|
|
45
66
|
},
|
|
46
67
|
/** Grey out dates that are not in the primary displayed month(s) */
|
|
47
68
|
greyOutNonCurrentMonth: {
|
|
@@ -73,7 +94,7 @@ const B = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], E = [
|
|
|
73
94
|
type: Function,
|
|
74
95
|
default: () => !1
|
|
75
96
|
},
|
|
76
|
-
/** Dates that should show an indicator
|
|
97
|
+
/** Dates that should show an event indicator (green background) */
|
|
77
98
|
indicatorDates: {
|
|
78
99
|
type: Array,
|
|
79
100
|
default: () => []
|
|
@@ -100,224 +121,206 @@ const B = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], E = [
|
|
|
100
121
|
default: "en"
|
|
101
122
|
},
|
|
102
123
|
/**
|
|
103
|
-
*
|
|
104
|
-
* instead of side-by-side.
|
|
124
|
+
* When true and startDate/endDate are provided, displays all months
|
|
125
|
+
* in a single continuous vertical grid instead of side-by-side.
|
|
105
126
|
*/
|
|
106
127
|
continuous: {
|
|
107
128
|
type: Boolean,
|
|
108
129
|
default: !1
|
|
109
|
-
},
|
|
110
|
-
/**
|
|
111
|
-
* Number of months to consider as "primary" (not greyed out) in continuous mode.
|
|
112
|
-
* Defaults to 1, meaning only the first month is highlighted.
|
|
113
|
-
* Set to same as numberOfMonths to highlight all visible months.
|
|
114
|
-
*/
|
|
115
|
-
primaryMonthCount: {
|
|
116
|
-
type: Number,
|
|
117
|
-
default: 1
|
|
118
130
|
}
|
|
119
131
|
},
|
|
120
132
|
emits: ["update:modelValue", "date-click", "month-change", "view-change"],
|
|
121
|
-
setup(
|
|
122
|
-
const
|
|
123
|
-
const e =
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
133
|
+
setup(a, { emit: o }) {
|
|
134
|
+
const c = O("days"), r = O(/* @__PURE__ */ new Date()), m = O(null), w = O(Math.floor((/* @__PURE__ */ new Date()).getFullYear() / 12) * 12), g = D(() => !!(a.startDate && a.endDate)), H = D(() => a.firstDayOfWeek === 0 ? ["Sun", ...x.slice(0, 6)] : x), J = D(() => A), I = D(() => S), Y = D(() => {
|
|
135
|
+
const e = /* @__PURE__ */ new Set();
|
|
136
|
+
if (a.primaryMonths && a.primaryMonths.length > 0)
|
|
137
|
+
a.primaryMonths.forEach((t) => {
|
|
138
|
+
e.add(`${t.year}-${t.month}`);
|
|
139
|
+
});
|
|
140
|
+
else if (g.value && a.startDate && a.endDate) {
|
|
141
|
+
const t = new Date(a.startDate.getFullYear(), a.startDate.getMonth(), 1), l = new Date(a.endDate.getFullYear(), a.endDate.getMonth(), 1);
|
|
142
|
+
for (; t <= l; )
|
|
143
|
+
e.add(`${t.getFullYear()}-${t.getMonth()}`), t.setMonth(t.getMonth() + 1);
|
|
144
|
+
} else
|
|
145
|
+
e.add(`${r.value.getFullYear()}-${r.value.getMonth()}`);
|
|
128
146
|
return e;
|
|
129
|
-
}),
|
|
130
|
-
if (n.numberOfMonths === 1)
|
|
131
|
-
return `${E[o.value.getMonth()]} ${o.value.getFullYear()}`;
|
|
132
|
-
const e = w.value[0], t = w.value[w.value.length - 1];
|
|
133
|
-
return e.year === t.year ? `${M[e.month]}/${M[t.month]} ${e.year}` : `${M[e.month]} ${e.year} - ${M[t.month]} ${t.year}`;
|
|
134
|
-
}), j = f(() => {
|
|
147
|
+
}), P = D(() => {
|
|
135
148
|
const e = [];
|
|
136
|
-
|
|
137
|
-
|
|
149
|
+
if (g.value && a.startDate && a.endDate && !a.continuous) {
|
|
150
|
+
const t = new Date(a.startDate.getFullYear(), a.startDate.getMonth(), 1), l = new Date(a.endDate.getFullYear(), a.endDate.getMonth(), 1);
|
|
151
|
+
for (; t <= l; )
|
|
152
|
+
e.push(b(new Date(t))), t.setMonth(t.getMonth() + 1);
|
|
153
|
+
} else a.continuous || e.push(b(new Date(r.value)));
|
|
138
154
|
return e;
|
|
139
|
-
}),
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const N = 6 - h, m = new Date(u);
|
|
157
|
-
m.setDate(m.getDate() + N);
|
|
158
|
-
const r = new Date(v);
|
|
159
|
-
for (; r <= m; ) {
|
|
160
|
-
const D = S.value.has(
|
|
161
|
-
`${r.getFullYear()}-${r.getMonth()}`
|
|
155
|
+
}), _ = D(() => {
|
|
156
|
+
if (!a.continuous || !g.value || !a.startDate || !a.endDate)
|
|
157
|
+
return { dates: [] };
|
|
158
|
+
const e = [], t = new Date(a.startDate);
|
|
159
|
+
let l = t.getDay() - a.firstDayOfWeek;
|
|
160
|
+
l < 0 && (l += 7);
|
|
161
|
+
const u = new Date(t);
|
|
162
|
+
u.setDate(u.getDate() - l);
|
|
163
|
+
const i = new Date(a.endDate);
|
|
164
|
+
let f = i.getDay() - a.firstDayOfWeek;
|
|
165
|
+
f < 0 && (f += 7);
|
|
166
|
+
const v = 6 - f, F = new Date(i);
|
|
167
|
+
F.setDate(F.getDate() + v);
|
|
168
|
+
const h = new Date(u);
|
|
169
|
+
for (; h <= F; ) {
|
|
170
|
+
const s = Y.value.has(
|
|
171
|
+
`${h.getFullYear()}-${h.getMonth()}`
|
|
162
172
|
);
|
|
163
|
-
e.push(
|
|
173
|
+
e.push($(new Date(h), s)), h.setDate(h.getDate() + 1);
|
|
164
174
|
}
|
|
165
|
-
return {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
}),
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
return { dates: e };
|
|
176
|
+
}), L = D(() => {
|
|
177
|
+
if (g.value && a.startDate && a.endDate) {
|
|
178
|
+
const e = a.startDate.getMonth(), t = a.startDate.getFullYear(), l = a.endDate.getMonth(), u = a.endDate.getFullYear();
|
|
179
|
+
return t === u ? e === l ? `${A[e]} ${t}` : `${S[e]}/${S[l]} ${t}` : `${S[e]} ${t} - ${S[l]} ${u}`;
|
|
180
|
+
}
|
|
181
|
+
return `${A[r.value.getMonth()]} ${r.value.getFullYear()}`;
|
|
182
|
+
}), Q = D(() => {
|
|
183
|
+
const e = [];
|
|
184
|
+
for (let t = 0; t < 12; t++)
|
|
185
|
+
e.push(w.value + t);
|
|
186
|
+
return e;
|
|
187
|
+
}), n = D(() => a.modelValue ? Array.isArray(a.modelValue) ? a.modelValue.filter((e) => e instanceof Date) : [a.modelValue] : []), d = (e, t) => e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear(), R = (e) => d(e, /* @__PURE__ */ new Date()), T = (e) => n.value.some((t) => d(t, e)), C = (e) => {
|
|
188
|
+
if (!a.range || n.value.length < 2) {
|
|
189
|
+
if (a.range && n.value.length === 1 && m.value) {
|
|
190
|
+
const u = n.value[0], i = m.value, [f, v] = u < i ? [u, i] : [i, u];
|
|
191
|
+
return e > f && e < v;
|
|
177
192
|
}
|
|
178
193
|
return !1;
|
|
179
194
|
}
|
|
180
|
-
const [t, l] =
|
|
195
|
+
const [t, l] = n.value[0] < n.value[1] ? [n.value[0], n.value[1]] : [n.value[1], n.value[0]];
|
|
181
196
|
return e > t && e < l;
|
|
182
|
-
},
|
|
183
|
-
if (!
|
|
184
|
-
if (
|
|
185
|
-
const [t] =
|
|
186
|
-
return
|
|
187
|
-
},
|
|
188
|
-
if (!
|
|
189
|
-
const [, t] =
|
|
190
|
-
return
|
|
191
|
-
},
|
|
192
|
-
const t = e.getMonth(), l = e.getFullYear(), u = [],
|
|
193
|
-
let
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
for (let
|
|
197
|
-
const
|
|
198
|
-
u.push(
|
|
197
|
+
}, E = (e) => {
|
|
198
|
+
if (!a.range || n.value.length === 0) return !1;
|
|
199
|
+
if (n.value.length === 1) return d(e, n.value[0]);
|
|
200
|
+
const [t] = n.value[0] < n.value[1] ? [n.value[0], n.value[1]] : [n.value[1], n.value[0]];
|
|
201
|
+
return d(e, t);
|
|
202
|
+
}, N = (e) => {
|
|
203
|
+
if (!a.range || n.value.length < 2) return !1;
|
|
204
|
+
const [, t] = n.value[0] < n.value[1] ? [n.value[0], n.value[1]] : [n.value[1], n.value[0]];
|
|
205
|
+
return d(e, t);
|
|
206
|
+
}, W = (e) => !!(a.disabledDate(e) || a.minDate && e < a.minDate || a.maxDate && e > a.maxDate), B = (e) => a.indicatorDates.some((t) => d(t, e)), b = (e) => {
|
|
207
|
+
const t = e.getMonth(), l = e.getFullYear(), u = [], i = new Date(l, t, 1), f = new Date(l, t + 1, 0);
|
|
208
|
+
let v = i.getDay() - a.firstDayOfWeek;
|
|
209
|
+
v < 0 && (v += 7);
|
|
210
|
+
const F = new Date(l, t, 0).getDate();
|
|
211
|
+
for (let s = v - 1; s >= 0; s--) {
|
|
212
|
+
const y = F - s, M = new Date(l, t - 1, y), te = Y.value.has(`${M.getFullYear()}-${M.getMonth()}`);
|
|
213
|
+
u.push($(M, te));
|
|
199
214
|
}
|
|
200
|
-
for (let
|
|
201
|
-
const
|
|
202
|
-
u.push(
|
|
215
|
+
for (let s = 1; s <= f.getDate(); s++) {
|
|
216
|
+
const y = new Date(l, t, s), M = Y.value.has(`${l}-${t}`);
|
|
217
|
+
u.push($(y, M));
|
|
203
218
|
}
|
|
204
|
-
const
|
|
205
|
-
for (let
|
|
206
|
-
const
|
|
207
|
-
u.push(
|
|
219
|
+
const h = 42 - u.length;
|
|
220
|
+
for (let s = 1; s <= h; s++) {
|
|
221
|
+
const y = new Date(l, t + 1, s), M = Y.value.has(`${y.getFullYear()}-${y.getMonth()}`);
|
|
222
|
+
u.push($(y, M));
|
|
208
223
|
}
|
|
209
224
|
return { month: t, year: l, dates: u };
|
|
210
|
-
},
|
|
225
|
+
}, $ = (e, t) => ({
|
|
211
226
|
date: e,
|
|
212
227
|
day: e.getDate(),
|
|
213
228
|
month: e.getMonth(),
|
|
214
229
|
year: e.getFullYear(),
|
|
215
230
|
isCurrentMonth: t,
|
|
216
|
-
isToday:
|
|
217
|
-
isSelected:
|
|
218
|
-
isInRange:
|
|
219
|
-
isRangeStart:
|
|
220
|
-
isRangeEnd:
|
|
221
|
-
isDisabled:
|
|
222
|
-
hasIndicator:
|
|
223
|
-
}),
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
month: e.getMonth(),
|
|
227
|
-
year: e.getFullYear(),
|
|
228
|
-
isCurrentMonth: t,
|
|
229
|
-
// In continuous mode, "current month" means primary months
|
|
230
|
-
isToday: F(e),
|
|
231
|
-
isSelected: Y(e),
|
|
232
|
-
isInRange: k(e),
|
|
233
|
-
isRangeStart: C(e),
|
|
234
|
-
isRangeEnd: R(e),
|
|
235
|
-
isDisabled: A(e),
|
|
236
|
-
hasIndicator: $(e)
|
|
237
|
-
}), Q = () => {
|
|
238
|
-
const e = new Date(o.value);
|
|
239
|
-
e.setMonth(e.getMonth() - 1), o.value = e, c("month-change", e);
|
|
231
|
+
isToday: R(e),
|
|
232
|
+
isSelected: T(e),
|
|
233
|
+
isInRange: C(e),
|
|
234
|
+
isRangeStart: E(e),
|
|
235
|
+
isRangeEnd: N(e),
|
|
236
|
+
isDisabled: W(e),
|
|
237
|
+
hasIndicator: B(e)
|
|
238
|
+
}), j = () => {
|
|
239
|
+
const e = new Date(r.value);
|
|
240
|
+
e.setMonth(e.getMonth() - 1), r.value = e, o("month-change", e);
|
|
240
241
|
}, K = () => {
|
|
241
|
-
const e = new Date(
|
|
242
|
-
e.setMonth(e.getMonth() + 1),
|
|
243
|
-
}, P = () => {
|
|
244
|
-
d.value -= 12;
|
|
242
|
+
const e = new Date(r.value);
|
|
243
|
+
e.setMonth(e.getMonth() + 1), r.value = e, o("month-change", e);
|
|
245
244
|
}, q = () => {
|
|
246
|
-
|
|
245
|
+
w.value -= 12;
|
|
247
246
|
}, z = () => {
|
|
248
|
-
|
|
249
|
-
}, G = (
|
|
250
|
-
|
|
251
|
-
t.setMonth(e), o.value = t, i.value = "days", c("view-change", i.value), c("month-change", t);
|
|
247
|
+
w.value += 12;
|
|
248
|
+
}, G = () => {
|
|
249
|
+
a.headerClickable && (c.value === "days" ? c.value = "months" : c.value === "months" && (c.value = "years"), o("view-change", c.value));
|
|
252
250
|
}, U = (e) => {
|
|
253
|
-
const t = new Date(
|
|
254
|
-
t.
|
|
251
|
+
const t = new Date(r.value);
|
|
252
|
+
t.setMonth(e), r.value = t, c.value = "days", o("view-change", c.value), o("month-change", t);
|
|
255
253
|
}, X = (e) => {
|
|
254
|
+
const t = new Date(r.value);
|
|
255
|
+
t.setFullYear(e), r.value = t, w.value = Math.floor(e / 12) * 12, c.value = "months", o("view-change", c.value);
|
|
256
|
+
}, Z = (e) => {
|
|
256
257
|
if (e.isDisabled) return;
|
|
257
258
|
const t = e.date;
|
|
258
|
-
if (
|
|
259
|
-
if (
|
|
260
|
-
|
|
259
|
+
if (o("date-click", t), a.range)
|
|
260
|
+
if (n.value.length === 0 || n.value.length === 2)
|
|
261
|
+
o("update:modelValue", [t]);
|
|
261
262
|
else {
|
|
262
|
-
const l =
|
|
263
|
-
|
|
263
|
+
const l = n.value[0], [u, i] = l < t ? [l, t] : [t, l];
|
|
264
|
+
o("update:modelValue", [u, i]);
|
|
264
265
|
}
|
|
265
266
|
else
|
|
266
|
-
|
|
267
|
-
},
|
|
268
|
-
|
|
269
|
-
},
|
|
270
|
-
|
|
271
|
-
},
|
|
272
|
-
|
|
267
|
+
o("update:modelValue", t);
|
|
268
|
+
}, p = (e) => {
|
|
269
|
+
a.range && n.value.length === 1 && (m.value = e.date);
|
|
270
|
+
}, ee = () => {
|
|
271
|
+
m.value = null;
|
|
272
|
+
}, k = (e) => {
|
|
273
|
+
r.value = new Date(e.getFullYear(), e.getMonth(), 1);
|
|
273
274
|
};
|
|
274
|
-
return
|
|
275
|
-
if (e) {
|
|
275
|
+
return V(() => a.modelValue, (e) => {
|
|
276
|
+
if (e && !g.value) {
|
|
276
277
|
const t = Array.isArray(e) ? e[0] : e;
|
|
277
|
-
t &&
|
|
278
|
+
t && k(t);
|
|
278
279
|
}
|
|
280
|
+
}, { immediate: !0 }), V(() => a.startDate, (e) => {
|
|
281
|
+
e && g.value && k(e);
|
|
279
282
|
}, { immediate: !0 }), {
|
|
280
283
|
// Refs
|
|
281
|
-
currentView:
|
|
282
|
-
viewDate:
|
|
283
|
-
hoverDate:
|
|
284
|
-
yearRangeStart:
|
|
284
|
+
currentView: c,
|
|
285
|
+
viewDate: r,
|
|
286
|
+
hoverDate: m,
|
|
287
|
+
yearRangeStart: w,
|
|
285
288
|
// Computed
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
289
|
+
isMultiMonth: g,
|
|
290
|
+
daysOfWeek: H,
|
|
291
|
+
monthNames: J,
|
|
292
|
+
monthNamesShort: I,
|
|
293
|
+
displayedMonths: P,
|
|
294
|
+
headerTitle: L,
|
|
295
|
+
yearsInRange: Q,
|
|
296
|
+
selectedDates: n,
|
|
297
|
+
primaryMonthsSet: Y,
|
|
298
|
+
continuousCalendarData: _,
|
|
295
299
|
// Methods
|
|
296
|
-
isSameDay:
|
|
297
|
-
isToday:
|
|
298
|
-
isSelected:
|
|
299
|
-
isInRange:
|
|
300
|
-
isRangeStart:
|
|
301
|
-
isRangeEnd:
|
|
302
|
-
isDisabled:
|
|
303
|
-
hasIndicator:
|
|
304
|
-
generateMonthData:
|
|
305
|
-
createDateObject:
|
|
306
|
-
|
|
307
|
-
prevMonth: Q,
|
|
300
|
+
isSameDay: d,
|
|
301
|
+
isToday: R,
|
|
302
|
+
isSelected: T,
|
|
303
|
+
isInRange: C,
|
|
304
|
+
isRangeStart: E,
|
|
305
|
+
isRangeEnd: N,
|
|
306
|
+
isDisabled: W,
|
|
307
|
+
hasIndicator: B,
|
|
308
|
+
generateMonthData: b,
|
|
309
|
+
createDateObject: $,
|
|
310
|
+
prevMonth: j,
|
|
308
311
|
nextMonth: K,
|
|
309
|
-
prevYearRange:
|
|
310
|
-
nextYearRange:
|
|
311
|
-
onHeaderClick:
|
|
312
|
-
selectMonth:
|
|
313
|
-
selectYear:
|
|
314
|
-
onDateClick:
|
|
315
|
-
onDateHover:
|
|
316
|
-
onDateLeave:
|
|
317
|
-
goToDate:
|
|
312
|
+
prevYearRange: q,
|
|
313
|
+
nextYearRange: z,
|
|
314
|
+
onHeaderClick: G,
|
|
315
|
+
selectMonth: U,
|
|
316
|
+
selectYear: X,
|
|
317
|
+
onDateClick: Z,
|
|
318
|
+
onDateHover: p,
|
|
319
|
+
onDateLeave: ee,
|
|
320
|
+
goToDate: k
|
|
318
321
|
};
|
|
319
322
|
}
|
|
320
323
|
});
|
|
321
324
|
export {
|
|
322
|
-
|
|
325
|
+
le as default
|
|
323
326
|
};
|
|
@@ -18,9 +18,12 @@ export interface CalendarMonth {
|
|
|
18
18
|
year: number;
|
|
19
19
|
dates: CalendarDate[];
|
|
20
20
|
}
|
|
21
|
+
export interface PrimaryMonth {
|
|
22
|
+
month: number;
|
|
23
|
+
year: number;
|
|
24
|
+
}
|
|
21
25
|
export interface ContinuousCalendarData {
|
|
22
26
|
dates: CalendarDate[];
|
|
23
|
-
primaryMonths: number[];
|
|
24
27
|
}
|
|
25
28
|
export type CalendarView = 'days' | 'months' | 'years';
|
|
26
29
|
declare const QCalendar: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
@@ -34,10 +37,31 @@ declare const QCalendar: import('vue').DefineComponent<import('vue').ExtractProp
|
|
|
34
37
|
type: BooleanConstructor;
|
|
35
38
|
default: boolean;
|
|
36
39
|
};
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Start date of the calendar view.
|
|
42
|
+
* When provided with endDate, enables multi-month display.
|
|
43
|
+
* The calendar will show all weeks from startDate to endDate.
|
|
44
|
+
*/
|
|
45
|
+
startDate: {
|
|
46
|
+
type: PropType<Date | null>;
|
|
47
|
+
default: null;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* End date of the calendar view.
|
|
51
|
+
* When provided with startDate, enables multi-month display.
|
|
52
|
+
*/
|
|
53
|
+
endDate: {
|
|
54
|
+
type: PropType<Date | null>;
|
|
55
|
+
default: null;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Which months to consider as "primary" (not greyed out).
|
|
59
|
+
* Array of {month, year} objects where month is 0-11.
|
|
60
|
+
* If not provided, derives from startDate/endDate range.
|
|
61
|
+
*/
|
|
62
|
+
primaryMonths: {
|
|
63
|
+
type: PropType<PrimaryMonth[]>;
|
|
64
|
+
default: null;
|
|
41
65
|
};
|
|
42
66
|
/** Grey out dates that are not in the primary displayed month(s) */
|
|
43
67
|
greyOutNonCurrentMonth: {
|
|
@@ -69,7 +93,7 @@ declare const QCalendar: import('vue').DefineComponent<import('vue').ExtractProp
|
|
|
69
93
|
type: PropType<(date: Date) => boolean>;
|
|
70
94
|
default: () => boolean;
|
|
71
95
|
};
|
|
72
|
-
/** Dates that should show an indicator
|
|
96
|
+
/** Dates that should show an event indicator (green background) */
|
|
73
97
|
indicatorDates: {
|
|
74
98
|
type: PropType<Date[]>;
|
|
75
99
|
default: () => never[];
|
|
@@ -95,27 +119,19 @@ declare const QCalendar: import('vue').DefineComponent<import('vue').ExtractProp
|
|
|
95
119
|
default: string;
|
|
96
120
|
};
|
|
97
121
|
/**
|
|
98
|
-
*
|
|
99
|
-
* instead of side-by-side.
|
|
122
|
+
* When true and startDate/endDate are provided, displays all months
|
|
123
|
+
* in a single continuous vertical grid instead of side-by-side.
|
|
100
124
|
*/
|
|
101
125
|
continuous: {
|
|
102
126
|
type: BooleanConstructor;
|
|
103
127
|
default: boolean;
|
|
104
128
|
};
|
|
105
|
-
/**
|
|
106
|
-
* Number of months to consider as "primary" (not greyed out) in continuous mode.
|
|
107
|
-
* Defaults to 1, meaning only the first month is highlighted.
|
|
108
|
-
* Set to same as numberOfMonths to highlight all visible months.
|
|
109
|
-
*/
|
|
110
|
-
primaryMonthCount: {
|
|
111
|
-
type: NumberConstructor;
|
|
112
|
-
default: number;
|
|
113
|
-
};
|
|
114
129
|
}>, {
|
|
115
130
|
currentView: import('vue').Ref<CalendarView, CalendarView>;
|
|
116
131
|
viewDate: import('vue').Ref<Date, Date>;
|
|
117
132
|
hoverDate: import('vue').Ref<Date | null, Date | null>;
|
|
118
133
|
yearRangeStart: import('vue').Ref<number, number>;
|
|
134
|
+
isMultiMonth: import('vue').ComputedRef<boolean>;
|
|
119
135
|
daysOfWeek: import('vue').ComputedRef<string[]>;
|
|
120
136
|
monthNames: import('vue').ComputedRef<string[]>;
|
|
121
137
|
monthNamesShort: import('vue').ComputedRef<string[]>;
|
|
@@ -123,7 +139,7 @@ declare const QCalendar: import('vue').DefineComponent<import('vue').ExtractProp
|
|
|
123
139
|
headerTitle: import('vue').ComputedRef<string>;
|
|
124
140
|
yearsInRange: import('vue').ComputedRef<number[]>;
|
|
125
141
|
selectedDates: import('vue').ComputedRef<Date[]>;
|
|
126
|
-
|
|
142
|
+
primaryMonthsSet: import('vue').ComputedRef<Set<string>>;
|
|
127
143
|
continuousCalendarData: import('vue').ComputedRef<ContinuousCalendarData>;
|
|
128
144
|
isSameDay: (date1: Date, date2: Date) => boolean;
|
|
129
145
|
isToday: (date: Date) => boolean;
|
|
@@ -135,7 +151,6 @@ declare const QCalendar: import('vue').DefineComponent<import('vue').ExtractProp
|
|
|
135
151
|
hasIndicator: (date: Date) => boolean;
|
|
136
152
|
generateMonthData: (monthDate: Date) => CalendarMonth;
|
|
137
153
|
createDateObject: (date: Date, isCurrentMonth: boolean) => CalendarDate;
|
|
138
|
-
createDateObjectForContinuous: (date: Date, isPrimaryMonth: boolean) => CalendarDate;
|
|
139
154
|
prevMonth: () => void;
|
|
140
155
|
nextMonth: () => void;
|
|
141
156
|
prevYearRange: () => void;
|
|
@@ -158,10 +173,31 @@ declare const QCalendar: import('vue').DefineComponent<import('vue').ExtractProp
|
|
|
158
173
|
type: BooleanConstructor;
|
|
159
174
|
default: boolean;
|
|
160
175
|
};
|
|
161
|
-
/**
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
176
|
+
/**
|
|
177
|
+
* Start date of the calendar view.
|
|
178
|
+
* When provided with endDate, enables multi-month display.
|
|
179
|
+
* The calendar will show all weeks from startDate to endDate.
|
|
180
|
+
*/
|
|
181
|
+
startDate: {
|
|
182
|
+
type: PropType<Date | null>;
|
|
183
|
+
default: null;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* End date of the calendar view.
|
|
187
|
+
* When provided with startDate, enables multi-month display.
|
|
188
|
+
*/
|
|
189
|
+
endDate: {
|
|
190
|
+
type: PropType<Date | null>;
|
|
191
|
+
default: null;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Which months to consider as "primary" (not greyed out).
|
|
195
|
+
* Array of {month, year} objects where month is 0-11.
|
|
196
|
+
* If not provided, derives from startDate/endDate range.
|
|
197
|
+
*/
|
|
198
|
+
primaryMonths: {
|
|
199
|
+
type: PropType<PrimaryMonth[]>;
|
|
200
|
+
default: null;
|
|
165
201
|
};
|
|
166
202
|
/** Grey out dates that are not in the primary displayed month(s) */
|
|
167
203
|
greyOutNonCurrentMonth: {
|
|
@@ -193,7 +229,7 @@ declare const QCalendar: import('vue').DefineComponent<import('vue').ExtractProp
|
|
|
193
229
|
type: PropType<(date: Date) => boolean>;
|
|
194
230
|
default: () => boolean;
|
|
195
231
|
};
|
|
196
|
-
/** Dates that should show an indicator
|
|
232
|
+
/** Dates that should show an event indicator (green background) */
|
|
197
233
|
indicatorDates: {
|
|
198
234
|
type: PropType<Date[]>;
|
|
199
235
|
default: () => never[];
|
|
@@ -219,22 +255,13 @@ declare const QCalendar: import('vue').DefineComponent<import('vue').ExtractProp
|
|
|
219
255
|
default: string;
|
|
220
256
|
};
|
|
221
257
|
/**
|
|
222
|
-
*
|
|
223
|
-
* instead of side-by-side.
|
|
258
|
+
* When true and startDate/endDate are provided, displays all months
|
|
259
|
+
* in a single continuous vertical grid instead of side-by-side.
|
|
224
260
|
*/
|
|
225
261
|
continuous: {
|
|
226
262
|
type: BooleanConstructor;
|
|
227
263
|
default: boolean;
|
|
228
264
|
};
|
|
229
|
-
/**
|
|
230
|
-
* Number of months to consider as "primary" (not greyed out) in continuous mode.
|
|
231
|
-
* Defaults to 1, meaning only the first month is highlighted.
|
|
232
|
-
* Set to same as numberOfMonths to highlight all visible months.
|
|
233
|
-
*/
|
|
234
|
-
primaryMonthCount: {
|
|
235
|
-
type: NumberConstructor;
|
|
236
|
-
default: number;
|
|
237
|
-
};
|
|
238
265
|
}>> & Readonly<{
|
|
239
266
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
240
267
|
"onDate-click"?: ((...args: any[]) => any) | undefined;
|
|
@@ -243,7 +270,9 @@ declare const QCalendar: import('vue').DefineComponent<import('vue').ExtractProp
|
|
|
243
270
|
}>, {
|
|
244
271
|
modelValue: Date | Date[] | null;
|
|
245
272
|
range: boolean;
|
|
246
|
-
|
|
273
|
+
startDate: Date | null;
|
|
274
|
+
endDate: Date | null;
|
|
275
|
+
primaryMonths: PrimaryMonth[];
|
|
247
276
|
greyOutNonCurrentMonth: boolean;
|
|
248
277
|
showNavigation: boolean;
|
|
249
278
|
showHeader: boolean;
|
|
@@ -256,7 +285,6 @@ declare const QCalendar: import('vue').DefineComponent<import('vue').ExtractProp
|
|
|
256
285
|
firstDayOfWeek: number;
|
|
257
286
|
locale: string;
|
|
258
287
|
continuous: boolean;
|
|
259
|
-
primaryMonthCount: number;
|
|
260
288
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
261
289
|
export type QCalendarType = typeof QCalendar;
|
|
262
290
|
export default QCalendar;
|