vue-cal 5.0.1-rc.32 → 5.0.1-rc.34
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/i18n/ar.js +2 -2
- package/dist/i18n/bg.js +2 -2
- package/dist/i18n/bn.js +2 -2
- package/dist/i18n/bs.js +2 -2
- package/dist/i18n/ca.js +2 -2
- package/dist/i18n/cs.js +2 -2
- package/dist/i18n/da.js +2 -2
- package/dist/i18n/de.js +2 -2
- package/dist/i18n/el.js +2 -2
- package/dist/i18n/en-gb.js +2 -2
- package/dist/i18n/es.js +2 -2
- package/dist/i18n/et.js +2 -2
- package/dist/i18n/fa.js +2 -2
- package/dist/i18n/fi.js +2 -2
- package/dist/i18n/fr.js +2 -2
- package/dist/i18n/he.js +2 -2
- package/dist/i18n/hr.js +2 -2
- package/dist/i18n/hu.js +2 -2
- package/dist/i18n/id.js +2 -2
- package/dist/i18n/is.js +2 -2
- package/dist/i18n/it.js +2 -2
- package/dist/i18n/ja.js +2 -2
- package/dist/i18n/ka.js +2 -2
- package/dist/i18n/kaa.js +2 -2
- package/dist/i18n/kk.js +2 -2
- package/dist/i18n/ko.js +2 -2
- package/dist/i18n/ky.js +2 -2
- package/dist/i18n/lt.js +2 -2
- package/dist/i18n/mn.js +2 -2
- package/dist/i18n/nl.js +2 -2
- package/dist/i18n/no.js +2 -2
- package/dist/i18n/pl.js +2 -2
- package/dist/i18n/pt-br.js +2 -2
- package/dist/i18n/pt-pt.js +2 -2
- package/dist/i18n/ro.js +2 -2
- package/dist/i18n/ru.js +30 -28
- package/dist/i18n/sk.js +2 -2
- package/dist/i18n/sl.js +2 -2
- package/dist/i18n/sq.js +2 -2
- package/dist/i18n/sr.js +2 -2
- package/dist/i18n/sv.js +2 -2
- package/dist/i18n/tr.js +2 -2
- package/dist/i18n/uk.js +2 -2
- package/dist/i18n/uz-cryl.js +2 -2
- package/dist/i18n/uz.js +2 -2
- package/dist/i18n/vi.js +2 -2
- package/dist/i18n/zh-cn.js +2 -2
- package/dist/i18n/zh-hk.js +2 -2
- package/dist/vue-cal.d.ts +290 -0
- package/dist/vue-cal.es.js +2 -2
- package/dist/vue-cal.umd.js +3 -3
- package/package.json +14 -13
package/dist/i18n/zh-hk.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* vue-cal v5.0.1-rc.
|
|
3
|
-
* (c) 2024-
|
|
2
|
+
* vue-cal v5.0.1-rc.34
|
|
3
|
+
* (c) 2024-2026 Antoni Andre <antoniandre.web@gmail.com>
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
const t = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"], e = ["一", "二", "三", "四", "五", "六", "日"], o = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], c = "年", d = "本年", y = "月", r = "周", l = "多日", h = "日", k = "今日", n = "暫無活動", D = "整天", m = "刪除", s = "新建活動", a = "YYYY MMMM D dddd", v = {
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DefineSetupFnComponent
|
|
3
|
+
} from 'vue';
|
|
4
|
+
|
|
5
|
+
type VueCalDateString = `${number}${number}${number}${number}-${number}${number}-${number}${number}`
|
|
6
|
+
type VueCalDateTimeString = `${VueCalDateString} ${number}${number}:${number}${number}`
|
|
7
|
+
|
|
8
|
+
type VueCalWeekdays = 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun'
|
|
9
|
+
type VueCalLanguages =
|
|
10
|
+
'ar'
|
|
11
|
+
| 'bg'
|
|
12
|
+
| 'bn'
|
|
13
|
+
| 'bs'
|
|
14
|
+
| 'ca'
|
|
15
|
+
| 'cs'
|
|
16
|
+
| 'da'
|
|
17
|
+
| 'de'
|
|
18
|
+
| 'el'
|
|
19
|
+
| 'en-gb'
|
|
20
|
+
| 'en-us'
|
|
21
|
+
| 'es'
|
|
22
|
+
| 'et'
|
|
23
|
+
| 'fa'
|
|
24
|
+
| 'fi'
|
|
25
|
+
| 'fr'
|
|
26
|
+
| 'he'
|
|
27
|
+
| 'hr'
|
|
28
|
+
| 'hu'
|
|
29
|
+
| 'id'
|
|
30
|
+
| 'is'
|
|
31
|
+
| 'it'
|
|
32
|
+
| 'ja'
|
|
33
|
+
| 'kaa'
|
|
34
|
+
| 'ka'
|
|
35
|
+
| 'kk'
|
|
36
|
+
| 'ko'
|
|
37
|
+
| 'ky'
|
|
38
|
+
| 'lt'
|
|
39
|
+
| 'mn'
|
|
40
|
+
| 'nl'
|
|
41
|
+
| 'no'
|
|
42
|
+
| 'pl'
|
|
43
|
+
| 'pt-br'
|
|
44
|
+
| 'pt-pt'
|
|
45
|
+
| 'ro'
|
|
46
|
+
| 'ru'
|
|
47
|
+
| 'sk'
|
|
48
|
+
| 'sl'
|
|
49
|
+
| 'sq'
|
|
50
|
+
| 'sr'
|
|
51
|
+
| 'sv'
|
|
52
|
+
| 'tr'
|
|
53
|
+
| 'uk'
|
|
54
|
+
| 'uz'
|
|
55
|
+
| 'uz-cryl'
|
|
56
|
+
| 'vi'
|
|
57
|
+
| 'zh-cn'
|
|
58
|
+
| 'zh-hk'
|
|
59
|
+
|
|
60
|
+
type VueCalViewKeys = 'day' | 'days' | 'week' | 'month' | 'year' | 'years'
|
|
61
|
+
type VueCalViewsLayout = Partial<Record<VueCalViewKeys, {
|
|
62
|
+
cols: number
|
|
63
|
+
rows: number
|
|
64
|
+
}>>
|
|
65
|
+
|
|
66
|
+
export interface VueCalSpecialHoursConfigs {
|
|
67
|
+
from: number
|
|
68
|
+
to: number
|
|
69
|
+
class: string
|
|
70
|
+
label?: string
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
type VueCalSpecialHours = Partial<Record<VueCalWeekdays, VueCalSpecialHoursConfigs | VueCalSpecialHoursConfigs[]>>
|
|
74
|
+
|
|
75
|
+
export type VueCalSchedules = {
|
|
76
|
+
id?: number
|
|
77
|
+
class?: string
|
|
78
|
+
label?: string
|
|
79
|
+
hide?: false
|
|
80
|
+
}
|
|
81
|
+
export type VueCalSchedulesHidden = {
|
|
82
|
+
id: number
|
|
83
|
+
class?: string
|
|
84
|
+
label?: string
|
|
85
|
+
hide?: boolean
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface VueCalEvent {
|
|
89
|
+
_eid?: undefined,
|
|
90
|
+
_?: undefined,
|
|
91
|
+
start: Date | VueCalDateTimeString,
|
|
92
|
+
end: Date | VueCalDateTimeString,
|
|
93
|
+
id?: string,
|
|
94
|
+
title?: string,
|
|
95
|
+
content?: string
|
|
96
|
+
class?: string,
|
|
97
|
+
background?: number,
|
|
98
|
+
schedule?: number,
|
|
99
|
+
allDay?: boolean,
|
|
100
|
+
resizable?: boolean,
|
|
101
|
+
draggable?: boolean,
|
|
102
|
+
deletable?: boolean,
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface VueCalConfig {
|
|
106
|
+
allDayEvents?: boolean,
|
|
107
|
+
clickToNavigate?: boolean, // Setting to false will force it off on date-picker.
|
|
108
|
+
dark?: boolean, // Dark theme.
|
|
109
|
+
datePicker?: boolean, // Shorthand for xs: true, views: [month, year, years], clickToNavigate: true.
|
|
110
|
+
disableDays?: (Date | VueCalDateString)[], // Array of specific dates to disable.
|
|
111
|
+
// // Can be true false or a finer grain permissions object like:
|
|
112
|
+
// // { drag: bool, resize: bool, create: bool, delete: bool }
|
|
113
|
+
editableEvents?: boolean | { drag?: boolean, resize?: boolean, create?: boolean, delete?: boolean },
|
|
114
|
+
// The array of events to display in Vue Cal.
|
|
115
|
+
// Can hold just the view events and be updated or the full array of all events available.
|
|
116
|
+
eventCount?: boolean | VueCalViewKeys[], // Displays an events counter in each cell on month view.
|
|
117
|
+
events?: VueCalEvent[],
|
|
118
|
+
// Minimum drag distance in pixels to create an event (prevents accidental event creation when trying to navigate).
|
|
119
|
+
eventCreateMinDrag?: number, // The minimum drag distance in pixels to create an event.
|
|
120
|
+
eventsOnMonthView?: boolean | 'short', // Displays events in full on month view.
|
|
121
|
+
hideWeekdays?: VueCalWeekdays[], // An array of strings. Possible values: 'mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'.
|
|
122
|
+
hideWeekends?: boolean, // Show or hide both Saturday and Sunday in days, week and month views.
|
|
123
|
+
// en-us is the default and fallback if locale is not supported.
|
|
124
|
+
// The locale can also be provided externally to avoid using Promises.
|
|
125
|
+
locale?: VueCalLanguages, // A language to use for all the texts.
|
|
126
|
+
maxDate?: Date | VueCalDateString | VueCalDateTimeString, // Mostly for date pickers, sets a maximum date for cell interactions.
|
|
127
|
+
minDate?: Date | VueCalDateString | VueCalDateTimeString, // Mostly for date pickers, sets a minimum date for cell interactions.
|
|
128
|
+
// A 2-way binding that highlights the selected date in the calendar but does not navigate to it.
|
|
129
|
+
selectedDate?: (Date | VueCalDateString | VueCalDateTimeString),
|
|
130
|
+
sm?: boolean, // Small size (truncates texts + specific styles).
|
|
131
|
+
specialHours?: VueCalSpecialHours, // Highlight a particular time range on each day of the week, individually.
|
|
132
|
+
schedules?: VueCalSchedules[] | VueCalSchedulesHidden[], // Split a day in different persons/rooms/locations schedules.
|
|
133
|
+
snapToInterval?: number, // Snap the event start and end to a specific interval in minutes.
|
|
134
|
+
startWeekOnSunday?: boolean, // Shows Sunday before Monday in days, week and month views.
|
|
135
|
+
stackEvents?: boolean,
|
|
136
|
+
theme?: boolean | string,
|
|
137
|
+
time?: boolean, // Show or hide the time column.
|
|
138
|
+
timeCellHeight?: number, // In pixels.
|
|
139
|
+
timeFormat?: string, // Overrides the default time format.
|
|
140
|
+
timeFrom?: number, // Start time of the time column, in minutes.
|
|
141
|
+
timeStep?: number, // Step amount for the time in the time column, in minutes.
|
|
142
|
+
timeTo?: number, // End time of the time column, in minutes.
|
|
143
|
+
titleBar?: boolean, // Show or hide the header title bar.
|
|
144
|
+
todayButton?: boolean, // Show or hide the header today button.
|
|
145
|
+
twelveHour?: boolean, // 12 or 24 hour format are respectively written like 1pm and 13:00.
|
|
146
|
+
// Sets the calendar view to one of: 'day', 'days', 'week', 'month', 'year', 'years'. Default 'week' or 'month' if datePicker.
|
|
147
|
+
// Gets updated on view navigation.
|
|
148
|
+
view?: VueCalViewKeys,
|
|
149
|
+
viewDate?: Date | VueCalDateString | VueCalDateTimeString, // The view will automatically set its start and end to present this date.
|
|
150
|
+
// Only available for month and day views, this will shift the start of the view (left or right) by x days (signed integer).
|
|
151
|
+
viewDayOffset?: number,
|
|
152
|
+
// The list of all the view that will be available in this calendar.
|
|
153
|
+
views?: VueCalViewKeys[] | VueCalViewsLayout,
|
|
154
|
+
viewsBar?: boolean, // Show or hide the headers view selection bar.
|
|
155
|
+
watchRealTime?: false, // More expensive, so only trigger on demand.
|
|
156
|
+
weekNumbers?: boolean, // Show the weeks numbers in a column on month view.
|
|
157
|
+
xs?: boolean, // Extra small size for date pickers (truncates texts + specific styles).
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface VueCalView {
|
|
161
|
+
// ID, Title
|
|
162
|
+
id: VueCalViewKeys
|
|
163
|
+
title: string
|
|
164
|
+
// Ranges
|
|
165
|
+
start: Date
|
|
166
|
+
end: Date
|
|
167
|
+
fullRangeStart: Date
|
|
168
|
+
fullRangeEnd: Date
|
|
169
|
+
// Cell dates
|
|
170
|
+
cellDates: {
|
|
171
|
+
start: Date,
|
|
172
|
+
end: Date,
|
|
173
|
+
startFormatted: VueCalDateString
|
|
174
|
+
}[],
|
|
175
|
+
// Events
|
|
176
|
+
events: VueCalEvent[]
|
|
177
|
+
// Methods
|
|
178
|
+
switch: (view: VueCalViewKeys, date?: Date) => void
|
|
179
|
+
broader: () => void
|
|
180
|
+
narrower: () => void
|
|
181
|
+
previous: () => void
|
|
182
|
+
next: () => void
|
|
183
|
+
goToToday: () => void
|
|
184
|
+
updateViewDate: (date: Date) => void
|
|
185
|
+
updateSelectedDate: (date: Date) => void
|
|
186
|
+
createEvent: (event: VueCalEvent) => void
|
|
187
|
+
deleteEvent: (eventId: number, forceStage?: number) => void
|
|
188
|
+
scrollToCurrentTime: () => void
|
|
189
|
+
scrollToTime: (minutes: number) => void
|
|
190
|
+
scrollTop: () => void
|
|
191
|
+
// Others
|
|
192
|
+
viewDate: Date
|
|
193
|
+
selectedDate: Date
|
|
194
|
+
now: Date
|
|
195
|
+
broaderView: VueCalViewKeys
|
|
196
|
+
containsToday: boolean
|
|
197
|
+
cols: number
|
|
198
|
+
rows: number
|
|
199
|
+
isDay: boolean
|
|
200
|
+
isDays: boolean
|
|
201
|
+
isWeek: boolean
|
|
202
|
+
isMonth: boolean
|
|
203
|
+
isYear: boolean
|
|
204
|
+
isYears: boolean
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface VueCalCell {
|
|
208
|
+
broader: VueCalViewKeys
|
|
209
|
+
narrower: VueCalViewKeys
|
|
210
|
+
goBroader: () => void
|
|
211
|
+
goNarrower: () => void
|
|
212
|
+
start: Date
|
|
213
|
+
end: Date
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export interface VueCalCellEvents {
|
|
217
|
+
cell: VueCalCell
|
|
218
|
+
cursor: {
|
|
219
|
+
x: number
|
|
220
|
+
y: number
|
|
221
|
+
date: Date
|
|
222
|
+
}
|
|
223
|
+
e: PointerEvent
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export interface VueCalEventEvents {
|
|
227
|
+
event: VueCalEvent
|
|
228
|
+
e: PointerEvent
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export interface VueCalEmits extends Record<string, ((...args: any[]) => any)> {
|
|
232
|
+
// Core Events
|
|
233
|
+
'ready': (value: { config: VueCalConfig, view: VueCalView }) => any
|
|
234
|
+
'viewChange': (value: VueCalView) => any // possible change to custom view
|
|
235
|
+
'update:view': (value: VueCalViewKeys) => any
|
|
236
|
+
'update:selectedDate': (value: Date) => any
|
|
237
|
+
'update:viewDate': (value: Date) => any
|
|
238
|
+
'update:events': (value: VueCalEvent[]) => any
|
|
239
|
+
// Cell-related Events
|
|
240
|
+
'cell-click': (value: VueCalCellEvents) => any
|
|
241
|
+
'cell-drag-start': (value: VueCalCellEvents) => any
|
|
242
|
+
'cell-drag': (value: VueCalCellEvents) => any
|
|
243
|
+
'cell-drag-end': (value: VueCalCellEvents) => any
|
|
244
|
+
'cell-hold': (value: VueCalCellEvents) => any
|
|
245
|
+
// Event-related Events
|
|
246
|
+
'event-hold': (value: VueCalEventEvents) => any
|
|
247
|
+
'event-create': (value: VueCalEventEvents & VueCalCellEvents) => any
|
|
248
|
+
'event-created': (value: VueCalEventEvents) => any
|
|
249
|
+
'event-delete': (value: VueCalEvent) => any
|
|
250
|
+
'event-drag-start': (value: VueCalEventEvents) => any
|
|
251
|
+
'event-drag': (value: VueCalEventEvents) => any
|
|
252
|
+
'event-drag-end': (value: VueCalEventEvents) => any
|
|
253
|
+
'event-resize-start': (value: VueCalEventEvents) => any
|
|
254
|
+
'event-resize': (value: VueCalEventEvents & {overlaps: VueCalEvent[]}) => any
|
|
255
|
+
'event-resize-end': (value: VueCalEventEvents & {original: VueCalEvent, overlaps: VueCalEvent[]}) => any
|
|
256
|
+
'event-drop': (value: VueCalEventEvents & {overlaps: VueCalEvent[], cell: VueCalCell, external: boolean}) => any
|
|
257
|
+
'event-dropped': (value: VueCalEventEvents & {originalEvent: VueCalEvent, cell: VueCalCell, external: boolean}) => any
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export declare const VueCal: DefineSetupFnComponent<VueCalConfig, VueCalEmits>
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
export declare function addDatePrototypes(): void
|
|
264
|
+
|
|
265
|
+
declare global {
|
|
266
|
+
interface Date {
|
|
267
|
+
addDays(days: number): Date
|
|
268
|
+
|
|
269
|
+
addHours(hours: number): Date
|
|
270
|
+
|
|
271
|
+
addMinutes(minutes: number): Date
|
|
272
|
+
|
|
273
|
+
subtractDays(days: number): Date
|
|
274
|
+
|
|
275
|
+
subtractHours(hours: number): Date
|
|
276
|
+
|
|
277
|
+
subtractMinutes(minutes: number): Date
|
|
278
|
+
|
|
279
|
+
getWeek(): number
|
|
280
|
+
|
|
281
|
+
isToday(): boolean
|
|
282
|
+
|
|
283
|
+
isLeapYear(): boolean
|
|
284
|
+
|
|
285
|
+
format(format: string): string
|
|
286
|
+
|
|
287
|
+
formatTime(format: string): string
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
package/dist/vue-cal.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed as b, reactive as be, watch as De, toRefs as bt, ref as ue, onBeforeUnmount as Re, nextTick as Xe, inject as He, createElementBlock as P, openBlock as V, renderSlot as O, createCommentVNode as x, unref as $, Fragment as de, renderList as we, normalizeClass as pe, createElementVNode as he, createVNode as Oe, Transition as Ue, withCtx as N, createBlock as Se, resolveDynamicComponent as xe, mergeProps as ie, toHandlers as Ie, normalizeProps as ne, onMounted as Ze, toDisplayString as ce, createTextVNode as qe, withModifiers as et, normalizeStyle as $e, TransitionGroup as tt, createSlots as Ce, useTemplateRef as Tt, useId as Mt, useAttrs as Et, provide as nt, guardReactiveProps as le } from "vue";
|
|
2
2
|
/**
|
|
3
|
-
* vue-cal v5.0.1-rc.
|
|
4
|
-
* (c) 2024-
|
|
3
|
+
* vue-cal v5.0.1-rc.34
|
|
4
|
+
* (c) 2024-2026 Antoni Andre <antoniandre.web@gmail.com>
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
7
|
const fe = {
|