@mintplayer/web-components 2.3.0 → 2.5.0

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.
@@ -1,17 +1,17 @@
1
- import { D as T, d as C } from "../chunks/color-CyamnJnn.mjs";
2
- import { a as N, b as X, R as Y, T as G, c as U, e as _, g as q, f as J, h as K, i as Q, j as Z, k as tt, l as et, m as ot, n as nt, r as st, t as ct } from "../chunks/color-CyamnJnn.mjs";
3
- class x {
1
+ import { D as $, d as C } from "../chunks/id-D5QCG603.mjs";
2
+ import { a as U, b as V, c as j, e as G, f as X, R as Y, T as q, g as J, h as K, i as Q, j as Z, k as tt, l as et, m as ot, n as st, o as nt, p as it, q as ct, r as rt, s as at, t as lt, u as dt, v as gt, w as ht } from "../chunks/id-D5QCG603.mjs";
3
+ class w {
4
4
  /**
5
5
  * Calculate position for an event part in week/day view
6
6
  */
7
- calculateWeekPosition(t, e, n, s, c, l = {}) {
8
- const i = { ...T, ...l };
7
+ calculateWeekPosition(t, e, s, n, i, l = {}) {
8
+ const c = { ...$, ...l };
9
9
  new Date(t.start).setHours(0, 0, 0, 0);
10
- const a = C.getSecondsFromMidnight(t.start), u = C.getSecondsFromMidnight(t.end) - a, [d] = i.slotMinTime.split(":").map(Number), [f] = i.slotMaxTime.split(":").map(Number), g = (f - d) * 3600, m = (a - d * 3600) / g * 100, R = u / g * 100, S = 10, p = (100 - S) / c, $ = p / n, w = S + s * p + e * $;
10
+ const a = C.getSecondsFromMidnight(t.start), u = C.getSecondsFromMidnight(t.end) - a, [d] = c.slotMinTime.split(":").map(Number), [f] = c.slotMaxTime.split(":").map(Number), g = (f - d) * 3600, m = (a - d * 3600) / g * 100, R = u / g * 100, S = 10, p = (100 - S) / i, T = p / s, b = S + n * p + e * T;
11
11
  return {
12
12
  top: m,
13
- left: w,
14
- width: $,
13
+ left: b,
14
+ width: T,
15
15
  height: R,
16
16
  zIndex: e + 1
17
17
  };
@@ -19,9 +19,9 @@ class x {
19
19
  /**
20
20
  * Calculate position for an event in timeline view
21
21
  */
22
- calculateTimelinePosition(t, e, n, s, c, l = {}) {
23
- ({ ...T, ...l });
24
- const i = c.getTime() - s.getTime(), r = Math.max(t.start.getTime(), s.getTime()), a = Math.min(t.end.getTime(), c.getTime()), h = r - s.getTime(), u = a - r, d = h / i * 100, f = u / i * 100, g = 100 / n;
22
+ calculateTimelinePosition(t, e, s, n, i, l = {}) {
23
+ ({ ...$, ...l });
24
+ const c = i.getTime() - n.getTime(), r = Math.max(t.start.getTime(), n.getTime()), a = Math.min(t.end.getTime(), i.getTime()), h = r - n.getTime(), u = a - r, d = h / c * 100, f = u / c * 100, g = 100 / s;
25
25
  return {
26
26
  top: e * g,
27
27
  left: d,
@@ -33,8 +33,8 @@ class x {
33
33
  /**
34
34
  * Calculate position for an all-day event in month view
35
35
  */
36
- calculateMonthEventPosition(t, e, n, s, c, l = 7) {
37
- const i = 100 / l, r = 100 / n, a = s * i, h = (c - s + 1) * i;
36
+ calculateMonthEventPosition(t, e, s, n, i, l = 7) {
37
+ const c = 100 / l, r = 100 / s, a = n * c, h = (i - n + 1) * c;
38
38
  return {
39
39
  top: e * r,
40
40
  left: a,
@@ -46,12 +46,12 @@ class x {
46
46
  /**
47
47
  * Convert percentage-based position to pixel-based
48
48
  */
49
- toPixelPosition(t, e, n) {
49
+ toPixelPosition(t, e, s) {
50
50
  return {
51
- top: t.top / 100 * n,
51
+ top: t.top / 100 * s,
52
52
  left: t.left / 100 * e,
53
53
  width: t.width / 100 * e,
54
- height: t.height / 100 * n,
54
+ height: t.height / 100 * s,
55
55
  zIndex: t.zIndex
56
56
  };
57
57
  }
@@ -82,93 +82,100 @@ class x {
82
82
  };
83
83
  }
84
84
  }
85
- const P = new x();
86
- function z(o, t) {
87
- const e = Object.entries(t).map(([n, s]) => `[data-${n}="${s}"]`).join("");
85
+ const I = new w();
86
+ function P(o, t) {
87
+ const e = Object.entries(t).map(([s, n]) => `[data-${s}="${n}"]`).join("");
88
88
  return o.querySelector(e);
89
89
  }
90
- function B(o) {
90
+ function D(o) {
91
91
  const t = o.dataset, e = {};
92
- for (const n in t) {
93
- const s = t[n];
94
- s !== void 0 && (e[n] = s);
92
+ for (const s in t) {
93
+ const n = t[s];
94
+ n !== void 0 && (e[s] = n);
95
95
  }
96
96
  return e;
97
97
  }
98
- function D(o, t) {
98
+ function L(o, t) {
99
99
  return o.closest(`[data-${t}]`);
100
100
  }
101
- function W(o) {
101
+ function M(o) {
102
102
  return {
103
103
  top: o.scrollTop,
104
104
  left: o.scrollLeft
105
105
  };
106
106
  }
107
- function L(o, t, e = "smooth") {
108
- const n = o.getBoundingClientRect(), c = t.getBoundingClientRect().top - n.top + o.scrollTop;
107
+ function O(o, t, e = "smooth") {
108
+ const s = o.getBoundingClientRect(), i = t.getBoundingClientRect().top - s.top + o.scrollTop;
109
109
  o.scrollTo({
110
- top: c,
110
+ top: i,
111
111
  behavior: e
112
112
  });
113
113
  }
114
- function M(o, t) {
115
- const e = o.getBoundingClientRect(), n = t ? t.getBoundingClientRect() : { top: 0, left: 0, bottom: window.innerHeight, right: window.innerWidth };
116
- return e.top >= n.top && e.left >= n.left && e.bottom <= n.bottom && e.right <= n.right;
114
+ function z(o, t) {
115
+ const e = o.getBoundingClientRect(), s = t ? t.getBoundingClientRect() : { top: 0, left: 0, bottom: window.innerHeight, right: window.innerWidth };
116
+ return e.top >= s.top && e.left >= s.left && e.bottom <= s.bottom && e.right <= s.right;
117
117
  }
118
- function O(o, t) {
119
- const e = t.getBoundingClientRect(), n = "touches" in o ? o.touches[0].clientX : o.clientX, s = "touches" in o ? o.touches[0].clientY : o.clientY;
118
+ function B(o, t) {
119
+ const e = t.getBoundingClientRect(), s = "touches" in o ? o.touches[0].clientX : o.clientX, n = "touches" in o ? o.touches[0].clientY : o.clientY;
120
120
  return {
121
- x: n - e.left,
122
- y: s - e.top
121
+ x: s - e.left,
122
+ y: n - e.top
123
123
  };
124
124
  }
125
- function k(o, t, e) {
125
+ function A(o, t, e) {
126
126
  o.style.setProperty(`--${t}`, e);
127
127
  }
128
- function E(o, t) {
128
+ function W(o, t) {
129
129
  return getComputedStyle(o).getPropertyValue(`--${t}`).trim();
130
130
  }
131
- function H(o, ...t) {
131
+ function F(o, ...t) {
132
132
  o.classList.add(...t.filter(Boolean));
133
133
  }
134
- function j(o, ...t) {
134
+ function _(o, ...t) {
135
135
  o.classList.remove(...t.filter(Boolean));
136
136
  }
137
- function A(o, t, e) {
137
+ function k(o, t, e) {
138
138
  o.classList.toggle(t, e);
139
139
  }
140
140
  export {
141
- N as DEFAULT_COLORS,
142
- T as DEFAULT_OPTIONS,
141
+ U as DEFAULT_COLORS,
142
+ V as DEFAULT_EVENT_COLOR,
143
+ j as DEFAULT_MESSAGES,
144
+ $ as DEFAULT_OPTIONS,
145
+ G as DEFAULT_PERMISSIONS,
143
146
  X as DateService,
144
- x as PositionService,
147
+ w as PositionService,
145
148
  Y as ResourceService,
146
- G as TimelineService,
147
- U as addAlpha,
148
- H as addClasses,
149
- _ as darkenColor,
149
+ q as TimelineService,
150
+ J as addAlpha,
151
+ F as addClasses,
152
+ K as darkenColor,
150
153
  C as dateService,
151
- D as findClosestWithData,
152
- q as generateEventId,
153
- J as generateGroupId,
154
- K as generateId,
155
- Q as generateResourceId,
156
- E as getCSSVariable,
157
- Z as getColorByIndex,
158
- tt as getContrastColor,
159
- B as getDataAttributes,
160
- z as getElementByData,
161
- O as getRelativePosition,
162
- W as getScrollPosition,
163
- M as isInViewport,
164
- et as isResource,
165
- ot as isResourceGroup,
166
- nt as lightenColor,
167
- P as positionService,
168
- j as removeClasses,
169
- st as resourceService,
170
- L as scrollToTime,
171
- k as setCSSVariable,
172
- ct as timelineService,
173
- A as toggleClass
154
+ L as findClosestWithData,
155
+ Q as formatMessage,
156
+ Z as generateEventId,
157
+ tt as generateGroupId,
158
+ et as generateId,
159
+ ot as generateResourceId,
160
+ W as getCSSVariable,
161
+ st as getColorByIndex,
162
+ nt as getContrastColor,
163
+ D as getDataAttributes,
164
+ P as getElementByData,
165
+ B as getRelativePosition,
166
+ M as getScrollPosition,
167
+ z as isInViewport,
168
+ it as isResource,
169
+ ct as isResourceGroup,
170
+ rt as lightenColor,
171
+ I as positionService,
172
+ _ as removeClasses,
173
+ at as resolveCapability,
174
+ lt as resolveEventColor,
175
+ dt as resolveMessages,
176
+ gt as resourceService,
177
+ O as scrollToTime,
178
+ A as setCSSVariable,
179
+ ht as timelineService,
180
+ k as toggleClass
174
181
  };
@@ -1,108 +1,94 @@
1
1
  import { SchedulerEvent } from './event';
2
- import { Resource } from './resource';
2
+ import { Resource, ResourceGroup } from './resource';
3
3
  import { ViewType } from './types';
4
4
  /**
5
- * Base event detail interface
5
+ * Time range carried by `selection-change` and `event-create`. `start` is the
6
+ * inclusive lower edge, `end` is the exclusive upper edge of the last selected
7
+ * slot — matching the natural slot-pair shape produced by `selectionRange()`
8
+ * in `views/base-view.ts`.
6
9
  */
7
- export interface BaseEventDetail {
8
- /** Original DOM event */
9
- originalEvent?: Event;
10
+ export interface TimeRange {
11
+ start: Date;
12
+ end: Date;
10
13
  }
11
14
  /**
12
- * Event-selected event detail. Fires on mouse click and on keyboard Tab
13
- * landing on an event (PRD scheduler-keyboard-grid-nav D3 — renamed from
14
- * `EventClickDetail` because keyboard Tab now triggers the same event).
15
+ * Every custom event `mp-scheduler` can emit, as one discriminated union.
16
+ *
17
+ * This union is the SINGLE source of truth for the event surface: the emitter
18
+ * accepts it, `EventDetail<T>` derives each payload from it, and
19
+ * `SchedulerEventMap` is a mechanical mapping of it. A second hand-written
20
+ * table drifts — the previous one had grown a `date-select` entry nothing
21
+ * emitted and a `date-click` resource field nothing sent.
22
+ *
23
+ * Every event bubbles AND is composed, so a scheduler nested inside another
24
+ * component's shadow root still reaches the outer consumer.
15
25
  */
16
- export interface EventSelectedDetail extends BaseEventDetail {
17
- /** The selected event */
26
+ export type SchedulerCustomEvent = {
27
+ type: 'event-selected';
18
28
  event: SchedulerEvent;
19
- }
20
- /**
21
- * Event create *request* detail. Per PRD scheduler-controlled-selection,
22
- * the scheduler does not construct or store the event itself — the consumer
23
- * receives the range and decides whether to add an event for it.
24
- */
25
- export interface EventCreateDetail extends BaseEventDetail {
26
- /** The selected time range. */
27
- range: {
28
- start: Date;
29
- end: Date;
30
- };
31
- /** Resource the request targets (timeline view only). */
32
- resourceId?: string;
33
- /** View that produced the request. */
34
- view: ViewType;
35
- }
36
- /**
37
- * Selection-change detail. Fires on every transition — including the
38
- * transition to an empty selection. `selectedEvent` and `range` are
39
- * independent dimensions of the selection state.
40
- */
41
- export interface SelectionChangeDetail {
42
- selectedEvent: SchedulerEvent | null;
43
- range: {
44
- start: Date;
45
- end: Date;
46
- } | null;
29
+ originalEvent: Event;
30
+ } | {
31
+ type: 'event-dblclick';
32
+ event: SchedulerEvent;
33
+ originalEvent: Event;
34
+ } | {
35
+ type: 'event-create';
36
+ range: TimeRange;
47
37
  view: ViewType;
48
38
  resourceId?: string;
49
- }
50
- /**
51
- * Event update event detail
52
- */
53
- export interface EventUpdateDetail extends BaseEventDetail {
54
- /** The updated event */
39
+ originalEvent: Event;
40
+ } | {
41
+ type: 'event-update';
55
42
  event: SchedulerEvent;
56
- /** The event before the update */
57
43
  oldEvent: SchedulerEvent;
58
- }
59
- /**
60
- * Event delete event detail
61
- */
62
- export interface EventDeleteDetail extends BaseEventDetail {
63
- /** The deleted event */
44
+ originalEvent: Event;
45
+ } | {
46
+ type: 'event-delete';
64
47
  event: SchedulerEvent;
65
- }
66
- /**
67
- * Date click event detail
68
- */
69
- export interface DateClickDetail extends BaseEventDetail {
70
- /** The clicked date */
48
+ } | {
49
+ type: 'date-click';
71
50
  date: Date;
72
- /** Resource at the clicked location (if applicable) */
73
- resource?: Resource;
74
- }
75
- /**
76
- * Date select event detail
77
- */
78
- export interface DateSelectDetail extends BaseEventDetail {
79
- /** Start of the selected range */
80
- start: Date;
81
- /** End of the selected range */
82
- end: Date;
83
- /** Resource at the selected location (if applicable) */
84
- resource?: Resource;
85
- }
86
- /**
87
- * View change event detail
88
- */
89
- export interface ViewChangeDetail {
90
- /** The new view */
51
+ originalEvent: Event;
52
+ } | {
53
+ type: 'view-change';
91
54
  view: ViewType;
92
- /** The current date in the new view */
93
55
  date: Date;
94
- }
56
+ } | {
57
+ type: 'selection-change';
58
+ selectedEvent: SchedulerEvent | null;
59
+ range: TimeRange | null;
60
+ view: ViewType;
61
+ resourceId?: string;
62
+ } | {
63
+ type: 'resource-create';
64
+ parentId?: string;
65
+ view: ViewType;
66
+ originalEvent: Event;
67
+ } | {
68
+ type: 'group-create';
69
+ parentId?: string;
70
+ view: ViewType;
71
+ originalEvent: Event;
72
+ } | {
73
+ type: 'resource-update';
74
+ resource: Resource | ResourceGroup;
75
+ changes: Partial<Resource & ResourceGroup>;
76
+ originalEvent: Event;
77
+ } | {
78
+ type: 'resource-delete';
79
+ resource: Resource | ResourceGroup;
80
+ originalEvent: Event;
81
+ };
95
82
  /**
96
- * Custom event map for the scheduler web component
83
+ * Payload of one scheduler event — the union arm minus its discriminant.
97
84
  */
98
- export interface SchedulerEventMap {
99
- 'event-selected': CustomEvent<EventSelectedDetail>;
100
- 'event-dblclick': CustomEvent<EventSelectedDetail>;
101
- 'event-create': CustomEvent<EventCreateDetail>;
102
- 'event-update': CustomEvent<EventUpdateDetail>;
103
- 'event-delete': CustomEvent<EventDeleteDetail>;
104
- 'date-click': CustomEvent<DateClickDetail>;
105
- 'date-select': CustomEvent<DateSelectDetail>;
106
- 'view-change': CustomEvent<ViewChangeDetail>;
107
- 'selection-change': CustomEvent<SelectionChangeDetail>;
108
- }
85
+ export type EventDetail<T extends SchedulerCustomEvent['type']> = Omit<Extract<SchedulerCustomEvent, {
86
+ type: T;
87
+ }>, 'type'>;
88
+ /**
89
+ * `HTMLElementEventMap`-shaped view of the union, for `addEventListener`
90
+ * typing in consumer code.
91
+ */
92
+ export type SchedulerEventMap = {
93
+ [T in SchedulerCustomEvent['type']]: CustomEvent<EventDetail<T>>;
94
+ };
@@ -3,5 +3,7 @@ export * from './event';
3
3
  export * from './resource';
4
4
  export * from './time-slot';
5
5
  export * from './options';
6
+ export * from './messages';
7
+ export * from './permissions';
6
8
  export * from './drag-state';
7
9
  export * from './events';
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Every user-facing string the scheduler renders or announces. Consumers
3
+ * localize by passing a partial table via `options.messages`; anything not
4
+ * overridden falls back to the English default. Templates interpolate
5
+ * `{placeholder}` tokens via `formatMessage` — plain substitution, no
6
+ * pluralization rules (the only plural, slot count, uses two explicit keys).
7
+ */
8
+ export interface SchedulerMessages {
9
+ navLabel: string;
10
+ previousPeriod: string;
11
+ nextPeriod: string;
12
+ jumpToToday: string;
13
+ today: string;
14
+ switchView: string;
15
+ viewYear: string;
16
+ viewMonth: string;
17
+ viewWeek: string;
18
+ viewDay: string;
19
+ viewTimeline: string;
20
+ resourcesHeader: string;
21
+ /** Row header for the synthetic bucket holding events with no resource. */
22
+ unassignedResource: string;
23
+ /** Shown in the timeline when there are no resources AND no events at all. */
24
+ noResources: string;
25
+ /** {date} — formatted first day of the visible week */
26
+ timelineGridLabel: string;
27
+ /** {title} — resource group title */
28
+ expandGroup: string;
29
+ /** {title} — resource group title */
30
+ collapseGroup: string;
31
+ /** Toolbar at the foot of the resource column. */
32
+ addResourceBarLabel: string;
33
+ addResource: string;
34
+ addGroup: string;
35
+ /** {title} — every per-row action names its row, so N buttons aren't all "Add". */
36
+ addResourceToGroup: string;
37
+ /** {title} */
38
+ addGroupToGroup: string;
39
+ /** {title} */
40
+ removeResource: string;
41
+ /** {title} */
42
+ resourceColor: string;
43
+ /** {count} — number of hidden events */
44
+ moreEvents: string;
45
+ /** {date} — accessible name of the day popover dialog */
46
+ dayPopoverLabel: string;
47
+ /** {count} {events} — events is eventSingular/eventPlural */
48
+ dayPopoverCount: string;
49
+ eventSingular: string;
50
+ eventPlural: string;
51
+ /** Empty-day text inside the popover. */
52
+ dayPopoverEmpty: string;
53
+ /** Primary action in the popover: request an event for this day. */
54
+ newEvent: string;
55
+ /** Secondary action: drill into the day view. */
56
+ showDay: string;
57
+ closePopover: string;
58
+ /** {view} — localized view name */
59
+ viewChanged: string;
60
+ /** {title} */
61
+ eventAdded: string;
62
+ /** {title} */
63
+ eventUpdated: string;
64
+ /** {title} */
65
+ eventRemoved: string;
66
+ loadingEvents: string;
67
+ eventsLoaded: string;
68
+ /** {title} {minutes} — move-mode entry keymap announcement */
69
+ moveModeEntered: string;
70
+ /** {start} {end} {day} */
71
+ movedTo: string;
72
+ /** {resource} */
73
+ movedToResource: string;
74
+ /** {edge} {start} {end} — edge is startEdge/endEdge below */
75
+ resizedEdge: string;
76
+ startEdge: string;
77
+ endEdge: string;
78
+ moveCommitted: string;
79
+ moveCancelled: string;
80
+ /** {start} {end} {count} {slots} — slots is slotSingular/slotPlural */
81
+ selection: string;
82
+ slotSingular: string;
83
+ slotPlural: string;
84
+ /** {start} {end} */
85
+ selectionCommitted: string;
86
+ gridInstructions: string;
87
+ eventInstructions: string;
88
+ /** Read-only variants: no create/move/resize/delete promises. */
89
+ gridInstructionsReadOnly: string;
90
+ eventInstructionsReadOnly: string;
91
+ /** Announced when a command is refused by permissions. */
92
+ actionNotAllowed: string;
93
+ /** {resource} */
94
+ eventOnResource: string;
95
+ }
96
+ export declare const DEFAULT_MESSAGES: SchedulerMessages;
97
+ /**
98
+ * Interpolate `{placeholder}` tokens. Unknown tokens are left verbatim so a
99
+ * typo'd override is visible rather than silently swallowed.
100
+ */
101
+ export declare function formatMessage(template: string, params?: Record<string, string | number>): string;
102
+ /** Merge a consumer's partial override table onto the English defaults. */
103
+ export declare function resolveMessages(overrides?: Partial<SchedulerMessages>): SchedulerMessages;
@@ -1,4 +1,7 @@
1
+ import { SchedulerMessages } from './messages';
2
+ import { SchedulerPermissions } from './permissions';
1
3
  import { DayOfWeek, TimeFormat, ViewType } from './types';
4
+ import { SchedulerEvent } from './event';
2
5
  /**
3
6
  * Business hours configuration
4
7
  */
@@ -57,22 +60,24 @@ export interface SchedulerOptions {
57
60
  expandRows?: boolean;
58
61
  /** Header toolbar configuration */
59
62
  headerToolbar?: HeaderToolbar;
60
- /** Whether events can be edited */
61
- editable?: boolean;
62
- /** Whether date ranges can be selected */
63
- selectable?: boolean;
64
- /** Whether to show a mirror element during selection */
65
- selectMirror?: boolean;
66
- /** Whether event duration can be changed */
67
- eventDurationEditable?: boolean;
68
- /** Whether event start time can be changed */
69
- eventStartEditable?: boolean;
70
- /** Duration of revert animation in ms */
71
- dragRevertDuration?: number;
72
- /** Whether to scroll during drag */
73
- dragScroll?: boolean;
74
- /** Snap duration in seconds */
75
- snapDuration?: number;
63
+ /** Override any user-facing string (labels, announcements, instructions).
64
+ * Merged onto the English defaults — see SchedulerMessages. */
65
+ messages?: Partial<SchedulerMessages>;
66
+ /**
67
+ * What the user may do. `false` makes the scheduler read-only; an object gives
68
+ * per-capability control. See SchedulerPermissions — it gates AFFORDANCES and
69
+ * gestures, it is not a security boundary.
70
+ *
71
+ * Replaced the old `editable` / `selectable` / `eventStartEditable` /
72
+ * `eventDurationEditable` flags, and the never-implemented `selectMirror`,
73
+ * `dragRevertDuration`, `dragScroll` and `snapDuration`.
74
+ */
75
+ permissions?: boolean | Partial<SchedulerPermissions>;
76
+ /**
77
+ * Fill colour for events that specify none and whose resource specifies none.
78
+ * Previously a `'#3788d8'` literal duplicated across five files.
79
+ */
80
+ defaultEventColor?: string;
76
81
  /** Whether to show current time indicator */
77
82
  nowIndicator?: boolean;
78
83
  /** Whether to show week numbers */
@@ -81,7 +86,46 @@ export interface SchedulerOptions {
81
86
  weekText?: string;
82
87
  /** Maximum events to show per day (true = show "+X more" link) */
83
88
  dayMaxEvents?: boolean | number;
89
+ /**
90
+ * What the month view's "+N more" link does.
91
+ *
92
+ * - `'popover'` (default, FullCalendar's default too) — open the day popover
93
+ * listing every event on that day.
94
+ * - `'day'` — the previous behaviour: navigate to the day view.
95
+ * - a function — you handle it; nothing else happens.
96
+ */
97
+ moreLinkBehavior?: MoreLinkBehavior;
98
+ /**
99
+ * What clicking a month day CELL does, beyond emitting `date-click`.
100
+ *
101
+ * Defaults to `'none'` so the `date-click` contract is unchanged for existing
102
+ * consumers; set `'popover'` for the "click a date to see and add events"
103
+ * behaviour. Clicking the day NUMBER always drills into the day view (the
104
+ * navLinks idiom) and is deliberately a separate target: conflating the two
105
+ * would make an empty cell unable to mean "create here".
106
+ */
107
+ dayClickAction?: 'none' | 'popover';
108
+ /**
109
+ * Whether every event is expected to name a resource.
110
+ *
111
+ * Default `false`: an event with no `resourceId` renders in the timeline's
112
+ * "(No resource)" bucket row, which is the only non-lossy behaviour — the two
113
+ * alternatives the industry ships are both silent data traps (hide the event,
114
+ * or duplicate it into every lane where editing one appears to edit all).
115
+ *
116
+ * Set `true` in an app where a resource is mandatory: resource-less events are
117
+ * still bucketed and still visible, but each one is reported once via a dev
118
+ * warning so the gap surfaces during development instead of as a support
119
+ * ticket. It never hides an event, and it is not a validation error — the
120
+ * component does not own the data.
121
+ */
122
+ requireEventResource?: boolean;
84
123
  }
124
+ /** See `SchedulerOptions.moreLinkBehavior`. */
125
+ export type MoreLinkBehavior = 'popover' | 'day' | ((info: {
126
+ date: Date;
127
+ events: SchedulerEvent[];
128
+ }) => void);
85
129
  /**
86
130
  * Default options for the scheduler
87
131
  */