@mintplayer/web-components 2.5.0 → 2.8.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.
- package/a11y/index.mjs +9 -8
- package/calendar/index.mjs +1 -1
- package/calendar/src/mp-calendar.element.d.ts +19 -1
- package/checkbox/index.mjs +1 -1
- package/chunks/error-text-B45eDAt1.mjs +17 -0
- package/chunks/{form-associated-axmc5sY0.mjs → form-associated-BR-fUvZ1.mjs} +11 -26
- package/chunks/{id-D5QCG603.mjs → id-DNZVAnGC.mjs} +290 -160
- package/chunks/{mp-calendar.element-u6uS31_j.mjs → mp-calendar.element-CJ8-t-Zn.mjs} +71 -39
- package/chunks/{mp-checkbox-Ph2mMRGz.mjs → mp-checkbox-6EJwdUIn.mjs} +6 -5
- package/chunks/{mp-datatable-BwTlh9A_.mjs → mp-datatable-25O1GtvU.mjs} +1 -1
- package/chunks/mp-datetime-picker.element-D1CiLbHm.mjs +530 -0
- package/chunks/{mp-radio-BjW1HNSc.mjs → mp-radio-DvKgrTFL.mjs} +2 -2
- package/chunks/{mp-select-Ctu-v1-p.mjs → mp-select-CKX0eM5C.mjs} +5 -4
- package/chunks/{mp-timepicker.element-Bz393NDQ.mjs → mp-timepicker.element-COZEUIoE.mjs} +56 -52
- package/chunks/{mp-toggle-button-Kz6sIgBJ.mjs → mp-toggle-button-C4Loq_p4.mjs} +5 -4
- package/chunks/{overlay-controller-DPt13i8p.mjs → overlay-controller-D6agzzOI.mjs} +19 -4
- package/datatable/index.mjs +1 -1
- package/datepicker/index.mjs +2 -2
- package/datetime-picker/index.mjs +2 -431
- package/datetime-picker/src/mp-datetime-picker.element.d.ts +66 -0
- package/file-manager/index.mjs +1 -1
- package/navbar/index.mjs +1 -1
- package/otp-input/index.mjs +4 -3
- package/overlay/index.mjs +1 -1
- package/overlay/src/overlay-controller.d.ts +13 -0
- package/package.json +1 -1
- package/query-builder/index.mjs +2 -2
- package/radio/index.mjs +1 -1
- package/radio-group/index.mjs +2 -2
- package/ribbon/index.mjs +1 -1
- package/scheduler/index.mjs +2775 -1025
- package/scheduler/src/components/mp-scheduler.d.ts +454 -11
- package/scheduler/src/input/input-handler.d.ts +22 -0
- package/scheduler/src/state/scheduler-state.d.ts +10 -0
- package/scheduler/src/views/base-view.d.ts +30 -1
- package/scheduler/src/views/index.d.ts +1 -1
- package/scheduler/src/views/timeline-view.d.ts +87 -15
- package/scheduler/src/views/year-view.d.ts +11 -2
- package/scheduler-core/index.mjs +44 -41
- package/scheduler-core/src/models/event.d.ts +6 -2
- package/scheduler-core/src/models/messages.d.ts +89 -0
- package/scheduler-core/src/models/options.d.ts +46 -13
- package/scheduler-core/src/models/permissions.d.ts +35 -4
- package/scheduler-core/src/models/time-slot.d.ts +11 -6
- package/scheduler-core/src/services/date.service.d.ts +64 -10
- package/scheduler-core/src/utils/color.d.ts +19 -0
- package/select/index.mjs +1 -1
- package/timepicker/index.mjs +4 -3
- package/timepicker/src/mp-time-list.element.d.ts +44 -7
- package/timepicker/src/mp-timepicker.element.d.ts +5 -0
- package/toggle-button/index.mjs +1 -1
- package/tree-select/index.mjs +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SchedulerEvent, SchedulerEventPart, SchedulerOptions, TimeSlot } from '@mintplayer/web-components/scheduler-core';
|
|
1
|
+
import { SchedulerEvent, SchedulerEventPart, DayOfWeek, SchedulerOptions, TimeSlot } from '@mintplayer/web-components/scheduler-core';
|
|
2
2
|
import { SchedulerState } from '../state/scheduler-state';
|
|
3
3
|
/**
|
|
4
4
|
* Build the descriptive aria-label for an event block. Used by every view.
|
|
@@ -6,6 +6,12 @@ import { SchedulerState } from '../state/scheduler-state';
|
|
|
6
6
|
* the event has no resource or the caller doesn't have it (week/day views).
|
|
7
7
|
* Strings and date formatting follow options.messages / options.locale.
|
|
8
8
|
*/
|
|
9
|
+
/**
|
|
10
|
+
* `YYYY-MM-DD` in LOCAL components — the wire format `parseDayKey` round-trips
|
|
11
|
+
* without a timezone shift. Deliberately not `toISOString()`, which is UTC and
|
|
12
|
+
* names the wrong day either side of midnight for most of the world.
|
|
13
|
+
*/
|
|
14
|
+
export declare function toDayKey(d: Date): string;
|
|
9
15
|
export declare function formatEventAriaLabel(event: SchedulerEvent, resourceTitle: string | null, options: SchedulerOptions): string;
|
|
10
16
|
/**
|
|
11
17
|
* Normalised selection range — covers anchor.start through extent.end (or
|
|
@@ -52,6 +58,16 @@ export declare abstract class BaseView {
|
|
|
52
58
|
protected container: HTMLElement;
|
|
53
59
|
protected state: SchedulerState;
|
|
54
60
|
constructor(container: HTMLElement, state: SchedulerState);
|
|
61
|
+
/**
|
|
62
|
+
* The week's first day for the current options — the consumer's choice if they
|
|
63
|
+
* made one, otherwise the locale's own convention (Sunday for en-US and ja-JP,
|
|
64
|
+
* Monday across most of Europe).
|
|
65
|
+
*
|
|
66
|
+
* Resolved at the point of use rather than written back into `options`:
|
|
67
|
+
* `setOptions` merges cumulatively, so a stored derivation would freeze at the
|
|
68
|
+
* locale that produced it and quietly ignore a later locale change.
|
|
69
|
+
*/
|
|
70
|
+
protected get firstDayOfWeek(): DayOfWeek;
|
|
55
71
|
/**
|
|
56
72
|
* Update the view with new state
|
|
57
73
|
*/
|
|
@@ -113,6 +129,11 @@ export declare abstract class BaseView {
|
|
|
113
129
|
/**
|
|
114
130
|
* Helper to clear container
|
|
115
131
|
*/
|
|
132
|
+
/**
|
|
133
|
+
* Scroll offsets captured by `clearContainer`, awaiting the rAF that puts them
|
|
134
|
+
* back. Null when no restore is in flight.
|
|
135
|
+
*/
|
|
136
|
+
private pendingScroll;
|
|
116
137
|
protected clearContainer(): void;
|
|
117
138
|
/**
|
|
118
139
|
* Append the start/end resize handles for an event part. The handle strip
|
|
@@ -147,6 +168,14 @@ export declare abstract class BaseView {
|
|
|
147
168
|
cells?: string;
|
|
148
169
|
/** Grids where Shift+Arrow extends a multi-cell range (week/day). */
|
|
149
170
|
multiselectable?: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Accessible name for the grid. REQUIRED in practice: without it a screen
|
|
173
|
+
* reader announces "grid" over hundreds of unnamed cells with no indication
|
|
174
|
+
* of what it is, and two schedulers on a page are indistinguishable.
|
|
175
|
+
* A consumer's own `aria-label` on the host wins — the host has no role, so
|
|
176
|
+
* that attribute reaches nothing on its own.
|
|
177
|
+
*/
|
|
178
|
+
label?: string;
|
|
150
179
|
}): void;
|
|
151
180
|
/** aria-current="date" on every element the views styled `.today`. */
|
|
152
181
|
protected markToday(): void;
|
|
@@ -3,4 +3,4 @@ export { YearView } from './year-view';
|
|
|
3
3
|
export { MonthView } from './month-view';
|
|
4
4
|
export { WeekView } from './week-view';
|
|
5
5
|
export { DayView } from './day-view';
|
|
6
|
-
export { TimelineView } from './timeline-view';
|
|
6
|
+
export { TimelineView, type RowAction } from './timeline-view';
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import { Resource, ResourceGroup } from '@mintplayer/web-components/scheduler-core';
|
|
1
2
|
import { BaseView } from './base-view';
|
|
2
3
|
import { SchedulerState } from '../state/scheduler-state';
|
|
4
|
+
/**
|
|
5
|
+
* The actions a resource row can offer, in the order they are presented.
|
|
6
|
+
* Mirrors the `data-action` values the component's handler already switches on,
|
|
7
|
+
* so moving them into a panel changed no behaviour.
|
|
8
|
+
*/
|
|
9
|
+
export type RowAction = 'rename-resource' | 'add-resource' | 'add-group' | 'set-resource-color' | 'delete-resource';
|
|
3
10
|
/**
|
|
4
11
|
* Timeline view renderer
|
|
5
12
|
*/
|
|
@@ -48,6 +55,42 @@ export declare class TimelineView extends BaseView {
|
|
|
48
55
|
* unassigned, so a fully-assigned timeline shows no phantom row.
|
|
49
56
|
*/
|
|
50
57
|
private hasUnassignedRow;
|
|
58
|
+
/** Narrowest useful column; below this the titles are gone anyway. */
|
|
59
|
+
private static readonly MIN_COLUMN_PX;
|
|
60
|
+
/** The AG-Grid guard: the frozen column may never leave less than this. */
|
|
61
|
+
private static readonly MIN_GRID_PX;
|
|
62
|
+
private columnDrag;
|
|
63
|
+
private boundColumnDragMove;
|
|
64
|
+
private boundColumnDragEnd;
|
|
65
|
+
/**
|
|
66
|
+
* The WAI-ARIA window-splitter on the resource column's right edge — the
|
|
67
|
+
* same pattern as the repo's splitter. It writes
|
|
68
|
+
* `--scheduler-resource-column-width` on the scroll container, which is the
|
|
69
|
+
* exact channel the consumer configures, so their own value stays the
|
|
70
|
+
* initial and every rule reading the custom property follows for free. The
|
|
71
|
+
* inline style survives view rebuilds AND view switches (clearContainer
|
|
72
|
+
* strips classes and ARIA, not inline style), which is what makes the
|
|
73
|
+
* user's chosen width sticky.
|
|
74
|
+
*
|
|
75
|
+
* On its placement (audit M11): it lives inside the corner columnheader,
|
|
76
|
+
* which IS inside the `role="grid"` subtree — an earlier comment here claimed
|
|
77
|
+
* the opposite. That is fine, but not for the reason the old comment gave.
|
|
78
|
+
* `columnheader` places no restriction on its own descendants, so the
|
|
79
|
+
* separator breaks no owned-children rule; and it is a deliberate second Tab
|
|
80
|
+
* stop rather than a trap, because `getFocusedKind()` matches on the cell and
|
|
81
|
+
* event classes and returns `'other'` here, so the grid's arrow handling
|
|
82
|
+
* declines the key and only this element's own listener resizes. Moving it out
|
|
83
|
+
* of the grid would mean rebuilding the containing block it positions against
|
|
84
|
+
* — the sticky corner cell — for no accessibility gain.
|
|
85
|
+
*/
|
|
86
|
+
private createColumnResizer;
|
|
87
|
+
private currentColumnWidth;
|
|
88
|
+
private maxColumnWidth;
|
|
89
|
+
private applyColumnWidth;
|
|
90
|
+
/** aria-valuenow as a percentage of the scroller, per the splitter pattern. */
|
|
91
|
+
private updateResizerValue;
|
|
92
|
+
private onColumnDragMove;
|
|
93
|
+
private onColumnDragEnd;
|
|
51
94
|
/** True when the capability is granted for the whole scheduler. */
|
|
52
95
|
private can;
|
|
53
96
|
/**
|
|
@@ -65,23 +108,33 @@ export declare class TimelineView extends BaseView {
|
|
|
65
108
|
* it entirely — `aria-level` is invalid on these roles, so nesting is conveyed
|
|
66
109
|
* by the name and the indent, not by an attribute axe flags.
|
|
67
110
|
*/
|
|
68
|
-
private appendResourceActions;
|
|
69
111
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
112
|
+
* Which actions this row offers. One list, consulted twice: here to decide
|
|
113
|
+
* whether the row deserves a trigger at all, and by the component to build the
|
|
114
|
+
* panel's contents. Keeping it in one place is what stops the button from
|
|
115
|
+
* promising a menu that turns out to be empty.
|
|
72
116
|
*/
|
|
73
|
-
|
|
117
|
+
rowActions(item: Resource | ResourceGroup): RowAction[];
|
|
74
118
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
119
|
+
* The row's actions trigger — one 24px button where four controls used to sit.
|
|
120
|
+
*
|
|
121
|
+
* Those four (add resource, add subgroup, a colour input, delete) took 102px of
|
|
122
|
+
* a 200px column, leaving roughly 50px for the resource title: five characters,
|
|
123
|
+
* silently ellipsised. #395 shipped them inline and #396's D12.1c predicted
|
|
124
|
+
* this exact complaint; §11.2 named the trigger for revisiting it. The
|
|
125
|
+
* behaviour is unchanged — every action keeps its `data-action`, its permission
|
|
126
|
+
* gate and its emitted event — only the layout is reverted.
|
|
79
127
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
128
|
+
* The button doubles as the row's colour chip. A group's `color` is stored and
|
|
129
|
+
* editable but was painted nowhere in this column, so this is the first place
|
|
130
|
+
* it becomes visible where it is set.
|
|
131
|
+
*
|
|
132
|
+
* `data-action` + `data-resource-id` are load-bearing, not decoration: the
|
|
133
|
+
* timeline rebuilds its DOM on every state change, and
|
|
134
|
+
* captureActionFocus/restoreActionFocus restores focus by exactly that key.
|
|
135
|
+
* Omitting it reproduces the expand toggle's bug, where focus falls to <body>.
|
|
83
136
|
*/
|
|
84
|
-
private
|
|
137
|
+
private appendResourceActions;
|
|
85
138
|
/**
|
|
86
139
|
* Root-level "Add resource" / "Add group" bar, pinned to the bottom of the
|
|
87
140
|
* frozen resource column (the spreadsheet/Jira idiom: creation lives at the
|
|
@@ -96,9 +149,12 @@ export declare class TimelineView extends BaseView {
|
|
|
96
149
|
* The "(No resource)" bucket row.
|
|
97
150
|
*
|
|
98
151
|
* Structurally identical to a resource row so keyboard nav, roving tabindex and
|
|
99
|
-
* the grid ARIA chain all treat it as one more row — but its slots carry
|
|
100
|
-
* `data-resource-id`, so a
|
|
101
|
-
*
|
|
152
|
+
* the grid ARIA chain all treat it as one more row — but its slots carry
|
|
153
|
+
* `data-unassigned` instead of a `data-resource-id`, so a drag addressing this
|
|
154
|
+
* row resolves to the tri-state `resourceId: null` ("the bucket") rather than
|
|
155
|
+
* `undefined` ("no resource axis"). An absent attribute could not carry that
|
|
156
|
+
* distinction — it would read exactly like a week-view slot, and a drop here
|
|
157
|
+
* could never mean "unassign".
|
|
102
158
|
*/
|
|
103
159
|
private createUnassignedRow;
|
|
104
160
|
private renderEvents;
|
|
@@ -113,6 +169,22 @@ export declare class TimelineView extends BaseView {
|
|
|
113
169
|
* view while week/day showed it.
|
|
114
170
|
*/
|
|
115
171
|
private renderPreviewEvent;
|
|
172
|
+
/**
|
|
173
|
+
* Which row a drag/preview is currently addressing.
|
|
174
|
+
*
|
|
175
|
+
* Precedence: the preview's own row (a MOVE tracks the pointer's row; a
|
|
176
|
+
* move-mode Up/Down nudge writes it too — `null` meaning the bucket row) →
|
|
177
|
+
* the dragged event's own row (a resize never changes rows, and its preview
|
|
178
|
+
* deliberately carries none) → the row the gesture is happening in (a CREATE
|
|
179
|
+
* has no source event; without this fallback a create-drag showed no
|
|
180
|
+
* feedback at all).
|
|
181
|
+
*
|
|
182
|
+
* The dragged event is resolved from the NORMALIZED store, not
|
|
183
|
+
* `resource.events` — that nested array stopped being a live mirror when the
|
|
184
|
+
* model was normalized, so the old lookup found nothing for any event
|
|
185
|
+
* supplied through the `events` input.
|
|
186
|
+
*/
|
|
187
|
+
private previewRowKey;
|
|
116
188
|
update(state: SchedulerState): void;
|
|
117
189
|
private optionsRequireRerender;
|
|
118
190
|
private updateGreyedSlots;
|
|
@@ -10,9 +10,11 @@ export declare class YearView extends BaseView {
|
|
|
10
10
|
/**
|
|
11
11
|
* Build a `YYYY-MM` key from a Date, which is the unit of focus on year
|
|
12
12
|
* view (PRD scheduler-controlled-selection §5.2 — year cells are months,
|
|
13
|
-
* not days).
|
|
13
|
+
* not days). Public because the month card's element id
|
|
14
|
+
* (`scheduler-cell-y-{key}`) is also the anchor the day popover hangs off
|
|
15
|
+
* in this view.
|
|
14
16
|
*/
|
|
15
|
-
|
|
17
|
+
static monthKey(d: Date): string;
|
|
16
18
|
private createMonthCard;
|
|
17
19
|
/**
|
|
18
20
|
* Apply roving tabindex based on `state.focusedDate`'s month. Year-view's
|
|
@@ -21,5 +23,12 @@ export declare class YearView extends BaseView {
|
|
|
21
23
|
*/
|
|
22
24
|
private updateMonthCardFocus;
|
|
23
25
|
update(state: SchedulerState): void;
|
|
26
|
+
/**
|
|
27
|
+
* The check the other three views already had, and this one did not: without it
|
|
28
|
+
* a runtime `locale` or `firstDayOfWeek` change left all twelve mini-calendars
|
|
29
|
+
* frozen at the previous locale, so a language switch appeared to do nothing
|
|
30
|
+
* while the year view was showing.
|
|
31
|
+
*/
|
|
32
|
+
private optionsRequireRerender;
|
|
24
33
|
destroy(): void;
|
|
25
34
|
}
|
package/scheduler-core/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { D as
|
|
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-
|
|
3
|
-
class
|
|
1
|
+
import { D as C, d as $ } from "../chunks/id-DNZVAnGC.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, x as ut, y as ft, z as mt } from "../chunks/id-DNZVAnGC.mjs";
|
|
3
|
+
class x {
|
|
4
4
|
/**
|
|
5
5
|
* Calculate position for an event part in week/day view
|
|
6
6
|
*/
|
|
7
7
|
calculateWeekPosition(t, e, s, n, i, l = {}) {
|
|
8
|
-
const c = {
|
|
8
|
+
const c = { ...C, ...l };
|
|
9
9
|
new Date(t.start).setHours(0, 0, 0, 0);
|
|
10
|
-
const a =
|
|
10
|
+
const a = $.getSecondsFromMidnight(t.start), u = $.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, v = 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
13
|
left: b,
|
|
14
14
|
width: T,
|
|
15
|
-
height:
|
|
15
|
+
height: v,
|
|
16
16
|
zIndex: e + 1
|
|
17
17
|
};
|
|
18
18
|
}
|
|
@@ -20,7 +20,7 @@ class w {
|
|
|
20
20
|
* Calculate position for an event in timeline view
|
|
21
21
|
*/
|
|
22
22
|
calculateTimelinePosition(t, e, s, n, i, l = {}) {
|
|
23
|
-
({
|
|
23
|
+
({ ...C, ...l });
|
|
24
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,
|
|
@@ -82,12 +82,12 @@ class w {
|
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
const I = new
|
|
85
|
+
const I = new x();
|
|
86
86
|
function P(o, t) {
|
|
87
87
|
const e = Object.entries(t).map(([s, n]) => `[data-${s}="${n}"]`).join("");
|
|
88
88
|
return o.querySelector(e);
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function z(o) {
|
|
91
91
|
const t = o.dataset, e = {};
|
|
92
92
|
for (const s in t) {
|
|
93
93
|
const n = t[s];
|
|
@@ -95,23 +95,23 @@ function D(o) {
|
|
|
95
95
|
}
|
|
96
96
|
return e;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function D(o, t) {
|
|
99
99
|
return o.closest(`[data-${t}]`);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function L(o) {
|
|
102
102
|
return {
|
|
103
103
|
top: o.scrollTop,
|
|
104
104
|
left: o.scrollLeft
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function M(o, t, e = "smooth") {
|
|
108
108
|
const s = o.getBoundingClientRect(), i = t.getBoundingClientRect().top - s.top + o.scrollTop;
|
|
109
109
|
o.scrollTo({
|
|
110
110
|
top: i,
|
|
111
111
|
behavior: e
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function O(o, t) {
|
|
115
115
|
const e = o.getBoundingClientRect(), s = t ? t.getBoundingClientRect() : { top: 0, left: 0, bottom: window.innerHeight, right: window.innerWidth };
|
|
116
116
|
return e.top >= s.top && e.left >= s.left && e.bottom <= s.bottom && e.right <= s.right;
|
|
117
117
|
}
|
|
@@ -122,10 +122,10 @@ function B(o, t) {
|
|
|
122
122
|
y: n - e.top
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function W(o, t, e) {
|
|
126
126
|
o.style.setProperty(`--${t}`, e);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function A(o, t) {
|
|
129
129
|
return getComputedStyle(o).getPropertyValue(`--${t}`).trim();
|
|
130
130
|
}
|
|
131
131
|
function F(o, ...t) {
|
|
@@ -141,41 +141,44 @@ export {
|
|
|
141
141
|
U as DEFAULT_COLORS,
|
|
142
142
|
V as DEFAULT_EVENT_COLOR,
|
|
143
143
|
j as DEFAULT_MESSAGES,
|
|
144
|
-
|
|
144
|
+
C as DEFAULT_OPTIONS,
|
|
145
145
|
G as DEFAULT_PERMISSIONS,
|
|
146
146
|
X as DateService,
|
|
147
|
-
|
|
147
|
+
x as PositionService,
|
|
148
148
|
Y as ResourceService,
|
|
149
149
|
q as TimelineService,
|
|
150
150
|
J as addAlpha,
|
|
151
151
|
F as addClasses,
|
|
152
|
-
K as
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
Z as
|
|
157
|
-
tt as
|
|
158
|
-
et as
|
|
159
|
-
ot as
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
nt as
|
|
163
|
-
|
|
152
|
+
K as contrastRatioWith,
|
|
153
|
+
Q as darkenColor,
|
|
154
|
+
$ as dateService,
|
|
155
|
+
D as findClosestWithData,
|
|
156
|
+
Z as formatMessage,
|
|
157
|
+
tt as generateEventId,
|
|
158
|
+
et as generateGroupId,
|
|
159
|
+
ot as generateId,
|
|
160
|
+
st as generateResourceId,
|
|
161
|
+
A as getCSSVariable,
|
|
162
|
+
nt as getColorByIndex,
|
|
163
|
+
it as getContrastColor,
|
|
164
|
+
z as getDataAttributes,
|
|
164
165
|
P as getElementByData,
|
|
166
|
+
ct as getReadableTextColor,
|
|
165
167
|
B as getRelativePosition,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
L as getScrollPosition,
|
|
169
|
+
O as isInViewport,
|
|
170
|
+
rt as isResource,
|
|
171
|
+
at as isResourceGroup,
|
|
172
|
+
lt as lightenColor,
|
|
171
173
|
I as positionService,
|
|
172
174
|
_ as removeClasses,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
175
|
+
dt as resolveCapability,
|
|
176
|
+
gt as resolveEventColor,
|
|
177
|
+
ht as resolveMessages,
|
|
178
|
+
ut as resolveResizeEdge,
|
|
179
|
+
ft as resourceService,
|
|
180
|
+
M as scrollToTime,
|
|
181
|
+
W as setCSSVariable,
|
|
182
|
+
mt as timelineService,
|
|
180
183
|
k as toggleClass
|
|
181
184
|
};
|
|
@@ -70,8 +70,12 @@ export interface PreviewEvent {
|
|
|
70
70
|
start: Date;
|
|
71
71
|
/** End of the preview */
|
|
72
72
|
end: Date;
|
|
73
|
-
/**
|
|
74
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Row the preview belongs to. Same tri-state as `TimeSlot.resourceId`:
|
|
75
|
+
* `undefined` = no row information (no resource axis, or a resize, which
|
|
76
|
+
* never changes rows), `null` = the unassigned bucket row.
|
|
77
|
+
*/
|
|
78
|
+
resourceId?: string | null;
|
|
75
79
|
}
|
|
76
80
|
/**
|
|
77
81
|
* A track/rail containing non-overlapping events
|
|
@@ -24,6 +24,14 @@ export interface SchedulerMessages {
|
|
|
24
24
|
noResources: string;
|
|
25
25
|
/** {date} — formatted first day of the visible week */
|
|
26
26
|
timelineGridLabel: string;
|
|
27
|
+
/** {date} — the visible period. Accessible name of the week grid. */
|
|
28
|
+
weekGridLabel: string;
|
|
29
|
+
/** {date} — the visible day. */
|
|
30
|
+
dayGridLabel: string;
|
|
31
|
+
/** {date} — the visible month. */
|
|
32
|
+
monthGridLabel: string;
|
|
33
|
+
/** {date} — the visible year. */
|
|
34
|
+
yearGridLabel: string;
|
|
27
35
|
/** {title} — resource group title */
|
|
28
36
|
expandGroup: string;
|
|
29
37
|
/** {title} — resource group title */
|
|
@@ -32,6 +40,10 @@ export interface SchedulerMessages {
|
|
|
32
40
|
addResourceBarLabel: string;
|
|
33
41
|
addResource: string;
|
|
34
42
|
addGroup: string;
|
|
43
|
+
/** {title} — accessible name of the row's actions button. */
|
|
44
|
+
rowMenuLabel: string;
|
|
45
|
+
/** Accessible name of the row-actions dialog itself. {title} — the row. */
|
|
46
|
+
rowMenuDialogLabel: string;
|
|
35
47
|
/** {title} — every per-row action names its row, so N buttons aren't all "Add". */
|
|
36
48
|
addResourceToGroup: string;
|
|
37
49
|
/** {title} */
|
|
@@ -40,6 +52,14 @@ export interface SchedulerMessages {
|
|
|
40
52
|
removeResource: string;
|
|
41
53
|
/** {title} */
|
|
42
54
|
resourceColor: string;
|
|
55
|
+
/** Accessible name of the resource-column resize separator. */
|
|
56
|
+
resizeResourceColumn: string;
|
|
57
|
+
/** {title} — the row-panel entry that starts a rename. */
|
|
58
|
+
renameResource: string;
|
|
59
|
+
/** {title} — accessible name of the inline rename input. */
|
|
60
|
+
renameResourceLabel: string;
|
|
61
|
+
/** {from} {to} — announced after a rename commits. */
|
|
62
|
+
resourceRenamed: string;
|
|
43
63
|
/** {count} — number of hidden events */
|
|
44
64
|
moreEvents: string;
|
|
45
65
|
/** {date} — accessible name of the day popover dialog */
|
|
@@ -54,7 +74,53 @@ export interface SchedulerMessages {
|
|
|
54
74
|
newEvent: string;
|
|
55
75
|
/** Secondary action: drill into the day view. */
|
|
56
76
|
showDay: string;
|
|
77
|
+
/** Secondary action of the month-scoped popover (year view): drill into the month. */
|
|
78
|
+
showMonth: string;
|
|
57
79
|
closePopover: string;
|
|
80
|
+
/** Label of the popover's resource picker on the create action. */
|
|
81
|
+
newEventResource: string;
|
|
82
|
+
/** {title} — accessible name of a per-event delete button. */
|
|
83
|
+
deleteEventLabel: string;
|
|
84
|
+
/** {title} — accessible name of the editor dialog. */
|
|
85
|
+
eventEditorLabel: string;
|
|
86
|
+
editorTitleLabel: string;
|
|
87
|
+
editorStartLabel: string;
|
|
88
|
+
editorEndLabel: string;
|
|
89
|
+
editorColorLabel: string;
|
|
90
|
+
/**
|
|
91
|
+
* Checkbox: keep the event's colour derived from its resource instead of
|
|
92
|
+
* pinning one on the event. Checked whenever the event carries no `color`,
|
|
93
|
+
* which is the state the whole precedence chain assumes.
|
|
94
|
+
*/
|
|
95
|
+
editorInheritColor: string;
|
|
96
|
+
editorSave: string;
|
|
97
|
+
editorCancel: string;
|
|
98
|
+
editorDelete: string;
|
|
99
|
+
/** Inline error + announcement when the edited range is invalid. */
|
|
100
|
+
editorInvalidRange: string;
|
|
101
|
+
/** Inline error + announcement when the title is emptied. */
|
|
102
|
+
editorTitleRequired: string;
|
|
103
|
+
/**
|
|
104
|
+
* {end} — announced when a picked end time was pulled forward to the
|
|
105
|
+
* earliest the grid allows. The correction happens on the field the user
|
|
106
|
+
* just edited, so it must be spoken: silently changing a value the user
|
|
107
|
+
* chose, without saying so, is the failure mode this message exists to
|
|
108
|
+
* avoid (D12.12).
|
|
109
|
+
*/
|
|
110
|
+
editorEndClamped: string;
|
|
111
|
+
/**
|
|
112
|
+
* {start} — the mirror of `editorEndClamped`, announced when a start change
|
|
113
|
+
* is a RESIZE rather than a move (the user may resize but not move, D12.13)
|
|
114
|
+
* and the picked start was pushed back to the latest the grid allows.
|
|
115
|
+
*/
|
|
116
|
+
editorStartClamped: string;
|
|
117
|
+
/**
|
|
118
|
+
* {month} {count} {events} — accessible name of a year-view month card. The
|
|
119
|
+
* event count is the text equivalent of the colour-only `.has-events` dots
|
|
120
|
+
* (WCAG 1.4.1): without it a screen-reader user cannot tell a busy month
|
|
121
|
+
* from an empty one.
|
|
122
|
+
*/
|
|
123
|
+
yearMonthCardLabel: string;
|
|
58
124
|
/** {view} — localized view name */
|
|
59
125
|
viewChanged: string;
|
|
60
126
|
/** {title} */
|
|
@@ -67,6 +133,12 @@ export interface SchedulerMessages {
|
|
|
67
133
|
eventsLoaded: string;
|
|
68
134
|
/** {title} {minutes} — move-mode entry keymap announcement */
|
|
69
135
|
moveModeEntered: string;
|
|
136
|
+
/**
|
|
137
|
+
* {title} {minutes} — the timeline's move-mode entry announcement. Its own
|
|
138
|
+
* key because the generic one promises "arrow keys nudge by N minutes",
|
|
139
|
+
* which is wrong there: on the timeline Up/Down changes the resource.
|
|
140
|
+
*/
|
|
141
|
+
moveModeEnteredTimeline: string;
|
|
70
142
|
/** {start} {end} {day} */
|
|
71
143
|
movedTo: string;
|
|
72
144
|
/** {resource} */
|
|
@@ -83,10 +155,27 @@ export interface SchedulerMessages {
|
|
|
83
155
|
slotPlural: string;
|
|
84
156
|
/** {start} {end} */
|
|
85
157
|
selectionCommitted: string;
|
|
158
|
+
/**
|
|
159
|
+
* {date} — accessible name of the day-number drill-down. The visible text is
|
|
160
|
+
* a bare number, which says nothing about what activating it does.
|
|
161
|
+
*/
|
|
162
|
+
openDayView: string;
|
|
163
|
+
/** Week, day and timeline — the views whose focus unit is a time slot. */
|
|
86
164
|
gridInstructions: string;
|
|
165
|
+
/**
|
|
166
|
+
* Month and year keymaps differ enough that the general string was wrong
|
|
167
|
+
* rather than merely vague: in year, Enter drills into the month instead of
|
|
168
|
+
* creating anything, and in both views Space is the only route to the
|
|
169
|
+
* popover — the one place a keyboard user gets day-level detail.
|
|
170
|
+
*/
|
|
171
|
+
gridInstructionsMonth: string;
|
|
172
|
+
gridInstructionsYear: string;
|
|
87
173
|
eventInstructions: string;
|
|
174
|
+
/** The eventInstructions variant used while the built-in editor is enabled. */
|
|
175
|
+
eventInstructionsWithEditor: string;
|
|
88
176
|
/** Read-only variants: no create/move/resize/delete promises. */
|
|
89
177
|
gridInstructionsReadOnly: string;
|
|
178
|
+
gridInstructionsMonthReadOnly: string;
|
|
90
179
|
eventInstructionsReadOnly: string;
|
|
91
180
|
/** Announced when a command is refused by permissions. */
|
|
92
181
|
actionNotAllowed: string;
|
|
@@ -32,9 +32,20 @@ export interface SchedulerOptions {
|
|
|
32
32
|
initialView?: ViewType;
|
|
33
33
|
/** Initial date to display */
|
|
34
34
|
initialDate?: Date;
|
|
35
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Locale for date and time formatting (e.g. 'nl-BE').
|
|
37
|
+
*
|
|
38
|
+
* Leave it unset and the browser's own locale is used — every formatter here
|
|
39
|
+
* passes the value straight to `Intl`, which resolves `undefined` to the
|
|
40
|
+
* runtime default. Set it only to override the user's browser.
|
|
41
|
+
*/
|
|
36
42
|
locale?: string;
|
|
37
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* First day of the week (0 = Sunday, 1 = Monday).
|
|
45
|
+
*
|
|
46
|
+
* Unset means "derive from the locale" — Sunday for en-US and ja-JP, Monday
|
|
47
|
+
* for most of Europe. Set it to pin the week start regardless of locale.
|
|
48
|
+
*/
|
|
38
49
|
firstDayOfWeek?: DayOfWeek;
|
|
39
50
|
/** Timezone identifier (e.g., 'America/New_York') */
|
|
40
51
|
timeZone?: string;
|
|
@@ -80,10 +91,6 @@ export interface SchedulerOptions {
|
|
|
80
91
|
defaultEventColor?: string;
|
|
81
92
|
/** Whether to show current time indicator */
|
|
82
93
|
nowIndicator?: boolean;
|
|
83
|
-
/** Whether to show week numbers */
|
|
84
|
-
weekNumbers?: boolean;
|
|
85
|
-
/** Text to display before week number */
|
|
86
|
-
weekText?: string;
|
|
87
94
|
/** Maximum events to show per day (true = show "+X more" link) */
|
|
88
95
|
dayMaxEvents?: boolean | number;
|
|
89
96
|
/**
|
|
@@ -96,15 +103,31 @@ export interface SchedulerOptions {
|
|
|
96
103
|
*/
|
|
97
104
|
moreLinkBehavior?: MoreLinkBehavior;
|
|
98
105
|
/**
|
|
99
|
-
* What clicking a
|
|
106
|
+
* What clicking a day CELL does (month view, and year-view mini-days),
|
|
107
|
+
* beyond emitting `date-click`.
|
|
100
108
|
*
|
|
101
|
-
* Defaults to `'
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
109
|
+
* Defaults to `'popover'` — click a date to see and add its events, which
|
|
110
|
+
* is what the surface exists for. `date-click` still emits FIRST,
|
|
111
|
+
* unconditionally, so a consumer's own handler keeps working; set `'none'`
|
|
112
|
+
* to keep the click purely an event for the consumer. Clicking the day
|
|
113
|
+
* NUMBER in month view always drills into the day view (the navLinks idiom)
|
|
114
|
+
* and is deliberately a separate target: conflating the two would make an
|
|
115
|
+
* empty cell unable to mean "create here".
|
|
106
116
|
*/
|
|
107
117
|
dayClickAction?: 'none' | 'popover';
|
|
118
|
+
/**
|
|
119
|
+
* The built-in event editor: a popover anchored to the event with title,
|
|
120
|
+
* start/end and colour fields plus Save / Delete / Cancel, opened by
|
|
121
|
+
* double-click (double-tap), right-click, or F2 on the selected event.
|
|
122
|
+
*
|
|
123
|
+
* Default `true`. It emits the SAME requests every other surface emits —
|
|
124
|
+
* Save is an `event-update`, Delete an `event-delete` — so a consumer's
|
|
125
|
+
* handlers keep working unchanged, and it doubles as the single-pointer
|
|
126
|
+
* non-drag path to change an event's times (WCAG 2.5.7). Set `false` when
|
|
127
|
+
* the app ships its own editor; `event-dblclick` keeps firing either way.
|
|
128
|
+
* Also exposed as the `event-editor` attribute / `eventEditor` property.
|
|
129
|
+
*/
|
|
130
|
+
eventEditor?: boolean;
|
|
108
131
|
/**
|
|
109
132
|
* Whether every event is expected to name a resource.
|
|
110
133
|
*
|
|
@@ -129,4 +152,14 @@ export type MoreLinkBehavior = 'popover' | 'day' | ((info: {
|
|
|
129
152
|
/**
|
|
130
153
|
* Default options for the scheduler
|
|
131
154
|
*/
|
|
132
|
-
|
|
155
|
+
/**
|
|
156
|
+
* The defaults table.
|
|
157
|
+
*
|
|
158
|
+
* `locale`, `timeFormat` and `firstDayOfWeek` are deliberately ABSENT rather than
|
|
159
|
+
* guessed. A default of `'en-US'` is not a neutral fallback — it is an
|
|
160
|
+
* instruction to `Intl` to render US English, which is why a Dutch browser used
|
|
161
|
+
* to show "Mon, Oct 27" instead of "ma 27 okt". Undefined means "ask the
|
|
162
|
+
* platform", and every consumer of these three resolves it that way.
|
|
163
|
+
*/
|
|
164
|
+
export type SchedulerDefaultOptions = Required<Omit<SchedulerOptions, 'locale' | 'timeFormat' | 'firstDayOfWeek'>> & Pick<SchedulerOptions, 'locale' | 'timeFormat' | 'firstDayOfWeek'>;
|
|
165
|
+
export declare const DEFAULT_OPTIONS: SchedulerDefaultOptions;
|