@mintplayer/web-components 2.2.0 → 2.4.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 +26 -2
- package/a11y/src/dismiss-stack.d.ts +25 -0
- package/a11y/src/error-text.d.ts +41 -0
- package/a11y/src/focus-restore.d.ts +116 -0
- package/a11y/src/focus-trap.d.ts +69 -0
- package/a11y/src/form-associated.d.ts +48 -0
- package/a11y/src/host-aria.d.ts +154 -0
- package/a11y/src/index.d.ts +16 -0
- package/a11y/src/inert-regions.d.ts +52 -0
- package/a11y/src/live-announcer.d.ts +8 -0
- package/a11y/src/roving-focus.d.ts +118 -0
- package/a11y/src/testing/expect-idref-resolves.d.ts +31 -0
- package/a11y/src/testing/index.d.ts +1 -0
- package/accordion/index.mjs +180 -174
- package/accordion/src/components/mp-accordion.d.ts +18 -13
- package/calendar/index.mjs +1 -1
- package/calendar/src/mp-calendar.element.d.ts +2 -0
- package/carousel/index.mjs +211 -164
- package/carousel/src/components/mp-carousel.d.ts +1 -0
- package/checkbox/index.mjs +1 -1
- package/checkbox/src/components/mp-checkbox.d.ts +59 -1
- package/chunks/color-CpFtrIoX.mjs +899 -0
- package/chunks/focus-restore-DxuP1Oe2.mjs +94 -0
- package/chunks/focus-trap-DTOLJ5bb.mjs +121 -0
- package/chunks/form-associated-axmc5sY0.mjs +58 -0
- package/chunks/host-aria-WSGs7SPQ.mjs +152 -0
- package/chunks/inert-regions-DXCnn1LN.mjs +48 -0
- package/chunks/invalid-feedback.styles-he0JYrJm.mjs +11 -0
- package/chunks/{live-announcer-CZDTKulf.mjs → live-announcer-Bi0orG4n.mjs} +9 -9
- package/chunks/{mp-calendar.element-UC68iDbi.mjs → mp-calendar.element-u6uS31_j.mjs} +136 -105
- package/chunks/mp-checkbox-Ph2mMRGz.mjs +312 -0
- package/chunks/{mp-datatable-Bfw0KGkV.mjs → mp-datatable-BwTlh9A_.mjs} +265 -103
- package/chunks/{mp-pagination-BGxsawFL.mjs → mp-pagination-Dea75mD4.mjs} +25 -22
- package/chunks/mp-radio-BjW1HNSc.mjs +300 -0
- package/chunks/{mp-select-BDS1-YGn.mjs → mp-select-Ctu-v1-p.mjs} +163 -40
- package/chunks/{mp-splitter-C8cGCmac.mjs → mp-splitter-LszuRDbR.mjs} +53 -46
- package/chunks/{mp-tab-page-D1b4x-y2.mjs → mp-tab-page-CaCzX1ym.mjs} +46 -45
- package/chunks/{mp-timepicker.element-BwEiwX92.mjs → mp-timepicker.element-Bz393NDQ.mjs} +93 -86
- package/chunks/{mp-toggle-button-dLZNDUVz.mjs → mp-toggle-button-Kz6sIgBJ.mjs} +131 -37
- package/chunks/{mp-treeview-C48F63xb.mjs → mp-treeview-tkWu28iF.mjs} +67 -43
- package/chunks/overlay-controller-DPt13i8p.mjs +314 -0
- package/chunks/roving-focus-CrL9982a.mjs +129 -0
- package/code-snippet/index.mjs +21 -13
- package/code-snippet/src/mp-code-snippet.element.d.ts +6 -0
- package/datatable/index.mjs +1 -1
- package/datatable/src/components/mp-datatable.d.ts +50 -0
- package/datatable/src/types/index.d.ts +2 -0
- package/datatable/src/types/labels.d.ts +30 -0
- package/datepicker/index.mjs +45 -22
- package/datepicker/src/mp-datepicker.element.d.ts +30 -0
- package/datetime-picker/index.mjs +15 -9
- package/dock/index.mjs +365 -209
- package/dock/src/components/mint-dock-manager.element.d.ts +63 -3
- package/dropdown-menu/index.mjs +135 -90
- package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +12 -3
- package/file-manager/index.mjs +279 -214
- package/file-manager/src/components/mp-file-manager.d.ts +22 -0
- package/file-manager/src/types/messages.d.ts +9 -0
- package/multi-range/index.mjs +26 -10
- package/multi-range/src/mint-multi-range.element.d.ts +7 -0
- package/navbar/index.mjs +53 -39
- package/navbar/src/components/mp-navbar.d.ts +1 -0
- package/otp-input/index.mjs +82 -48
- package/otp-input/src/mint-otp-input.element.d.ts +31 -3
- package/overlay/index.mjs +2 -258
- package/overlay/src/overlay-controller.d.ts +64 -4
- package/package.json +9 -1
- package/pagination/index.mjs +1 -1
- package/query-builder/index.mjs +117 -87
- package/query-builder/src/model/messages.d.ts +9 -0
- package/radio/index.mjs +2 -160
- package/radio/src/components/mp-radio.d.ts +58 -3
- package/radio-group/index.d.ts +1 -0
- package/radio-group/index.mjs +145 -0
- package/radio-group/src/components/mp-radio-group.d.ts +52 -0
- package/radio-group/src/index.d.ts +1 -0
- package/radio-group/src/styles/radio-group.styles.d.ts +2 -0
- package/ribbon/index.mjs +316 -304
- package/ribbon/src/mp-ribbon.element.d.ts +16 -0
- package/scheduler/index.mjs +892 -493
- package/scheduler/src/components/mp-scheduler.d.ts +30 -0
- package/scheduler/src/input/input-handler.d.ts +2 -0
- package/scheduler/src/views/base-view.d.ts +43 -6
- package/scheduler/src/views/timeline-view.d.ts +6 -0
- package/scheduler-core/index.mjs +73 -70
- package/scheduler-core/src/models/index.d.ts +1 -0
- package/scheduler-core/src/models/messages.d.ts +69 -0
- package/scheduler-core/src/models/options.d.ts +4 -0
- package/select/index.mjs +1 -1
- package/select/src/components/mp-select.d.ts +60 -3
- package/shell/index.mjs +142 -31
- package/shell/src/components/mp-shell.d.ts +1 -0
- package/signature-pad/index.d.ts +1 -0
- package/signature-pad/index.mjs +230 -0
- package/signature-pad/src/index.d.ts +2 -0
- package/signature-pad/src/mp-signature-pad.element.d.ts +143 -0
- package/signature-pad/src/mp-signature-pad.element.template.d.ts +2 -0
- package/signature-pad/src/types/signature.d.ts +12 -0
- package/splitter/index.mjs +1 -1
- package/splitter/src/components/mp-splitter.d.ts +7 -0
- package/tab-control/index.mjs +1 -1
- package/tile-manager/index.mjs +110 -93
- package/timeline/index.mjs +138 -54
- package/timeline/src/components/mp-timeline.d.ts +15 -0
- package/timepicker/index.mjs +1 -1
- package/timepicker/src/mp-time-list.element.d.ts +13 -4
- package/timepicker/src/mp-timepicker.element.d.ts +29 -0
- package/toggle-button/index.mjs +1 -1
- package/toggle-button/src/components/mp-toggle-button.d.ts +32 -1
- package/tree-select/index.mjs +233 -121
- package/tree-select/src/components/mp-tree-select.d.ts +37 -0
- package/treeview/index.mjs +1 -1
- package/treeview/src/components/mp-treeview.d.ts +10 -1
- package/chunks/color-CyamnJnn.mjs +0 -847
- package/chunks/mp-checkbox-BokLL7BS.mjs +0 -211
|
@@ -54,6 +54,8 @@ export declare class MpScheduler extends LitElement {
|
|
|
54
54
|
today(): void;
|
|
55
55
|
gotoDate(date: Date): void;
|
|
56
56
|
changeView(view: ViewType): void;
|
|
57
|
+
/** Localized display name of a view (also the view-switcher button text). */
|
|
58
|
+
private viewLabel;
|
|
57
59
|
/**
|
|
58
60
|
* Clear the time-range selection and the focused-cell selection. Public
|
|
59
61
|
* because — per PRD scheduler-controlled-selection — the WC no longer
|
|
@@ -66,18 +68,44 @@ export declare class MpScheduler extends LitElement {
|
|
|
66
68
|
removeEvent(eventId: string): void;
|
|
67
69
|
getEventById(eventId: string): SchedulerEvent | null;
|
|
68
70
|
refetchEvents(): void;
|
|
71
|
+
/**
|
|
72
|
+
* Localized string lookup: options.messages overrides merged onto the
|
|
73
|
+
* English defaults, with {placeholder} interpolation.
|
|
74
|
+
*/
|
|
75
|
+
private msg;
|
|
69
76
|
render(): TemplateResult;
|
|
70
77
|
protected firstUpdated(): void;
|
|
71
78
|
private populateHeader;
|
|
72
79
|
private updateTitle;
|
|
80
|
+
/** Header width below which the layout wraps and the title compacts (D9). */
|
|
81
|
+
private static readonly NARROW_HEADER_WIDTH;
|
|
82
|
+
private headerResizeObserver;
|
|
83
|
+
private headerIsNarrow;
|
|
84
|
+
/**
|
|
85
|
+
* Component-width (not viewport) driven narrow mode — the scheduler can sit
|
|
86
|
+
* in a pane far narrower than the screen (splitter/dock). CSS keys the
|
|
87
|
+
* wrapped layout off [data-narrow]; the title text swap needs JS anyway.
|
|
88
|
+
*/
|
|
89
|
+
private observeHeaderWidth;
|
|
73
90
|
private renderView;
|
|
74
91
|
private onStateChange;
|
|
92
|
+
private previousIsLoading;
|
|
75
93
|
private detectAndEmitChanges;
|
|
76
94
|
private updateUI;
|
|
77
95
|
private scheduleDragUpdate;
|
|
78
96
|
private handlePointerDown;
|
|
79
97
|
private handlePointerMove;
|
|
80
98
|
private handlePointerUp;
|
|
99
|
+
/**
|
|
100
|
+
* Two activations of the same event within this window = a double
|
|
101
|
+
* click/tap. Native dblclick cannot be relied on here: the first click's
|
|
102
|
+
* selection re-render replaces the event node, which resets the browser's
|
|
103
|
+
* double-click tracking — so `event-dblclick` is synthesized from
|
|
104
|
+
* consecutive activations instead (and works for touch double-tap too).
|
|
105
|
+
*/
|
|
106
|
+
private static readonly DBLCLICK_WINDOW_MS;
|
|
107
|
+
private lastEventActivation;
|
|
108
|
+
private registerEventActivation;
|
|
81
109
|
private handleDragComplete;
|
|
82
110
|
private handleClick;
|
|
83
111
|
private handleDoubleClick;
|
|
@@ -92,6 +120,8 @@ export declare class MpScheduler extends LitElement {
|
|
|
92
120
|
*/
|
|
93
121
|
private handleFocusIn;
|
|
94
122
|
private handleKeyDown;
|
|
123
|
+
/** Keyboard face of the more-link / year-month-header click delegation. */
|
|
124
|
+
private activateFocusedDrillControl;
|
|
95
125
|
private getFocusedKind;
|
|
96
126
|
private handleAltShortcut;
|
|
97
127
|
private handleEventKeyDown;
|
|
@@ -34,6 +34,8 @@ export interface InputHandlerConfig {
|
|
|
34
34
|
isEditable: () => boolean;
|
|
35
35
|
/** Whether selection is enabled */
|
|
36
36
|
isSelectable: () => boolean;
|
|
37
|
+
/** Whether the given event is the currently-selected one */
|
|
38
|
+
isEventSelected?: (eventId: string) => boolean;
|
|
37
39
|
/** Touch hold duration in ms before drag activates (default: 500) */
|
|
38
40
|
touchHoldDuration?: number;
|
|
39
41
|
/** Movement threshold before touch hold is cancelled (default: 10) */
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { SchedulerEvent, TimeSlot } from '@mintplayer/web-components/scheduler-core';
|
|
1
|
+
import { SchedulerEvent, SchedulerEventPart, 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.
|
|
5
5
|
* Format: "{title}, {start}–{end} on {resource}". Resource is omitted when
|
|
6
6
|
* the event has no resource or the caller doesn't have it (week/day views).
|
|
7
|
+
* Strings and date formatting follow options.messages / options.locale.
|
|
7
8
|
*/
|
|
8
|
-
export declare function formatEventAriaLabel(event: SchedulerEvent, resourceTitle: string | null,
|
|
9
|
+
export declare function formatEventAriaLabel(event: SchedulerEvent, resourceTitle: string | null, options: SchedulerOptions): string;
|
|
9
10
|
/**
|
|
10
11
|
* Normalised selection range — covers anchor.start through extent.end (or
|
|
11
12
|
* the reverse if the user shift-arrowed backwards), with the resource pinned
|
|
@@ -28,22 +29,22 @@ export declare function isSlotInSelection(slot: TimeSlot, state: SchedulerState,
|
|
|
28
29
|
* Includes weekday + date so screen readers don't lose the user across
|
|
29
30
|
* cross-day moves.
|
|
30
31
|
*/
|
|
31
|
-
export declare function formatCellAnnouncement(slot: TimeSlot,
|
|
32
|
+
export declare function formatCellAnnouncement(slot: TimeSlot, options: SchedulerOptions, resourceTitle?: string | null): string;
|
|
32
33
|
/**
|
|
33
34
|
* Live-region announcement after Shift+Arrow grows or shrinks the range.
|
|
34
35
|
* Reads "Selection: {start time, day} to {end time, day}, {N} slots".
|
|
35
36
|
*/
|
|
36
|
-
export declare function formatSelectionAnnouncement(state: SchedulerState, slotDuration: number
|
|
37
|
+
export declare function formatSelectionAnnouncement(state: SchedulerState, slotDuration: number): string;
|
|
37
38
|
/**
|
|
38
39
|
* Live-region announcement for an in-progress keyboard event move.
|
|
39
40
|
*/
|
|
40
|
-
export declare function formatMoveAnnouncement(start: Date, end: Date,
|
|
41
|
+
export declare function formatMoveAnnouncement(start: Date, end: Date, options: SchedulerOptions): string;
|
|
41
42
|
/**
|
|
42
43
|
* Live-region announcement for an in-progress keyboard event resize. The
|
|
43
44
|
* `edge` field tells the user which side they're stretching, so they can
|
|
44
45
|
* tell Shift+ArrowDown (end edge) from Alt+Shift+ArrowDown (start edge).
|
|
45
46
|
*/
|
|
46
|
-
export declare function formatResizeAnnouncement(start: Date, end: Date, edge: 'start' | 'end',
|
|
47
|
+
export declare function formatResizeAnnouncement(start: Date, end: Date, edge: 'start' | 'end', options: SchedulerOptions): string;
|
|
47
48
|
/**
|
|
48
49
|
* Base class for scheduler views
|
|
49
50
|
*/
|
|
@@ -84,4 +85,40 @@ export declare abstract class BaseView {
|
|
|
84
85
|
* Helper to clear container
|
|
85
86
|
*/
|
|
86
87
|
protected clearContainer(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Append the start/end resize handles for an event part. The handle strip
|
|
90
|
+
* is the pointer hit zone the drag machine targets via
|
|
91
|
+
* closest('.resize-handle'); the glyph inside it is a purely decorative
|
|
92
|
+
* affordance revealed by the .selected class — never focusable, the
|
|
93
|
+
* keyboard resize path lives on the event element (move-mode).
|
|
94
|
+
* Position classes are per-view: ['top','bottom'] for time grids,
|
|
95
|
+
* ['left','right'] for the timeline.
|
|
96
|
+
*/
|
|
97
|
+
protected appendResizeHandles(eventEl: HTMLElement, part: SchedulerEventPart, [startClass, endClass]?: [string, string]): void;
|
|
98
|
+
private createResizeHandle;
|
|
99
|
+
/**
|
|
100
|
+
* Retrofit the ARIA grid chain onto a rendered view (wc-aria PRD step 5.7):
|
|
101
|
+
* the container claims `grid`, layout-only wrappers become `presentation`
|
|
102
|
+
* so they stop breaking the chain, the header strip becomes the
|
|
103
|
+
* column-header row, and the cell groups named by `rows` become rows. The
|
|
104
|
+
* cells themselves already carry role="gridcell" + ids + roving tabindex.
|
|
105
|
+
*
|
|
106
|
+
* The mapping is pragmatic, not ideal: week/day DOM is COLUMN-major (a row
|
|
107
|
+
* here is one day's column of time cells), because the layout was built
|
|
108
|
+
* for CSS first. The cells' focus announcements carry full day+time, so
|
|
109
|
+
* navigation stays understandable.
|
|
110
|
+
*/
|
|
111
|
+
protected applyGridRoles(config: {
|
|
112
|
+
columnHeaderRow?: string;
|
|
113
|
+
columnHeaders?: string;
|
|
114
|
+
presentation?: string[];
|
|
115
|
+
rows?: string;
|
|
116
|
+
/** Extra gridcells (e.g. a per-row events overlay whose buttons need a
|
|
117
|
+
* cell to live in — rows may not own buttons directly). */
|
|
118
|
+
cells?: string;
|
|
119
|
+
/** Grids where Shift+Arrow extends a multi-cell range (week/day). */
|
|
120
|
+
multiselectable?: boolean;
|
|
121
|
+
}): void;
|
|
122
|
+
/** aria-current="date" on every element the views styled `.today`. */
|
|
123
|
+
protected markToday(): void;
|
|
87
124
|
}
|
|
@@ -16,6 +16,12 @@ export declare class TimelineView extends BaseView {
|
|
|
16
16
|
private createResourceRow;
|
|
17
17
|
private renderEvents;
|
|
18
18
|
private createEventElement;
|
|
19
|
+
/**
|
|
20
|
+
* Dashed ghost showing where the dragged event will land, rendered in the
|
|
21
|
+
* dragged event's own resource row (pointer drags don't change resource).
|
|
22
|
+
* Mirrors week-view.renderPreviewEvent for the horizontal axis.
|
|
23
|
+
*/
|
|
24
|
+
private renderPreviewEvent;
|
|
19
25
|
update(state: SchedulerState): void;
|
|
20
26
|
private optionsRequireRerender;
|
|
21
27
|
private updateGreyedSlots;
|
package/scheduler-core/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { D as
|
|
2
|
-
import { a as
|
|
3
|
-
class
|
|
1
|
+
import { D as $, d as C } from "../chunks/color-CpFtrIoX.mjs";
|
|
2
|
+
import { a as G, b as N, c as U, R as X, T as Y, e as _, f 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 ct, r as it, q as rt, t as at } from "../chunks/color-CpFtrIoX.mjs";
|
|
3
|
+
class w {
|
|
4
4
|
/**
|
|
5
5
|
* Calculate position for an event part in week/day view
|
|
6
6
|
*/
|
|
7
|
-
calculateWeekPosition(t, e,
|
|
8
|
-
const i = {
|
|
7
|
+
calculateWeekPosition(t, e, s, n, c, l = {}) {
|
|
8
|
+
const i = { ...$, ...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,
|
|
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, T = p / s, v = S + n * p + e * T;
|
|
11
11
|
return {
|
|
12
12
|
top: m,
|
|
13
|
-
left:
|
|
14
|
-
width:
|
|
13
|
+
left: v,
|
|
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,
|
|
23
|
-
({
|
|
24
|
-
const i = c.getTime() -
|
|
22
|
+
calculateTimelinePosition(t, e, s, n, c, l = {}) {
|
|
23
|
+
({ ...$, ...l });
|
|
24
|
+
const i = c.getTime() - n.getTime(), r = Math.max(t.start.getTime(), n.getTime()), a = Math.min(t.end.getTime(), c.getTime()), h = r - n.getTime(), u = a - r, d = h / i * 100, f = u / i * 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,
|
|
37
|
-
const i = 100 / l, r = 100 /
|
|
36
|
+
calculateMonthEventPosition(t, e, s, n, c, l = 7) {
|
|
37
|
+
const i = 100 / l, r = 100 / s, a = n * i, h = (c - n + 1) * i;
|
|
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,
|
|
49
|
+
toPixelPosition(t, e, s) {
|
|
50
50
|
return {
|
|
51
|
-
top: t.top / 100 *
|
|
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 *
|
|
54
|
+
height: t.height / 100 * s,
|
|
55
55
|
zIndex: t.zIndex
|
|
56
56
|
};
|
|
57
57
|
}
|
|
@@ -82,93 +82,96 @@ class x {
|
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
const P = new
|
|
86
|
-
function
|
|
87
|
-
const e = Object.entries(t).map(([
|
|
85
|
+
const P = new w();
|
|
86
|
+
function M(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
|
|
90
|
+
function z(o) {
|
|
91
91
|
const t = o.dataset, e = {};
|
|
92
|
-
for (const
|
|
93
|
-
const
|
|
94
|
-
|
|
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
|
|
98
|
+
function B(o, t) {
|
|
99
99
|
return o.closest(`[data-${t}]`);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function D(o) {
|
|
102
102
|
return {
|
|
103
103
|
top: o.scrollTop,
|
|
104
104
|
left: o.scrollLeft
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
const
|
|
107
|
+
function E(o, t, e = "smooth") {
|
|
108
|
+
const s = o.getBoundingClientRect(), c = t.getBoundingClientRect().top - s.top + o.scrollTop;
|
|
109
109
|
o.scrollTo({
|
|
110
110
|
top: c,
|
|
111
111
|
behavior: e
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
const e = o.getBoundingClientRect(),
|
|
116
|
-
return e.top >=
|
|
114
|
+
function L(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
|
|
119
|
-
const e = t.getBoundingClientRect(),
|
|
118
|
+
function W(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:
|
|
122
|
-
y:
|
|
121
|
+
x: s - e.left,
|
|
122
|
+
y: n - e.top
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function O(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
|
-
function
|
|
131
|
+
function k(o, ...t) {
|
|
132
132
|
o.classList.add(...t.filter(Boolean));
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function F(o, ...t) {
|
|
135
135
|
o.classList.remove(...t.filter(Boolean));
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function H(o, t, e) {
|
|
138
138
|
o.classList.toggle(t, e);
|
|
139
139
|
}
|
|
140
140
|
export {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
141
|
+
G as DEFAULT_COLORS,
|
|
142
|
+
N as DEFAULT_MESSAGES,
|
|
143
|
+
$ as DEFAULT_OPTIONS,
|
|
144
|
+
U as DateService,
|
|
145
|
+
w as PositionService,
|
|
146
|
+
X as ResourceService,
|
|
147
|
+
Y as TimelineService,
|
|
148
|
+
_ as addAlpha,
|
|
149
|
+
k as addClasses,
|
|
150
|
+
q as darkenColor,
|
|
150
151
|
C as dateService,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
z as
|
|
161
|
-
|
|
162
|
-
W as
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
nt as
|
|
152
|
+
B as findClosestWithData,
|
|
153
|
+
J as formatMessage,
|
|
154
|
+
K as generateEventId,
|
|
155
|
+
Q as generateGroupId,
|
|
156
|
+
Z as generateId,
|
|
157
|
+
tt as generateResourceId,
|
|
158
|
+
A as getCSSVariable,
|
|
159
|
+
et as getColorByIndex,
|
|
160
|
+
ot as getContrastColor,
|
|
161
|
+
z as getDataAttributes,
|
|
162
|
+
M as getElementByData,
|
|
163
|
+
W as getRelativePosition,
|
|
164
|
+
D as getScrollPosition,
|
|
165
|
+
L as isInViewport,
|
|
166
|
+
st as isResource,
|
|
167
|
+
nt as isResourceGroup,
|
|
168
|
+
ct as lightenColor,
|
|
167
169
|
P as positionService,
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
170
|
+
F as removeClasses,
|
|
171
|
+
it as resolveMessages,
|
|
172
|
+
rt as resourceService,
|
|
173
|
+
E as scrollToTime,
|
|
174
|
+
O as setCSSVariable,
|
|
175
|
+
at as timelineService,
|
|
176
|
+
H as toggleClass
|
|
174
177
|
};
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
/** {date} — formatted first day of the visible week */
|
|
22
|
+
timelineGridLabel: string;
|
|
23
|
+
/** {title} — resource group title */
|
|
24
|
+
expandGroup: string;
|
|
25
|
+
/** {title} — resource group title */
|
|
26
|
+
collapseGroup: string;
|
|
27
|
+
/** {count} — number of hidden events */
|
|
28
|
+
moreEvents: string;
|
|
29
|
+
/** {view} — localized view name */
|
|
30
|
+
viewChanged: string;
|
|
31
|
+
/** {title} */
|
|
32
|
+
eventAdded: string;
|
|
33
|
+
/** {title} */
|
|
34
|
+
eventUpdated: string;
|
|
35
|
+
/** {title} */
|
|
36
|
+
eventRemoved: string;
|
|
37
|
+
loadingEvents: string;
|
|
38
|
+
eventsLoaded: string;
|
|
39
|
+
/** {title} {minutes} — move-mode entry keymap announcement */
|
|
40
|
+
moveModeEntered: string;
|
|
41
|
+
/** {start} {end} {day} */
|
|
42
|
+
movedTo: string;
|
|
43
|
+
/** {resource} */
|
|
44
|
+
movedToResource: string;
|
|
45
|
+
/** {edge} {start} {end} — edge is startEdge/endEdge below */
|
|
46
|
+
resizedEdge: string;
|
|
47
|
+
startEdge: string;
|
|
48
|
+
endEdge: string;
|
|
49
|
+
moveCommitted: string;
|
|
50
|
+
moveCancelled: string;
|
|
51
|
+
/** {start} {end} {count} {slots} — slots is slotSingular/slotPlural */
|
|
52
|
+
selection: string;
|
|
53
|
+
slotSingular: string;
|
|
54
|
+
slotPlural: string;
|
|
55
|
+
/** {start} {end} */
|
|
56
|
+
selectionCommitted: string;
|
|
57
|
+
gridInstructions: string;
|
|
58
|
+
eventInstructions: string;
|
|
59
|
+
/** {resource} */
|
|
60
|
+
eventOnResource: string;
|
|
61
|
+
}
|
|
62
|
+
export declare const DEFAULT_MESSAGES: SchedulerMessages;
|
|
63
|
+
/**
|
|
64
|
+
* Interpolate `{placeholder}` tokens. Unknown tokens are left verbatim so a
|
|
65
|
+
* typo'd override is visible rather than silently swallowed.
|
|
66
|
+
*/
|
|
67
|
+
export declare function formatMessage(template: string, params?: Record<string, string | number>): string;
|
|
68
|
+
/** Merge a consumer's partial override table onto the English defaults. */
|
|
69
|
+
export declare function resolveMessages(overrides?: Partial<SchedulerMessages>): SchedulerMessages;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SchedulerMessages } from './messages';
|
|
1
2
|
import { DayOfWeek, TimeFormat, ViewType } from './types';
|
|
2
3
|
/**
|
|
3
4
|
* Business hours configuration
|
|
@@ -73,6 +74,9 @@ export interface SchedulerOptions {
|
|
|
73
74
|
dragScroll?: boolean;
|
|
74
75
|
/** Snap duration in seconds */
|
|
75
76
|
snapDuration?: number;
|
|
77
|
+
/** Override any user-facing string (labels, announcements, instructions).
|
|
78
|
+
* Merged onto the English defaults — see SchedulerMessages. */
|
|
79
|
+
messages?: Partial<SchedulerMessages>;
|
|
76
80
|
/** Whether to show current time indicator */
|
|
77
81
|
nowIndicator?: boolean;
|
|
78
82
|
/** Whether to show week numbers */
|
package/select/index.mjs
CHANGED
|
@@ -5,10 +5,18 @@ export interface MpSelectOption {
|
|
|
5
5
|
label: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
}
|
|
8
|
+
export interface MpSelectOptgroup {
|
|
9
|
+
label: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
options: MpSelectOption[];
|
|
12
|
+
}
|
|
13
|
+
/** One entry of the rendered list: a plain option, or a labelled group of them. */
|
|
14
|
+
export type MpSelectItem = MpSelectOption | MpSelectOptgroup;
|
|
8
15
|
export interface SelectChangeEventDetail {
|
|
9
16
|
value: string | null;
|
|
10
17
|
values: string[];
|
|
11
18
|
}
|
|
19
|
+
declare const MpSelect_base: typeof LitElement & (new (...args: any[]) => import('@mintplayer/web-components/a11y').FormAssociatedElement);
|
|
12
20
|
/**
|
|
13
21
|
* `<mp-select>` — Bootstrap-styled native `<select>` wrapped in a Lit element.
|
|
14
22
|
*
|
|
@@ -34,7 +42,7 @@ export interface SelectChangeEventDetail {
|
|
|
34
42
|
* a `composed: true` `change` event so consumers using the native event
|
|
35
43
|
* name continue to fire.
|
|
36
44
|
*/
|
|
37
|
-
export declare class MpSelect extends
|
|
45
|
+
export declare class MpSelect extends MpSelect_base {
|
|
38
46
|
static styles: import('lit').CSSResult[];
|
|
39
47
|
static shadowRootOptions: {
|
|
40
48
|
delegatesFocus: boolean;
|
|
@@ -50,11 +58,21 @@ export declare class MpSelect extends LitElement {
|
|
|
50
58
|
private _numberVisible;
|
|
51
59
|
private _disabled;
|
|
52
60
|
private _value;
|
|
61
|
+
private _inputLabel;
|
|
62
|
+
private _errorText;
|
|
63
|
+
private readonly _errorId;
|
|
53
64
|
private _values;
|
|
54
65
|
private _options;
|
|
55
66
|
private _slotOptions;
|
|
56
67
|
private readonly _selectRef;
|
|
57
68
|
private _slotObserver;
|
|
69
|
+
/**
|
|
70
|
+
* Tier-2 naming. No `role` is passed on purpose: the inner `<select>` already
|
|
71
|
+
* carries the real role, and adding one to the host would announce the control
|
|
72
|
+
* twice. For the same reason the references are targeted at that `<select>`
|
|
73
|
+
* rather than at the host's `ElementInternals`.
|
|
74
|
+
*/
|
|
75
|
+
private readonly hostAria;
|
|
58
76
|
get size(): MpSelectSize;
|
|
59
77
|
set size(value: MpSelectSize);
|
|
60
78
|
get multiple(): boolean;
|
|
@@ -63,20 +81,59 @@ export declare class MpSelect extends LitElement {
|
|
|
63
81
|
set numberVisible(value: number | null);
|
|
64
82
|
get disabled(): boolean;
|
|
65
83
|
set disabled(value: boolean);
|
|
84
|
+
/**
|
|
85
|
+
* Accessible name for the inner `<select>`, as `inputLabel` / `input-label`.
|
|
86
|
+
*
|
|
87
|
+
* Named for where it lands rather than what it is: the value is written to the
|
|
88
|
+
* control *inside* the shadow root, not to the host. Plain `label` was rejected
|
|
89
|
+
* because `<option label>` and `<optgroup label>` are literally in play in this
|
|
90
|
+
* component's own markup, so `label` would read as one of those.
|
|
91
|
+
*
|
|
92
|
+
* This is the tier-1 naming path — always available, and the documented fallback
|
|
93
|
+
* where cross-root element references are not. `aria-labelledby` on the host is
|
|
94
|
+
* tier 2 and takes precedence, being a live reference rather than a copied
|
|
95
|
+
* string.
|
|
96
|
+
*/
|
|
97
|
+
get inputLabel(): string | null;
|
|
98
|
+
set inputLabel(value: string | null);
|
|
99
|
+
/**
|
|
100
|
+
* Validation message, as `errorText` / `error-text`. Rendered as a
|
|
101
|
+
* `.invalid-feedback` node inside the shadow root and referenced from the inner
|
|
102
|
+
* `<select>` by `aria-errormessage` **and** `aria-describedby`, but only while
|
|
103
|
+
* `invalid` is set — `aria-errormessage` is meaningless on a control that is not
|
|
104
|
+
* `aria-invalid`. Text rather than a node, for the same reason `inputLabel`
|
|
105
|
+
* exists: a consumer's own element is outside this shadow root, where an IDREF
|
|
106
|
+
* from the `<select>` cannot reach it.
|
|
107
|
+
*/
|
|
108
|
+
get errorText(): string | null;
|
|
109
|
+
set errorText(value: string | null);
|
|
66
110
|
get value(): string | null;
|
|
67
111
|
set value(value: string | null);
|
|
68
112
|
get values(): string[];
|
|
69
113
|
set values(value: string[]);
|
|
70
|
-
get options():
|
|
71
|
-
set options(value:
|
|
114
|
+
get options(): MpSelectItem[] | null;
|
|
115
|
+
set options(value: MpSelectItem[] | null);
|
|
72
116
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
73
117
|
disconnectedCallback(): void;
|
|
74
118
|
render(): TemplateResult;
|
|
75
119
|
protected updated(): void;
|
|
120
|
+
private renderOption;
|
|
76
121
|
private isSelected;
|
|
122
|
+
/**
|
|
123
|
+
* Mirror slotted <option>/<optgroup> children. Optgroups previously
|
|
124
|
+
* vanished WITH ALL THEIR OPTIONS (audit Critical): the filter kept only
|
|
125
|
+
* top-level OPTION tags, so anything grouped never reached the shadow
|
|
126
|
+
* <select>.
|
|
127
|
+
*/
|
|
128
|
+
private collectSlotItems;
|
|
77
129
|
private onSlotChange;
|
|
78
130
|
private observeSlottedMutations;
|
|
79
131
|
private refreshSlotOptions;
|
|
80
132
|
private onNativeChange;
|
|
81
133
|
private reflectBoolean;
|
|
134
|
+
formValue(): string | FormData | null;
|
|
135
|
+
formReset(): void;
|
|
136
|
+
formRestore(state: string | FormData | File | null): void;
|
|
137
|
+
formValidityAnchor(): HTMLElement | null;
|
|
82
138
|
}
|
|
139
|
+
export {};
|