nuxt-ui-elements-pro 0.1.5 → 0.1.7
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/module.json +1 -1
- package/dist/module.mjs +153 -18
- package/dist/runtime/components/EventCalendar.d.vue.ts +109 -22
- package/dist/runtime/components/EventCalendar.vue +225 -602
- package/dist/runtime/components/EventCalendar.vue.d.ts +109 -22
- package/dist/runtime/components/OrgChart.d.vue.ts +191 -0
- package/dist/runtime/components/OrgChart.vue +290 -0
- package/dist/runtime/components/OrgChart.vue.d.ts +191 -0
- package/dist/runtime/components/event-calendar/EventCalendarHeader.d.vue.ts +45 -0
- package/dist/runtime/components/event-calendar/EventCalendarHeader.vue +55 -0
- package/dist/runtime/components/event-calendar/EventCalendarHeader.vue.d.ts +45 -0
- package/dist/runtime/components/event-calendar/EventCalendarListView.d.vue.ts +25 -0
- package/dist/runtime/components/event-calendar/EventCalendarListView.vue +95 -0
- package/dist/runtime/components/event-calendar/EventCalendarListView.vue.d.ts +25 -0
- package/dist/runtime/components/event-calendar/EventCalendarMonthView.d.vue.ts +34 -0
- package/dist/runtime/components/event-calendar/EventCalendarMonthView.vue +336 -0
- package/dist/runtime/components/event-calendar/EventCalendarMonthView.vue.d.ts +34 -0
- package/dist/runtime/components/event-calendar/EventCalendarTimeGrid.d.vue.ts +31 -0
- package/dist/runtime/components/event-calendar/EventCalendarTimeGrid.vue +306 -0
- package/dist/runtime/components/event-calendar/EventCalendarTimeGrid.vue.d.ts +31 -0
- package/dist/runtime/components/org-chart/OrgChartConnectors.d.vue.ts +15 -0
- package/dist/runtime/components/org-chart/OrgChartConnectors.vue +29 -0
- package/dist/runtime/components/org-chart/OrgChartConnectors.vue.d.ts +15 -0
- package/dist/runtime/components/org-chart/OrgChartControls.d.vue.ts +19 -0
- package/dist/runtime/components/org-chart/OrgChartControls.vue +25 -0
- package/dist/runtime/components/org-chart/OrgChartControls.vue.d.ts +19 -0
- package/dist/runtime/components/org-chart/OrgChartNode.d.vue.ts +30 -0
- package/dist/runtime/components/org-chart/OrgChartNode.vue +129 -0
- package/dist/runtime/components/org-chart/OrgChartNode.vue.d.ts +30 -0
- package/dist/runtime/composables/useEventCalendar.d.ts +52 -0
- package/dist/runtime/composables/useEventCalendar.js +362 -0
- package/dist/runtime/composables/useEventCalendarContext.d.ts +8 -0
- package/dist/runtime/composables/useEventCalendarContext.js +11 -0
- package/dist/runtime/composables/useEventCalendarDragDrop.d.ts +1 -1
- package/dist/runtime/composables/useEventCalendarDragDrop.js +11 -9
- package/dist/runtime/composables/useEventCalendarKeyboard.d.ts +20 -0
- package/dist/runtime/composables/useEventCalendarKeyboard.js +128 -0
- package/dist/runtime/composables/useEventCalendarResize.d.ts +31 -0
- package/dist/runtime/composables/useEventCalendarResize.js +87 -0
- package/dist/runtime/composables/useEventCalendarSelect.d.ts +21 -0
- package/dist/runtime/composables/useEventCalendarSelect.js +119 -0
- package/dist/runtime/composables/useOrgChart.d.ts +42 -0
- package/dist/runtime/composables/useOrgChart.js +154 -0
- package/dist/runtime/composables/useOrgChartContext.d.ts +8 -0
- package/dist/runtime/composables/useOrgChartContext.js +11 -0
- package/dist/runtime/composables/useOrgChartDragDrop.d.ts +20 -0
- package/dist/runtime/composables/useOrgChartDragDrop.js +67 -0
- package/dist/runtime/composables/useOrgChartKeyboard.d.ts +16 -0
- package/dist/runtime/composables/useOrgChartKeyboard.js +101 -0
- package/dist/runtime/composables/useOrgChartSearch.d.ts +16 -0
- package/dist/runtime/composables/useOrgChartSearch.js +62 -0
- package/dist/runtime/composables/useOrgChartZoom.d.ts +26 -0
- package/dist/runtime/composables/useOrgChartZoom.js +101 -0
- package/dist/runtime/index.d.ts +3 -0
- package/dist/runtime/index.js +2 -0
- package/dist/runtime/types/event-calendar.d.ts +170 -0
- package/dist/runtime/types/index.d.ts +2 -0
- package/dist/runtime/types/index.js +2 -0
- package/dist/runtime/types/org-chart.d.ts +181 -0
- package/dist/runtime/types/org-chart.js +0 -0
- package/dist/runtime/utils/event-calendar.d.ts +22 -1
- package/dist/runtime/utils/event-calendar.js +199 -1
- package/dist/runtime/utils/org-chart.d.ts +55 -0
- package/dist/runtime/utils/org-chart.js +367 -0
- package/dist/runtime/utils/recurrence.d.ts +30 -0
- package/dist/runtime/utils/recurrence.js +150 -0
- package/package.json +15 -6
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { ofetch } from 'ofetch';
|
|
|
5
5
|
const eventCalendar = (options) => ({
|
|
6
6
|
slots: {
|
|
7
7
|
// Shared
|
|
8
|
-
root: "w-full border border-default rounded-lg bg-default",
|
|
8
|
+
root: "w-full border border-default rounded-lg bg-default flex flex-col overflow-hidden",
|
|
9
9
|
header: "flex items-center justify-between px-4 py-3 border-b border-default",
|
|
10
10
|
headerTitle: "text-lg font-semibold text-highlighted",
|
|
11
11
|
headerActions: "flex items-center gap-1",
|
|
@@ -13,45 +13,78 @@ const eventCalendar = (options) => ({
|
|
|
13
13
|
// Month view
|
|
14
14
|
weekdayRow: "grid grid-cols-7 border-b border-default",
|
|
15
15
|
weekdayCell: "py-2 text-center text-xs font-medium text-muted uppercase tracking-wider",
|
|
16
|
-
monthBody: "
|
|
17
|
-
|
|
16
|
+
monthBody: "flex flex-col select-none",
|
|
17
|
+
monthWeekRow: "",
|
|
18
|
+
dayCell: "border-b border-r border-default hover:bg-elevated/50 cursor-pointer",
|
|
18
19
|
dayCellOutside: "bg-muted/20",
|
|
20
|
+
monthDayNumber: "relative z-[1] p-1",
|
|
19
21
|
dayNumber: "text-xs font-medium p-1 leading-none",
|
|
20
22
|
dayNumberToday: "inline-flex items-center justify-center size-6 rounded-full text-inverted font-semibold",
|
|
21
23
|
dayNumberOutside: "text-muted",
|
|
22
24
|
eventList: "space-y-1 mt-1",
|
|
25
|
+
spanningEventChip: [
|
|
26
|
+
"relative z-[2] flex items-center text-xs px-1.5 truncate cursor-pointer",
|
|
27
|
+
"text-[var(--event-color)]"
|
|
28
|
+
],
|
|
23
29
|
eventChip: [
|
|
24
|
-
"text-xs px-1.5 py-
|
|
30
|
+
"relative z-[2] flex items-center gap-1 text-xs px-1.5 py-0.5 rounded truncate cursor-pointer mx-0.5",
|
|
25
31
|
"border-l-2 text-[var(--event-color)] border-[var(--event-color)]"
|
|
26
32
|
],
|
|
27
33
|
eventTime: "font-medium mr-1",
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
recurringIcon: "size-3 shrink-0 opacity-60 align-middle mr-0.5",
|
|
35
|
+
moreEvents: "relative z-[2] text-xs text-muted px-1.5 py-0.5 cursor-pointer hover:text-highlighted",
|
|
36
|
+
expandedOverlay: "bg-default border border-default rounded-lg p-1.5 shadow-xl z-20 animate-expand-overlay",
|
|
30
37
|
// Week/Day view
|
|
31
|
-
|
|
38
|
+
timeGridRoot: "flex-1 flex flex-col min-h-0 overflow-hidden",
|
|
39
|
+
columnHeaders: "flex border-b border-default shrink-0",
|
|
32
40
|
timeGutterSpacer: "w-16 shrink-0 border-r border-default",
|
|
33
41
|
dayColumnHeader: "flex-1 bg-default py-2 text-center border-r border-default last:border-r-0",
|
|
34
42
|
dayColumnHeaderLabel: "text-xs font-medium text-muted uppercase",
|
|
35
43
|
dayColumnHeaderNumber: "text-lg font-semibold text-highlighted",
|
|
36
44
|
dayColumnHeaderToday: "inline-flex items-center justify-center size-8 rounded-full text-inverted font-semibold",
|
|
37
|
-
allDayRow: "flex border-b border-default min-h-8",
|
|
45
|
+
allDayRow: "flex border-b border-default min-h-8 shrink-0",
|
|
38
46
|
allDayLabel: "w-16 shrink-0 border-r border-default flex items-center justify-end pr-2 text-[10px] text-muted",
|
|
39
|
-
|
|
40
|
-
|
|
47
|
+
allDayGrid: "flex-1 relative",
|
|
48
|
+
allDayCell: "border-r border-default last:border-r-0",
|
|
49
|
+
allDaySpanningChip: [
|
|
50
|
+
"relative z-[2] flex items-center text-xs px-1.5 truncate cursor-pointer",
|
|
51
|
+
"text-[var(--event-color)]"
|
|
52
|
+
],
|
|
53
|
+
timeGrid: "relative flex items-start flex-1 min-h-0 overflow-auto select-none",
|
|
41
54
|
timeGutter: "sticky left-0 z-10 w-16 shrink-0 bg-default border-r border-default",
|
|
42
55
|
timeGutterSlot: "relative border-b border-default/50",
|
|
43
56
|
timeLabel: "absolute top-0 right-0 px-2 mr-2 text-[10px] text-muted -translate-y-1/2 bg-default",
|
|
44
57
|
dayColumn: "flex-1 relative border-r border-default last:border-r-0",
|
|
45
58
|
timeSlotRow: "border-b border-default/50 transition-colors",
|
|
46
59
|
timeEvent: [
|
|
47
|
-
"absolute rounded px-1.5 py-0.5 text-xs cursor-pointer overflow-hidden",
|
|
60
|
+
"absolute rounded px-1.5 py-0.5 text-xs cursor-pointer overflow-hidden group",
|
|
48
61
|
"border-l-2 text-[var(--event-color)] border-[var(--event-color)]"
|
|
49
62
|
],
|
|
50
|
-
timeEventTitle: "font-medium truncate",
|
|
63
|
+
timeEventTitle: "font-medium truncate flex items-center gap-1",
|
|
51
64
|
timeEventTime: "opacity-70 text-[10px]",
|
|
65
|
+
resizeHandle: "absolute bottom-0 left-0 right-0 h-2 cursor-s-resize flex items-center justify-center",
|
|
66
|
+
resizeHandleBar: "w-8 h-0.5 rounded-full bg-current opacity-0 group-hover:opacity-40 transition-opacity",
|
|
67
|
+
// List/agenda view
|
|
68
|
+
listBody: "divide-y divide-default",
|
|
69
|
+
listDateHeader: "flex items-center gap-3 px-4 py-2.5 bg-elevated/50 sticky top-0",
|
|
70
|
+
listDateWeekday: "text-sm font-semibold text-highlighted",
|
|
71
|
+
listDateLabel: "text-sm text-muted",
|
|
72
|
+
listEventRow: "flex items-center gap-3 px-4 py-2.5 hover:bg-elevated/50 cursor-pointer transition-colors",
|
|
73
|
+
listEventTime: "w-28 shrink-0 text-xs text-muted text-right",
|
|
74
|
+
listEventDot: "size-2.5 shrink-0 rounded-full",
|
|
75
|
+
listEventTitle: "text-sm text-highlighted truncate",
|
|
76
|
+
listEmpty: "px-4 py-8 text-center text-sm text-muted",
|
|
52
77
|
// Drag state
|
|
53
78
|
dropTarget: "ring-2 ring-dashed ring-offset-1",
|
|
54
|
-
dragSnapSlot: ""
|
|
79
|
+
dragSnapSlot: "",
|
|
80
|
+
// Selection
|
|
81
|
+
selectionOverlay: "",
|
|
82
|
+
// Loading & empty states
|
|
83
|
+
loadingOverlay: "absolute inset-0 z-30 flex items-center justify-center bg-default/60",
|
|
84
|
+
loadingIcon: "size-8 text-muted animate-spin",
|
|
85
|
+
emptyState: "flex flex-col items-center justify-center gap-2 py-14 text-center",
|
|
86
|
+
emptyStateIcon: "size-10 text-muted/50",
|
|
87
|
+
emptyStateText: "text-sm text-muted"
|
|
55
88
|
},
|
|
56
89
|
variants: {
|
|
57
90
|
color: {
|
|
@@ -66,7 +99,8 @@ const eventCalendar = (options) => ({
|
|
|
66
99
|
dayNumberToday: `bg-${color}`,
|
|
67
100
|
dayColumnHeaderToday: `bg-${color}`,
|
|
68
101
|
dropTarget: `ring-${color}`,
|
|
69
|
-
dragSnapSlot: `bg-${color}/10 ring-1 ring-inset ring-${color}/30
|
|
102
|
+
dragSnapSlot: `bg-${color}/10 ring-1 ring-inset ring-${color}/30`,
|
|
103
|
+
selectionOverlay: `bg-${color}/10`
|
|
70
104
|
}
|
|
71
105
|
})),
|
|
72
106
|
{
|
|
@@ -75,7 +109,8 @@ const eventCalendar = (options) => ({
|
|
|
75
109
|
dayNumberToday: "bg-inverted",
|
|
76
110
|
dayColumnHeaderToday: "bg-inverted",
|
|
77
111
|
dropTarget: "ring-inverted",
|
|
78
|
-
dragSnapSlot: "bg-inverted/10 ring-1 ring-inset ring-inverted/30"
|
|
112
|
+
dragSnapSlot: "bg-inverted/10 ring-1 ring-inset ring-inverted/30",
|
|
113
|
+
selectionOverlay: "bg-inverted/10"
|
|
79
114
|
}
|
|
80
115
|
}
|
|
81
116
|
],
|
|
@@ -84,9 +119,109 @@ const eventCalendar = (options) => ({
|
|
|
84
119
|
}
|
|
85
120
|
});
|
|
86
121
|
|
|
122
|
+
const orgChart = (options) => ({
|
|
123
|
+
slots: {
|
|
124
|
+
// Root container
|
|
125
|
+
root: "relative w-full overflow-auto",
|
|
126
|
+
// Viewport (zoom/pan container)
|
|
127
|
+
viewport: "relative will-change-transform",
|
|
128
|
+
// SVG connector layer
|
|
129
|
+
connectorLayer: "absolute inset-0 pointer-events-none overflow-visible",
|
|
130
|
+
connector: "fill-none text-[var(--ui-border-accented)] stroke-current stroke-2",
|
|
131
|
+
// Non-hierarchical connection
|
|
132
|
+
connection: "fill-none text-[var(--ui-border-accented)] stroke-current stroke-2 pointer-events-auto cursor-pointer",
|
|
133
|
+
connectionLabel: [
|
|
134
|
+
"absolute text-xs px-1.5 py-0.5 rounded bg-elevated border border-default",
|
|
135
|
+
"text-muted whitespace-nowrap pointer-events-auto cursor-pointer",
|
|
136
|
+
"-translate-x-1/2 -translate-y-1/2"
|
|
137
|
+
],
|
|
138
|
+
// Node card
|
|
139
|
+
node: [
|
|
140
|
+
"absolute flex items-center gap-3 rounded-lg border border-default bg-default",
|
|
141
|
+
"px-3 py-2 cursor-pointer select-none",
|
|
142
|
+
"hover:shadow-md"
|
|
143
|
+
],
|
|
144
|
+
nodeAnimated: "transition-all duration-300 ease-in-out",
|
|
145
|
+
nodeSelected: "ring-2",
|
|
146
|
+
nodeFocused: "outline-2 outline-offset-2",
|
|
147
|
+
nodeDimmed: "opacity-30 pointer-events-none",
|
|
148
|
+
nodeMatched: "ring-2 shadow-md",
|
|
149
|
+
// Drag-and-drop
|
|
150
|
+
nodeDragging: "opacity-50 shadow-lg scale-105",
|
|
151
|
+
nodeDropTarget: "ring-2 ring-dashed",
|
|
152
|
+
// Node internals
|
|
153
|
+
nodeAvatar: "size-10 rounded-full shrink-0 object-cover",
|
|
154
|
+
nodeIcon: "size-10 shrink-0 flex items-center justify-center rounded-full bg-elevated",
|
|
155
|
+
nodeContent: "flex flex-col min-w-0",
|
|
156
|
+
nodeName: "text-sm font-semibold text-highlighted truncate",
|
|
157
|
+
nodeTitle: "text-xs text-muted truncate",
|
|
158
|
+
searchHighlight: "text-highlighted rounded-sm px-0.5",
|
|
159
|
+
// Collapse toggle
|
|
160
|
+
collapseToggle: [
|
|
161
|
+
"absolute flex items-center justify-center size-5 rounded-full",
|
|
162
|
+
"bg-elevated border border-default text-muted cursor-pointer",
|
|
163
|
+
"hover:bg-default hover:text-highlighted transition-colors"
|
|
164
|
+
],
|
|
165
|
+
descendantBadge: "text-[10px] font-medium",
|
|
166
|
+
// Zoom controls
|
|
167
|
+
zoomControls: "absolute top-2 right-2 flex flex-col gap-1 z-10",
|
|
168
|
+
// Empty state
|
|
169
|
+
emptyState: "flex flex-col items-center justify-center gap-2 py-14 text-center",
|
|
170
|
+
emptyStateIcon: "size-10 text-muted/50",
|
|
171
|
+
emptyStateText: "text-sm text-muted"
|
|
172
|
+
},
|
|
173
|
+
variants: {
|
|
174
|
+
color: {
|
|
175
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
176
|
+
neutral: ""
|
|
177
|
+
},
|
|
178
|
+
compact: {
|
|
179
|
+
true: "",
|
|
180
|
+
false: ""
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
compoundVariants: [
|
|
184
|
+
...(options.theme.colors || []).map((color) => ({
|
|
185
|
+
color,
|
|
186
|
+
class: {
|
|
187
|
+
nodeSelected: `ring-${color}`,
|
|
188
|
+
nodeFocused: `outline-${color}`,
|
|
189
|
+
nodeDropTarget: `ring-${color} bg-${color}/5`,
|
|
190
|
+
nodeMatched: `ring-${color}`,
|
|
191
|
+
searchHighlight: `bg-${color}/30`
|
|
192
|
+
}
|
|
193
|
+
})),
|
|
194
|
+
{
|
|
195
|
+
color: "neutral",
|
|
196
|
+
class: {
|
|
197
|
+
nodeSelected: "ring-inverted",
|
|
198
|
+
nodeFocused: "outline-inverted",
|
|
199
|
+
nodeDropTarget: "ring-inverted bg-inverted/5",
|
|
200
|
+
nodeMatched: "ring-inverted",
|
|
201
|
+
searchHighlight: "bg-inverted/30"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
compact: true,
|
|
206
|
+
class: {
|
|
207
|
+
node: "px-2 py-1 gap-2",
|
|
208
|
+
nodeAvatar: "size-6",
|
|
209
|
+
nodeIcon: "size-6",
|
|
210
|
+
nodeName: "text-xs",
|
|
211
|
+
nodeTitle: "hidden"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
],
|
|
215
|
+
defaultVariants: {
|
|
216
|
+
color: "primary",
|
|
217
|
+
compact: false
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
|
|
87
221
|
const theme = {
|
|
88
222
|
__proto__: null,
|
|
89
|
-
eventCalendar: eventCalendar
|
|
223
|
+
eventCalendar: eventCalendar,
|
|
224
|
+
orgChart: orgChart
|
|
90
225
|
};
|
|
91
226
|
|
|
92
227
|
function addTemplates(options, _nuxt) {
|
|
@@ -211,12 +346,12 @@ Add it to your \`.env\` file to build for production.`
|
|
|
211
346
|
}
|
|
212
347
|
};
|
|
213
348
|
addTemplates(optionsWithTheme);
|
|
214
|
-
nuxt.options.css.push(resolver.resolve("./runtime/index.css"));
|
|
215
349
|
addImportsDir(resolver.resolve("./runtime/composables"));
|
|
216
350
|
nuxt.options.alias["#ui-elements-pro"] = resolver.resolve("./runtime");
|
|
217
351
|
addComponentsDir({
|
|
218
352
|
path: resolver.resolve("./runtime/components"),
|
|
219
|
-
prefix: options.prefix
|
|
353
|
+
prefix: options.prefix,
|
|
354
|
+
pattern: "*.vue"
|
|
220
355
|
});
|
|
221
356
|
}
|
|
222
357
|
});
|
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
import type { CalendarDate, DateValue } from "@internationalized/date";
|
|
2
2
|
import type { AppConfig } from "@nuxt/schema";
|
|
3
|
-
import theme from "#build/ui-elements-pro/event-calendar";
|
|
4
3
|
import type { ComponentConfig } from "nuxt-ui-elements";
|
|
5
|
-
import type { CalendarEvent, CalendarDay, MonthViewOptions, WeekViewOptions, DayViewOptions, EventDropPayload } from "../types/event-calendar.js";
|
|
4
|
+
import type { CalendarEvent, CalendarView, CalendarDay, MonthViewOptions, WeekViewOptions, DayViewOptions, EventDropPayload, EventResizePayload, SelectPayload, EventCalendarContext } from "../types/event-calendar.js";
|
|
5
|
+
import { type Component } from "vue";
|
|
6
|
+
import theme from "#build/ui-elements-pro/event-calendar";
|
|
6
7
|
type EventCalendar = ComponentConfig<typeof theme, AppConfig, "eventCalendar">;
|
|
7
8
|
export interface EventCalendarProps {
|
|
9
|
+
/** Rendered element type @defaultValue 'div' */
|
|
10
|
+
as?: string | Component;
|
|
8
11
|
/** Array of events to display */
|
|
9
12
|
events?: CalendarEvent[];
|
|
10
13
|
/** Currently displayed date. Controls which month/week/day is shown. Supports v-model. */
|
|
11
14
|
modelValue?: Date | string | DateValue;
|
|
12
15
|
/** Calendar view mode @defaultValue 'month' */
|
|
13
|
-
view?:
|
|
16
|
+
view?: CalendarView;
|
|
17
|
+
/** Which views are available and shown in the view switcher @defaultValue ['month', 'week', 'day', 'list'] */
|
|
18
|
+
views?: CalendarView[];
|
|
14
19
|
/** Locale for day/month names @defaultValue 'en-US' */
|
|
15
20
|
locale?: string;
|
|
16
|
-
/** Day the week starts on @defaultValue 0 */
|
|
17
|
-
weekStartsOn?: 0 | 1;
|
|
21
|
+
/** Day the week starts on (0=Sun, 1=Mon, … 6=Sat) @defaultValue 0 */
|
|
22
|
+
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
18
23
|
/** Enable drag-and-drop globally @defaultValue true */
|
|
19
24
|
editable?: boolean;
|
|
25
|
+
/** Show loading overlay @defaultValue false */
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
/** Enable click/drag date range selection @defaultValue true */
|
|
28
|
+
selectable?: boolean;
|
|
20
29
|
/** Theme color for calendar chrome @defaultValue 'primary' */
|
|
21
30
|
color?: EventCalendar["variants"]["color"];
|
|
31
|
+
/** Override header title. Pass a string for static text, or a function for dynamic formatting. */
|
|
32
|
+
headerTitle?: string | ((date: CalendarDate, view: CalendarView) => string);
|
|
22
33
|
/** Month view options */
|
|
23
34
|
monthOptions?: MonthViewOptions;
|
|
24
35
|
/** Week view options */
|
|
@@ -32,64 +43,140 @@ export interface EventCalendarEmits {
|
|
|
32
43
|
/** Fires when the displayed date changes */
|
|
33
44
|
"update:modelValue": [value: CalendarDate];
|
|
34
45
|
/** Fires when the view changes */
|
|
35
|
-
"update:view": [value:
|
|
46
|
+
"update:view": [value: CalendarView];
|
|
36
47
|
/** Fires when a date cell is clicked */
|
|
37
48
|
dateClick: [date: CalendarDate];
|
|
38
49
|
/** Fires when an event is clicked */
|
|
39
50
|
eventClick: [event: CalendarEvent];
|
|
40
51
|
/** Fires after drag-and-drop */
|
|
41
52
|
eventDrop: [payload: EventDropPayload];
|
|
53
|
+
/** Fires after resize */
|
|
54
|
+
eventResize: [payload: EventResizePayload];
|
|
55
|
+
/** Fires when resize starts */
|
|
56
|
+
eventResizeStart: [payload: {
|
|
57
|
+
event: CalendarEvent;
|
|
58
|
+
}];
|
|
59
|
+
/** Fires when resize ends */
|
|
60
|
+
eventResizeEnd: [payload: {
|
|
61
|
+
event: CalendarEvent;
|
|
62
|
+
}];
|
|
63
|
+
/** Fires after a click or drag date range selection */
|
|
64
|
+
select: [payload: SelectPayload];
|
|
42
65
|
}
|
|
43
66
|
export interface EventCalendarSlots {
|
|
44
|
-
|
|
67
|
+
default?: (props: EventCalendarContext) => any;
|
|
68
|
+
/** Replace the entire header */
|
|
69
|
+
header?: (props: {
|
|
45
70
|
title: string;
|
|
46
71
|
prev: () => void;
|
|
47
72
|
next: () => void;
|
|
48
73
|
today: () => void;
|
|
49
74
|
currentDate: CalendarDate;
|
|
50
|
-
view:
|
|
51
|
-
setView: (v:
|
|
75
|
+
view: CalendarView;
|
|
76
|
+
setView: (v: CalendarView) => void;
|
|
77
|
+
views: CalendarView[];
|
|
78
|
+
}) => any;
|
|
79
|
+
/** Replace just the header title element */
|
|
80
|
+
"header-title"?: (props: {
|
|
81
|
+
title: string;
|
|
82
|
+
date: CalendarDate;
|
|
83
|
+
view: CalendarView;
|
|
84
|
+
}) => any;
|
|
85
|
+
/** Replace just the header nav buttons */
|
|
86
|
+
"header-nav"?: (props: {
|
|
87
|
+
prev: () => void;
|
|
88
|
+
next: () => void;
|
|
89
|
+
today: () => void;
|
|
90
|
+
}) => any;
|
|
91
|
+
/** Replace just the header view switcher */
|
|
92
|
+
"header-view-switcher"?: (props: {
|
|
93
|
+
view: CalendarView;
|
|
94
|
+
setView: (v: CalendarView) => void;
|
|
95
|
+
views: CalendarView[];
|
|
52
96
|
}) => any;
|
|
53
|
-
|
|
97
|
+
/** Customize event rendering across all views */
|
|
98
|
+
event?: (props: {
|
|
99
|
+
event: CalendarEvent;
|
|
100
|
+
view: CalendarView;
|
|
101
|
+
}) => any;
|
|
102
|
+
/** Customize weekday header labels (month view) */
|
|
103
|
+
"day-header"?: (props: {
|
|
54
104
|
day: string;
|
|
55
105
|
index: number;
|
|
56
106
|
}) => any;
|
|
57
|
-
day
|
|
107
|
+
/** Customize day cell content (month view) */
|
|
108
|
+
day?: (props: {
|
|
58
109
|
day: CalendarDay;
|
|
59
110
|
}) => any;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
view: "month" | "week" | "day";
|
|
63
|
-
}) => any;
|
|
64
|
-
"more-events": (props: {
|
|
111
|
+
/** Customize "+N more" indicator (month view) */
|
|
112
|
+
"more-events"?: (props: {
|
|
65
113
|
events: CalendarEvent[];
|
|
66
114
|
count: number;
|
|
67
115
|
day: CalendarDay;
|
|
68
116
|
}) => any;
|
|
69
|
-
|
|
117
|
+
/** Customize time labels (week/day view) */
|
|
118
|
+
"time-label"?: (props: {
|
|
70
119
|
hour: number;
|
|
71
120
|
label: string;
|
|
72
121
|
}) => any;
|
|
73
|
-
|
|
122
|
+
/** Customize all-day event area (week/day view) */
|
|
123
|
+
"all-day"?: (props: {
|
|
74
124
|
events: CalendarEvent[];
|
|
75
125
|
date: CalendarDate;
|
|
76
126
|
}) => any;
|
|
127
|
+
/** Customize date group headers (list view) */
|
|
128
|
+
"date-header"?: (props: {
|
|
129
|
+
day: CalendarDay;
|
|
130
|
+
weekday: string;
|
|
131
|
+
dateLabel: string;
|
|
132
|
+
}) => any;
|
|
133
|
+
/** Customize loading overlay */
|
|
134
|
+
loading?: () => any;
|
|
135
|
+
/** Customize empty state */
|
|
136
|
+
empty?: () => any;
|
|
77
137
|
}
|
|
78
138
|
declare const _default: typeof __VLS_export;
|
|
79
139
|
export default _default;
|
|
80
|
-
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<EventCalendarProps, {
|
|
140
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<EventCalendarProps, {
|
|
141
|
+
next: () => void;
|
|
142
|
+
prev: () => void;
|
|
143
|
+
today: () => void;
|
|
144
|
+
setView: (v: CalendarView) => void;
|
|
145
|
+
setDate: (date: Date | string | DateValue) => void;
|
|
146
|
+
view: import("vue").ComputedRef<CalendarView>;
|
|
147
|
+
date: import("vue").ComputedRef<CalendarDate>;
|
|
148
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
149
|
+
select: (payload: SelectPayload) => any;
|
|
81
150
|
"update:modelValue": (value: CalendarDate) => any;
|
|
82
|
-
"update:view": (value:
|
|
151
|
+
"update:view": (value: CalendarView) => any;
|
|
83
152
|
dateClick: (date: CalendarDate) => any;
|
|
84
153
|
eventClick: (event: CalendarEvent) => any;
|
|
85
154
|
eventDrop: (payload: EventDropPayload) => any;
|
|
155
|
+
eventResize: (payload: EventResizePayload) => any;
|
|
156
|
+
eventResizeStart: (payload: {
|
|
157
|
+
event: CalendarEvent;
|
|
158
|
+
}) => any;
|
|
159
|
+
eventResizeEnd: (payload: {
|
|
160
|
+
event: CalendarEvent;
|
|
161
|
+
}) => any;
|
|
86
162
|
}, string, import("vue").PublicProps, Readonly<EventCalendarProps> & Readonly<{
|
|
163
|
+
onSelect?: ((payload: SelectPayload) => any) | undefined;
|
|
87
164
|
"onUpdate:modelValue"?: ((value: CalendarDate) => any) | undefined;
|
|
88
|
-
"onUpdate:view"?: ((value:
|
|
165
|
+
"onUpdate:view"?: ((value: CalendarView) => any) | undefined;
|
|
89
166
|
onDateClick?: ((date: CalendarDate) => any) | undefined;
|
|
90
167
|
onEventClick?: ((event: CalendarEvent) => any) | undefined;
|
|
91
168
|
onEventDrop?: ((payload: EventDropPayload) => any) | undefined;
|
|
92
|
-
|
|
169
|
+
onEventResize?: ((payload: EventResizePayload) => any) | undefined;
|
|
170
|
+
onEventResizeStart?: ((payload: {
|
|
171
|
+
event: CalendarEvent;
|
|
172
|
+
}) => any) | undefined;
|
|
173
|
+
onEventResizeEnd?: ((payload: {
|
|
174
|
+
event: CalendarEvent;
|
|
175
|
+
}) => any) | undefined;
|
|
176
|
+
}>, {
|
|
177
|
+
editable: boolean;
|
|
178
|
+
selectable: boolean;
|
|
179
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, EventCalendarSlots>;
|
|
93
180
|
type __VLS_WithSlots<T, S> = T & {
|
|
94
181
|
new (): {
|
|
95
182
|
$slots: S;
|