@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.
Files changed (185) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index10.js +24 -24
  3. package/dist/index136.js +104 -103
  4. package/dist/index138.js +1 -1
  5. package/dist/index140.js +4 -4
  6. package/dist/index167.js +14 -14
  7. package/dist/index168.js +3 -3
  8. package/dist/index171.js +4 -4
  9. package/dist/index178.js +10 -10
  10. package/dist/index180.js +10 -10
  11. package/dist/index184.js +17 -17
  12. package/dist/index185.js +5826 -1078
  13. package/dist/index186.js +209 -0
  14. package/dist/index187.js +19 -5922
  15. package/dist/index188.js +10 -199
  16. package/dist/index189.js +1180 -25
  17. package/dist/index192.js +2 -2
  18. package/dist/index194.js +14 -14
  19. package/dist/index195.js +1 -1
  20. package/dist/index196.js +1 -1
  21. package/dist/index197.js +3 -3
  22. package/dist/index198.js +6 -6
  23. package/dist/index199.js +84 -29
  24. package/dist/index200.js +400 -109
  25. package/dist/index201.js +22 -36
  26. package/dist/index202.js +33 -26
  27. package/dist/index203.js +111 -31
  28. package/dist/index204.js +36 -9
  29. package/dist/index205.js +26 -19
  30. package/dist/index206.js +36 -10
  31. package/dist/index207.js +9 -10
  32. package/dist/index208.js +18 -50
  33. package/dist/index209.js +10 -43
  34. package/dist/index210.js +10 -4
  35. package/dist/index211.js +48 -36
  36. package/dist/index212.js +43 -21
  37. package/dist/index213.js +3 -87
  38. package/dist/index214.js +35 -403
  39. package/dist/index215.js +21 -22
  40. package/dist/index216.js +152 -3623
  41. package/dist/index217.js +226 -53
  42. package/dist/index218.js +37 -77
  43. package/dist/index219.js +10 -52
  44. package/dist/index220.js +119 -207
  45. package/dist/index221.js +38 -10
  46. package/dist/index222.js +79 -56
  47. package/dist/index223.js +20 -61
  48. package/dist/index224.js +20 -54
  49. package/dist/index225.js +20 -75
  50. package/dist/index226.js +19 -722
  51. package/dist/index227.js +20 -39
  52. package/dist/index228.js +22 -64
  53. package/dist/index229.js +22 -11
  54. package/dist/index230.js +20 -705
  55. package/dist/index231.js +792 -776
  56. package/dist/index232.js +701 -21
  57. package/dist/index233.js +176 -22
  58. package/dist/index234.js +15 -13
  59. package/dist/index235.js +20 -836
  60. package/dist/index236.js +19 -701
  61. package/dist/index237.js +3 -176
  62. package/dist/index238.js +186 -19
  63. package/dist/index239.js +131 -18
  64. package/dist/index240.js +160 -21
  65. package/dist/index241.js +1223 -20
  66. package/dist/index242.js +9 -9
  67. package/dist/index243.js +15 -13
  68. package/dist/index244.js +20 -3
  69. package/dist/index245.js +21 -186
  70. package/dist/index246.js +28 -132
  71. package/dist/index247.js +19 -160
  72. package/dist/index248.js +20 -1223
  73. package/dist/index249.js +2 -127
  74. package/dist/index250.js +2 -20
  75. package/dist/index251.js +3632 -22
  76. package/dist/index252.js +55 -20
  77. package/dist/index253.js +77 -22
  78. package/dist/index254.js +46 -32
  79. package/dist/index255.js +215 -29
  80. package/dist/index256.js +10 -20
  81. package/dist/index257.js +57 -20
  82. package/dist/index258.js +61 -2
  83. package/dist/index259.js +54 -2
  84. package/dist/index260.js +74 -160
  85. package/dist/index261.js +707 -212
  86. package/dist/index262.js +39 -37
  87. package/dist/index263.js +64 -10
  88. package/dist/index264.js +11 -22
  89. package/dist/index265.js +689 -183
  90. package/dist/index266.js +813 -63
  91. package/dist/index267.js +21 -33
  92. package/dist/index268.js +184 -25
  93. package/dist/index269.js +69 -79
  94. package/dist/index270.js +34 -20
  95. package/dist/index271.js +39 -19
  96. package/dist/index278.js +2 -235
  97. package/dist/index279.js +78 -5
  98. package/dist/index280.js +76 -131
  99. package/dist/index281.js +21 -67
  100. package/dist/index282.js +926 -78
  101. package/dist/index283.js +21 -28
  102. package/dist/index284.js +18 -7
  103. package/dist/index285.js +19 -74
  104. package/dist/index286.js +68 -3
  105. package/dist/index287.js +19 -2
  106. package/dist/index288.js +18 -82
  107. package/dist/index289.js +51 -51
  108. package/dist/index290.js +21 -5
  109. package/dist/index291.js +21 -4
  110. package/dist/index292.js +62 -178
  111. package/dist/index293.js +229 -57
  112. package/dist/index294.js +6 -75
  113. package/dist/index295.js +123 -1507
  114. package/dist/index296.js +61 -379
  115. package/dist/index297.js +81 -2725
  116. package/dist/index298.js +26 -83
  117. package/dist/index299.js +9 -3770
  118. package/dist/index300.js +72 -57
  119. package/dist/index301.js +4 -15
  120. package/dist/index302.js +2 -84
  121. package/dist/index303.js +74 -193
  122. package/dist/index304.js +54 -246
  123. package/dist/index305.js +5 -78
  124. package/dist/index306.js +4 -78
  125. package/dist/index307.js +178 -21
  126. package/dist/index308.js +56 -928
  127. package/dist/index309.js +75 -22
  128. package/dist/index310.js +1518 -20
  129. package/dist/index311.js +386 -20
  130. package/dist/index312.js +2731 -69
  131. package/dist/index313.js +86 -19
  132. package/dist/index314.js +3770 -19
  133. package/dist/index315.js +56 -50
  134. package/dist/index316.js +15 -22
  135. package/dist/index317.js +83 -21
  136. package/dist/index318.js +201 -62
  137. package/dist/index319.js +246 -2
  138. package/dist/index320.js +1 -1
  139. package/dist/index321.js +1 -1
  140. package/dist/index322.js +1 -1
  141. package/dist/index328.js +1 -1
  142. package/dist/index333.js +1 -1
  143. package/dist/index338.js +2 -2
  144. package/dist/index343.js +1 -1
  145. package/dist/index344.js +2 -2
  146. package/dist/index349.js +35 -19
  147. package/dist/index350.js +19 -55
  148. package/dist/index351.js +19 -28
  149. package/dist/index352.js +63 -6
  150. package/dist/index353.js +36 -51
  151. package/dist/index354.js +21 -6
  152. package/dist/index355.js +55 -11
  153. package/dist/index356.js +29 -7
  154. package/dist/index357.js +6 -27
  155. package/dist/index358.js +52 -2
  156. package/dist/index359.js +5 -69
  157. package/dist/index360.js +11 -166
  158. package/dist/index361.js +7 -37
  159. package/dist/index362.js +28 -20
  160. package/dist/index363.js +2 -20
  161. package/dist/index364.js +67 -61
  162. package/dist/index365.js +166 -36
  163. package/dist/index366.js +17 -13
  164. package/dist/index367.js +31 -7
  165. package/dist/index368.js +10 -30
  166. package/dist/index369.js +3 -10
  167. package/dist/index370.js +3 -3
  168. package/dist/index371.js +13 -4
  169. package/dist/index372.js +7 -12
  170. package/dist/index373.js +11 -4
  171. package/dist/index374.js +5 -33
  172. package/dist/index375.js +33 -31
  173. package/dist/index376.js +29 -26
  174. package/dist/index377.js +26 -59
  175. package/dist/index378.js +59 -96
  176. package/dist/index381.js +97 -16
  177. package/dist/index382.js +1 -1
  178. package/dist/index387.js +1 -1
  179. package/dist/index388.js +2 -2
  180. package/dist/index75.js +185 -182
  181. package/dist/src/components/calendar/calendar.d.ts +65 -37
  182. package/dist/src/components/calendar/calendar.stories.d.ts +13 -6
  183. package/dist/src/index.d.ts +1 -1
  184. package/package.json +1 -1
  185. package/dist/index190.js +0 -20
package/dist/index75.js CHANGED
@@ -1,5 +1,5 @@
1
- import { defineComponent as ee, ref as O, computed as f, watch as te } from "vue";
2
- const B = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], E = [
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
- ], M = [
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
- ], ne = ee({
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
- /** Number of months to display (for multi-view) */
42
- numberOfMonths: {
43
- type: Number,
44
- default: 1
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 dot */
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
- * Display multiple months in a single continuous vertical grid
104
- * instead of side-by-side. Works with numberOfMonths > 1.
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(n, { emit: c }) {
122
- const i = O("days"), o = O(/* @__PURE__ */ new Date()), y = O(null), d = O(Math.floor((/* @__PURE__ */ new Date()).getFullYear() / 12) * 12), x = f(() => n.firstDayOfWeek === 0 ? ["Sun", ...B.slice(0, 6)] : B), H = f(() => E), J = f(() => M), w = f(() => {
123
- const e = [], t = new Date(o.value);
124
- for (let l = 0; l < n.numberOfMonths; l++) {
125
- const u = new Date(t.getFullYear(), t.getMonth() + l, 1);
126
- e.push(W(u));
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
- }), _ = f(() => {
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
- for (let t = 0; t < 12; t++)
137
- e.push(d.value + t);
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
- }), a = f(() => n.modelValue ? Array.isArray(n.modelValue) ? n.modelValue.filter((e) => e instanceof Date) : [n.modelValue] : []), S = f(() => {
140
- const e = /* @__PURE__ */ new Set(), t = new Date(o.value), l = n.continuous ? n.primaryMonthCount : n.numberOfMonths;
141
- for (let u = 0; u < l; u++) {
142
- const s = new Date(t.getFullYear(), t.getMonth() + u, 1);
143
- e.add(`${s.getFullYear()}-${s.getMonth()}`);
144
- }
145
- return e;
146
- }), L = f(() => {
147
- if (!n.continuous || n.numberOfMonths <= 1)
148
- return { dates: [], primaryMonths: [] };
149
- const e = [], t = new Date(o.value), l = new Date(t.getFullYear(), t.getMonth(), 1), u = new Date(t.getFullYear(), t.getMonth() + n.numberOfMonths, 0);
150
- let s = l.getDay() - n.firstDayOfWeek;
151
- s < 0 && (s += 7);
152
- const v = new Date(l);
153
- v.setDate(v.getDate() - s);
154
- let h = u.getDay() - n.firstDayOfWeek;
155
- h < 0 && (h += 7);
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(I(new Date(r), D)), r.setDate(r.getDate() + 1);
173
+ e.push($(new Date(h), s)), h.setDate(h.getDate() + 1);
164
174
  }
165
- return {
166
- dates: e,
167
- primaryMonths: Array.from(S.value).map((D) => {
168
- const [, T] = D.split("-");
169
- return parseInt(T, 10);
170
- })
171
- };
172
- }), g = (e, t) => e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear(), F = (e) => g(e, /* @__PURE__ */ new Date()), Y = (e) => a.value.some((t) => g(t, e)), k = (e) => {
173
- if (!n.range || a.value.length < 2) {
174
- if (n.range && a.value.length === 1 && y.value) {
175
- const u = a.value[0], s = y.value, [v, h] = u < s ? [u, s] : [s, u];
176
- return e > v && e < h;
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] = a.value[0] < a.value[1] ? [a.value[0], a.value[1]] : [a.value[1], a.value[0]];
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
- }, C = (e) => {
183
- if (!n.range || a.value.length === 0) return !1;
184
- if (a.value.length === 1) return g(e, a.value[0]);
185
- const [t] = a.value[0] < a.value[1] ? [a.value[0], a.value[1]] : [a.value[1], a.value[0]];
186
- return g(e, t);
187
- }, R = (e) => {
188
- if (!n.range || a.value.length < 2) return !1;
189
- const [, t] = a.value[0] < a.value[1] ? [a.value[0], a.value[1]] : [a.value[1], a.value[0]];
190
- return g(e, t);
191
- }, A = (e) => !!(n.disabledDate(e) || n.minDate && e < n.minDate || n.maxDate && e > n.maxDate), $ = (e) => n.indicatorDates.some((t) => g(t, e)), W = (e) => {
192
- const t = e.getMonth(), l = e.getFullYear(), u = [], s = new Date(l, t, 1), v = new Date(l, t + 1, 0);
193
- let h = s.getDay() - n.firstDayOfWeek;
194
- h < 0 && (h += 7);
195
- const N = new Date(l, t, 0).getDate();
196
- for (let r = h - 1; r >= 0; r--) {
197
- const D = N - r, T = new Date(l, t - 1, D);
198
- u.push(b(T, !1));
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 r = 1; r <= v.getDate(); r++) {
201
- const D = new Date(l, t, r);
202
- u.push(b(D, !0));
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 m = 42 - u.length;
205
- for (let r = 1; r <= m; r++) {
206
- const D = new Date(l, t + 1, r);
207
- u.push(b(D, !1));
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
- }, b = (e, t) => ({
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: F(e),
217
- isSelected: Y(e),
218
- isInRange: k(e),
219
- isRangeStart: C(e),
220
- isRangeEnd: R(e),
221
- isDisabled: A(e),
222
- hasIndicator: $(e)
223
- }), I = (e, t) => ({
224
- date: e,
225
- day: e.getDate(),
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(o.value);
242
- e.setMonth(e.getMonth() + 1), o.value = e, c("month-change", e);
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
- d.value += 12;
245
+ w.value -= 12;
247
246
  }, z = () => {
248
- n.headerClickable && (i.value === "days" ? i.value = "months" : i.value === "months" && (i.value = "years"), c("view-change", i.value));
249
- }, G = (e) => {
250
- const t = new Date(o.value);
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(o.value);
254
- t.setFullYear(e), o.value = t, d.value = Math.floor(e / 12) * 12, i.value = "months", c("view-change", i.value);
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 (c("date-click", t), n.range)
259
- if (a.value.length === 0 || a.value.length === 2)
260
- c("update:modelValue", [t]);
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 = a.value[0], [u, s] = l < t ? [l, t] : [t, l];
263
- c("update:modelValue", [u, s]);
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
- c("update:modelValue", t);
267
- }, Z = (e) => {
268
- n.range && a.value.length === 1 && (y.value = e.date);
269
- }, p = () => {
270
- y.value = null;
271
- }, V = (e) => {
272
- o.value = new Date(e.getFullYear(), e.getMonth(), 1);
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 te(() => n.modelValue, (e) => {
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 && V(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: i,
282
- viewDate: o,
283
- hoverDate: y,
284
- yearRangeStart: d,
284
+ currentView: c,
285
+ viewDate: r,
286
+ hoverDate: m,
287
+ yearRangeStart: w,
285
288
  // Computed
286
- daysOfWeek: x,
287
- monthNames: H,
288
- monthNamesShort: J,
289
- displayedMonths: w,
290
- headerTitle: _,
291
- yearsInRange: j,
292
- selectedDates: a,
293
- primaryMonths: S,
294
- continuousCalendarData: L,
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: g,
297
- isToday: F,
298
- isSelected: Y,
299
- isInRange: k,
300
- isRangeStart: C,
301
- isRangeEnd: R,
302
- isDisabled: A,
303
- hasIndicator: $,
304
- generateMonthData: W,
305
- createDateObject: b,
306
- createDateObjectForContinuous: I,
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: P,
310
- nextYearRange: q,
311
- onHeaderClick: z,
312
- selectMonth: G,
313
- selectYear: U,
314
- onDateClick: X,
315
- onDateHover: Z,
316
- onDateLeave: p,
317
- goToDate: V
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
- ne as default
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
- /** Number of months to display (for multi-view) */
38
- numberOfMonths: {
39
- type: NumberConstructor;
40
- default: number;
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 dot */
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
- * Display multiple months in a single continuous vertical grid
99
- * instead of side-by-side. Works with numberOfMonths > 1.
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
- primaryMonths: import('vue').ComputedRef<Set<string>>;
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
- /** Number of months to display (for multi-view) */
162
- numberOfMonths: {
163
- type: NumberConstructor;
164
- default: number;
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 dot */
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
- * Display multiple months in a single continuous vertical grid
223
- * instead of side-by-side. Works with numberOfMonths > 1.
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
- numberOfMonths: number;
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;