@leonardaustin/ui 0.4.0 → 0.5.1
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/components/app-shell/AppShell.d.ts +4 -2
- package/dist/components/app-shell/AppShell.d.ts.map +1 -1
- package/dist/components/app-shell/MobileDrawer.d.ts +4 -2
- package/dist/components/app-shell/MobileDrawer.d.ts.map +1 -1
- package/dist/components/app-shell/TopBar.d.ts +5 -3
- package/dist/components/app-shell/TopBar.d.ts.map +1 -1
- package/dist/components/app-shell/navigation.d.ts +7 -2
- package/dist/components/app-shell/navigation.d.ts.map +1 -1
- package/dist/components/app-shell/types.d.ts +13 -1
- package/dist/components/app-shell/types.d.ts.map +1 -1
- package/dist/components/charts/AreaChart.d.ts +11 -7
- package/dist/components/charts/AreaChart.d.ts.map +1 -1
- package/dist/components/charts/BarChart.d.ts +25 -7
- package/dist/components/charts/BarChart.d.ts.map +1 -1
- package/dist/components/charts/DonutChart.d.ts +9 -4
- package/dist/components/charts/DonutChart.d.ts.map +1 -1
- package/dist/components/charts/RadarChart.d.ts +10 -4
- package/dist/components/charts/RadarChart.d.ts.map +1 -1
- package/dist/components/charts/RadialBarChart.d.ts +10 -4
- package/dist/components/charts/RadialBarChart.d.ts.map +1 -1
- package/dist/components/charts/SparkLine.d.ts +7 -1
- package/dist/components/charts/SparkLine.d.ts.map +1 -1
- package/dist/components/charts/StackedBarChart.d.ts +12 -1
- package/dist/components/charts/StackedBarChart.d.ts.map +1 -1
- package/dist/components/charts/VerticalBarChart.d.ts +26 -8
- package/dist/components/charts/VerticalBarChart.d.ts.map +1 -1
- package/dist/components/charts/chartUtils.d.ts +43 -0
- package/dist/components/charts/chartUtils.d.ts.map +1 -0
- package/dist/components/tables/ColumnPicker.d.ts +19 -2
- package/dist/components/tables/ColumnPicker.d.ts.map +1 -1
- package/dist/components/ui/Calendar.d.ts +174 -0
- package/dist/components/ui/Calendar.d.ts.map +1 -0
- package/dist/components/ui/CodeInput.d.ts +33 -0
- package/dist/components/ui/CodeInput.d.ts.map +1 -0
- package/dist/components/ui/PasswordRequirements.d.ts +13 -0
- package/dist/components/ui/PasswordRequirements.d.ts.map +1 -0
- package/dist/components/ui/QrCode.d.ts +33 -0
- package/dist/components/ui/QrCode.d.ts.map +1 -0
- package/dist/components/ui/StepProgress.d.ts.map +1 -1
- package/dist/components/ui/calendar/AgendaView.d.ts +11 -0
- package/dist/components/ui/calendar/AgendaView.d.ts.map +1 -0
- package/dist/components/ui/calendar/MonthView.d.ts +10 -0
- package/dist/components/ui/calendar/MonthView.d.ts.map +1 -0
- package/dist/components/ui/calendar/TimeGrid.d.ts +11 -0
- package/dist/components/ui/calendar/TimeGrid.d.ts.map +1 -0
- package/dist/components/ui/calendar/TimelineView.d.ts +11 -0
- package/dist/components/ui/calendar/TimelineView.d.ts.map +1 -0
- package/dist/components/ui/calendar/context.d.ts +56 -0
- package/dist/components/ui/calendar/context.d.ts.map +1 -0
- package/dist/components/ui/calendar/items.d.ts +46 -0
- package/dist/components/ui/calendar/items.d.ts.map +1 -0
- package/dist/components/ui/calendar/types.d.ts +125 -0
- package/dist/components/ui/calendar/types.d.ts.map +1 -0
- package/dist/components/ui/calendar/useGridInteraction.d.ts +39 -0
- package/dist/components/ui/calendar/useGridInteraction.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6658 -3115
- package/dist/lib/calendar.d.ts +305 -0
- package/dist/lib/calendar.d.ts.map +1 -0
- package/dist/lib/codeInput.d.ts +28 -0
- package/dist/lib/codeInput.d.ts.map +1 -0
- package/dist/lib/passwordRequirements.d.ts +12 -0
- package/dist/lib/passwordRequirements.d.ts.map +1 -0
- package/dist/lib/qrCode.d.ts +20 -0
- package/dist/lib/qrCode.d.ts.map +1 -0
- package/dist/styles.css +710 -0
- package/package.json +3 -2
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar layouts. `threeDay` and `workWeek` are time grids like `week`;
|
|
3
|
+
* `timeline` is a single day with one horizontal row per resource.
|
|
4
|
+
*/
|
|
5
|
+
export type CalendarView = "day" | "threeDay" | "workWeek" | "week" | "month" | "agenda" | "timeline";
|
|
6
|
+
/** 0 = Sunday … 6 = Saturday, matching `Date#getDay()`. */
|
|
7
|
+
export type Weekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
8
|
+
/** Semantic colours, mapped to the theme's colour tokens. */
|
|
9
|
+
export type CalendarColor = "accent" | "blue" | "green" | "yellow" | "red" | "purple" | "gray";
|
|
10
|
+
/**
|
|
11
|
+
* Booking state. `tentative` is unconfirmed (e.g. awaiting confirmation),
|
|
12
|
+
* `held` is capacity reserved without a booking, `cancelled` stays visible
|
|
13
|
+
* but muted. Non-confirmed statuses also render a text label (unless
|
|
14
|
+
* `display.status` is false), and the box styling always differs, so status
|
|
15
|
+
* never relies on colour alone.
|
|
16
|
+
*/
|
|
17
|
+
export type CalendarEventStatus = "confirmed" | "tentative" | "held" | "cancelled";
|
|
18
|
+
/** `available` blocks are bookable time; `unavailable` blocks are absences. */
|
|
19
|
+
export type AvailabilityKind = "available" | "unavailable";
|
|
20
|
+
/** A column (time grid) or row (timeline): a clinician, room, etc. */
|
|
21
|
+
export interface CalendarResource {
|
|
22
|
+
id: string;
|
|
23
|
+
title: string;
|
|
24
|
+
/** Second line in the header, e.g. a role or site. */
|
|
25
|
+
subtitle?: string;
|
|
26
|
+
/** Timeline rows are grouped (and collapsible) by this label. */
|
|
27
|
+
group?: string;
|
|
28
|
+
/** Default colour for this resource's events and availability. */
|
|
29
|
+
color?: CalendarColor;
|
|
30
|
+
}
|
|
31
|
+
/** A booking, appointment or other event. End is exclusive. */
|
|
32
|
+
export interface CalendarEvent<T = unknown> {
|
|
33
|
+
id: string;
|
|
34
|
+
title: string;
|
|
35
|
+
start: Date;
|
|
36
|
+
end: Date;
|
|
37
|
+
/** Shown in the all-day row. Events lasting 24h or more go there too. */
|
|
38
|
+
allDay?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Resource(s) the event belongs to. An array shows the event in each
|
|
41
|
+
* resource's column — e.g. both the clinician's and the room's row.
|
|
42
|
+
*/
|
|
43
|
+
resourceId?: string | readonly string[];
|
|
44
|
+
color?: CalendarColor;
|
|
45
|
+
status?: CalendarEventStatus;
|
|
46
|
+
/** Secondary line, e.g. service and room. */
|
|
47
|
+
description?: string;
|
|
48
|
+
/** Short extra label, e.g. "Arrived" or "Unpaid". */
|
|
49
|
+
badge?: string;
|
|
50
|
+
/** Set false to stop this event being moved or resized. */
|
|
51
|
+
editable?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* A temporary stand-in, such as the slot behind an open "new booking"
|
|
54
|
+
* dialog. Drawn raised in its colour, it can't be focused, clicked, moved
|
|
55
|
+
* or resized, and the agenda leaves it out.
|
|
56
|
+
*/
|
|
57
|
+
placeholder?: boolean;
|
|
58
|
+
/** Your own payload, passed back untouched in callbacks. */
|
|
59
|
+
data?: T;
|
|
60
|
+
}
|
|
61
|
+
/** A block of availability (or unavailability) drawn behind events. */
|
|
62
|
+
export interface CalendarAvailability<T = unknown> {
|
|
63
|
+
id: string;
|
|
64
|
+
start: Date;
|
|
65
|
+
end: Date;
|
|
66
|
+
/** Defaults to `available`. */
|
|
67
|
+
kind?: AvailabilityKind;
|
|
68
|
+
/**
|
|
69
|
+
* Resource(s) this block applies to. Omit to apply it to every column
|
|
70
|
+
* (e.g. a practice closure).
|
|
71
|
+
*/
|
|
72
|
+
resourceId?: string | readonly string[];
|
|
73
|
+
/** Label such as a room name or an absence category. */
|
|
74
|
+
label?: string;
|
|
75
|
+
color?: CalendarColor;
|
|
76
|
+
/** Set false to stop this block being moved or resized. */
|
|
77
|
+
editable?: boolean;
|
|
78
|
+
/** A temporary stand-in, like `CalendarEvent.placeholder`. */
|
|
79
|
+
placeholder?: boolean;
|
|
80
|
+
/** Recurring rule this occurrence came from (see `expandAvailabilityRules`). */
|
|
81
|
+
seriesId?: string;
|
|
82
|
+
/** The occurrence's civil date ("YYYY-MM-DD") within its series. */
|
|
83
|
+
occurrenceKey?: string;
|
|
84
|
+
data?: T;
|
|
85
|
+
}
|
|
86
|
+
/** Half-open range [start, end). */
|
|
87
|
+
export interface DateRange {
|
|
88
|
+
start: Date;
|
|
89
|
+
end: Date;
|
|
90
|
+
}
|
|
91
|
+
export interface CalendarViewOptions {
|
|
92
|
+
/** First day of the week. Defaults to 1 (Monday). */
|
|
93
|
+
weekStartsOn?: Weekday;
|
|
94
|
+
/** Days shown by `workWeek`. Defaults to Monday–Friday. */
|
|
95
|
+
workWeekDays?: readonly Weekday[];
|
|
96
|
+
/** Days shown by `agenda`. Defaults to 7. */
|
|
97
|
+
agendaDays?: number;
|
|
98
|
+
}
|
|
99
|
+
export declare const MINUTES_PER_DAY = 1440;
|
|
100
|
+
/** Local midnight at the start of `date`'s day. */
|
|
101
|
+
export declare function startOfDay(date: Date): Date;
|
|
102
|
+
/** Adds calendar days, keeping the wall-clock time (DST-safe). */
|
|
103
|
+
export declare function addDays(date: Date, days: number): Date;
|
|
104
|
+
/** Adds wall-clock minutes. */
|
|
105
|
+
export declare function addMinutes(date: Date, minutes: number): Date;
|
|
106
|
+
/** Adds months, clamping the day (31 Jan + 1 month = 28/29 Feb). */
|
|
107
|
+
export declare function addMonths(date: Date, months: number): Date;
|
|
108
|
+
/** Midnight on the first day of `date`'s week. */
|
|
109
|
+
export declare function startOfWeek(date: Date, weekStartsOn?: Weekday): Date;
|
|
110
|
+
export declare function startOfMonth(date: Date): Date;
|
|
111
|
+
export declare function isSameDay(a: Date, b: Date): boolean;
|
|
112
|
+
/** Whole calendar days from `b` to `a` (ignores time and DST). */
|
|
113
|
+
export declare function differenceInDays(a: Date, b: Date): number;
|
|
114
|
+
/** Wall-clock minutes since local midnight, including fractions. */
|
|
115
|
+
export declare function minutesOfDay(date: Date): number;
|
|
116
|
+
/** The local time `minutes` after midnight on `day` (may roll over). */
|
|
117
|
+
export declare function dateAtMinutes(day: Date, minutes: number): Date;
|
|
118
|
+
/** Parses "HH:mm" (or "H:mm"; "24:00" allowed) into minutes. */
|
|
119
|
+
export declare function parseTime(value: string): number;
|
|
120
|
+
/** Formats minutes as "HH:mm" (1440 → "24:00"). */
|
|
121
|
+
export declare function formatTimeOfDay(minutes: number): string;
|
|
122
|
+
/** Civil date key "YYYY-MM-DD" for `date`'s local day. */
|
|
123
|
+
export declare function toDateKey(date: Date): string;
|
|
124
|
+
/** Local midnight for a "YYYY-MM-DD" key. */
|
|
125
|
+
export declare function fromDateKey(key: string): Date;
|
|
126
|
+
/** Snaps minutes to a multiple of `step`. */
|
|
127
|
+
export declare function snapMinutes(minutes: number, step: number, mode?: "round" | "floor" | "ceil"): number;
|
|
128
|
+
/** Snaps a date's wall-clock time on its own day to `step` minutes. */
|
|
129
|
+
export declare function snapDate(date: Date, step: number, mode?: "round" | "floor" | "ceil"): Date;
|
|
130
|
+
/** Clamps `value` into [min, max]. */
|
|
131
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
132
|
+
/** The time-grid views (vertical day columns). */
|
|
133
|
+
export declare function isTimeGridView(view: CalendarView): boolean;
|
|
134
|
+
/** Days shown by `view` for the anchor `date`, in order. */
|
|
135
|
+
export declare function getVisibleDays(view: CalendarView, date: Date, options?: CalendarViewOptions): Date[];
|
|
136
|
+
/** Month grid as whole weeks, from the week containing the 1st. */
|
|
137
|
+
export declare function getMonthWeeks(date: Date, weekStartsOn?: Weekday): Date[][];
|
|
138
|
+
/** The [start, end) range covered by `view`. */
|
|
139
|
+
export declare function getViewRange(view: CalendarView, date: Date, options?: CalendarViewOptions): DateRange;
|
|
140
|
+
/** The anchor date one page before (-1) or after (1) `date`. */
|
|
141
|
+
export declare function shiftDate(view: CalendarView, date: Date, direction: -1 | 1, options?: CalendarViewOptions): Date;
|
|
142
|
+
/** Cached `Intl.DateTimeFormat`. */
|
|
143
|
+
export declare function getFormatter(locale: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
|
|
144
|
+
export interface FormatOptions {
|
|
145
|
+
/** BCP 47 locale. Defaults to "en-GB". */
|
|
146
|
+
locale?: string;
|
|
147
|
+
/** 12-hour clock. Defaults to false (24-hour). */
|
|
148
|
+
hour12?: boolean;
|
|
149
|
+
}
|
|
150
|
+
/** "09:30" (or "9:30 am" with `hour12`). */
|
|
151
|
+
export declare function formatTime(date: Date, options?: FormatOptions): string;
|
|
152
|
+
/** "09:30–10:00". */
|
|
153
|
+
export declare function formatTimeRange(start: Date, end: Date, options?: FormatOptions): string;
|
|
154
|
+
/** Hour gutter label: "09:00" (or "9 am"). */
|
|
155
|
+
export declare function formatHourLabel(minutes: number, options?: FormatOptions): string;
|
|
156
|
+
/** "Thursday 16 October 2026". */
|
|
157
|
+
export declare function formatLongDate(date: Date, locale?: string): string;
|
|
158
|
+
/** Toolbar title for a view, e.g. "13 – 19 October 2026". */
|
|
159
|
+
export declare function formatRangeTitle(view: CalendarView, date: Date, options?: CalendarViewOptions & {
|
|
160
|
+
locale?: string;
|
|
161
|
+
}): string;
|
|
162
|
+
/** True when [aStart, aEnd) and [bStart, bEnd) share any time. */
|
|
163
|
+
export declare function rangesOverlap(aStart: number, aEnd: number, bStart: number, bEnd: number): boolean;
|
|
164
|
+
/** The part of [start, end) that falls on `day`, in minutes of that day. */
|
|
165
|
+
export interface DaySegment {
|
|
166
|
+
startMinute: number;
|
|
167
|
+
endMinute: number;
|
|
168
|
+
/** The interval began on an earlier day. */
|
|
169
|
+
continuesBefore: boolean;
|
|
170
|
+
/** The interval carries on into a later day. */
|
|
171
|
+
continuesAfter: boolean;
|
|
172
|
+
}
|
|
173
|
+
export declare function daySegment(start: Date, end: Date, day: Date): DaySegment | null;
|
|
174
|
+
/** Sorts and merges overlapping or touching [start, end) pairs. */
|
|
175
|
+
export declare function mergeIntervals(intervals: ReadonlyArray<readonly [number, number]>): Array<[number, number]>;
|
|
176
|
+
/** [start, end) minus every interval in `cuts`. */
|
|
177
|
+
export declare function subtractIntervals(start: number, end: number, cuts: ReadonlyArray<readonly [number, number]>): Array<[number, number]>;
|
|
178
|
+
export interface LayoutItem {
|
|
179
|
+
id: string;
|
|
180
|
+
start: number;
|
|
181
|
+
end: number;
|
|
182
|
+
}
|
|
183
|
+
export interface LayoutSlot {
|
|
184
|
+
/** Zero-based column within the overlapping cluster. */
|
|
185
|
+
column: number;
|
|
186
|
+
/** Columns in the cluster. Left = column / columns. */
|
|
187
|
+
columns: number;
|
|
188
|
+
/** Columns this item can widen across. Width = span / columns. */
|
|
189
|
+
span: number;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Lays out overlapping intervals in side-by-side columns. Items that overlap
|
|
193
|
+
* (directly or through a chain) form a cluster sharing a column count; each
|
|
194
|
+
* item takes the first free column and then widens right across columns that
|
|
195
|
+
* have nothing overlapping it. `minDuration` treats very short items as at
|
|
196
|
+
* least that long so their rendered boxes don't collide.
|
|
197
|
+
*/
|
|
198
|
+
export declare function layoutOverlaps(items: readonly LayoutItem[], minDuration?: number): Map<string, LayoutSlot>;
|
|
199
|
+
/**
|
|
200
|
+
* Stacks intervals into lanes (rows) so none in a lane overlap. Used by the
|
|
201
|
+
* all-day row and timeline rows. Returns each id's lane and the lane count.
|
|
202
|
+
*/
|
|
203
|
+
export declare function packLanes(items: readonly LayoutItem[]): {
|
|
204
|
+
lanes: Map<string, number>;
|
|
205
|
+
count: number;
|
|
206
|
+
};
|
|
207
|
+
/** Normalises a `resourceId` field to an array (empty = all resources). */
|
|
208
|
+
export declare function resourceIdsOf(value: string | readonly string[] | undefined): readonly string[];
|
|
209
|
+
/** Whether an item with `value` belongs in `resourceId`'s column. */
|
|
210
|
+
export declare function matchesResource(value: string | readonly string[] | undefined, resourceId: string | undefined, { emptyMatchesAll }: {
|
|
211
|
+
emptyMatchesAll: boolean;
|
|
212
|
+
}): boolean;
|
|
213
|
+
/** Replaces `from` with `to` in an item's resource ids. */
|
|
214
|
+
export declare function replaceResource(value: string | readonly string[] | undefined, from: string | undefined, to: string | undefined): string[] | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* Resources with any event or available block in `range` — an "active
|
|
217
|
+
* schedule" filter. Absences (`unavailable` blocks) don't count, and items
|
|
218
|
+
* without a resource id don't make every resource active.
|
|
219
|
+
*/
|
|
220
|
+
export declare function getActiveResourceIds(range: DateRange, events: ReadonlyArray<Pick<CalendarEvent, "start" | "end" | "resourceId">>, availability?: ReadonlyArray<Pick<CalendarAvailability, "start" | "end" | "resourceId" | "kind">>): Set<string>;
|
|
221
|
+
export interface WeeklyRecurrence {
|
|
222
|
+
/** Days of the week the rule repeats on. */
|
|
223
|
+
weekdays: readonly Weekday[];
|
|
224
|
+
/** Repeat every N weeks, counted from the rule's start week. Default 1. */
|
|
225
|
+
interval?: number;
|
|
226
|
+
/** Last date (inclusive) as "YYYY-MM-DD". Omit for no end. */
|
|
227
|
+
until?: string;
|
|
228
|
+
/** Occurrence dates ("YYYY-MM-DD") to skip, e.g. detached exceptions. */
|
|
229
|
+
exclusions?: readonly string[];
|
|
230
|
+
}
|
|
231
|
+
/** A weekly (or one-off) availability rule with civil dates and times. */
|
|
232
|
+
export interface AvailabilityRule<T = unknown> {
|
|
233
|
+
id: string;
|
|
234
|
+
/** First date as "YYYY-MM-DD". */
|
|
235
|
+
startDate: string;
|
|
236
|
+
/** "HH:mm" local start time. */
|
|
237
|
+
startTime: string;
|
|
238
|
+
/** "HH:mm" local end time; at or before `startTime` means overnight. */
|
|
239
|
+
endTime: string;
|
|
240
|
+
/** Omit or null for a one-off block on `startDate`. */
|
|
241
|
+
recurrence?: WeeklyRecurrence | null;
|
|
242
|
+
kind?: AvailabilityKind;
|
|
243
|
+
resourceId?: string | readonly string[];
|
|
244
|
+
label?: string;
|
|
245
|
+
color?: CalendarColor;
|
|
246
|
+
editable?: boolean;
|
|
247
|
+
data?: T;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Expands rules into concrete blocks overlapping `range`. Each occurrence's
|
|
251
|
+
* id is `${rule.id}@${dateKey}`, with `seriesId` and `occurrenceKey` set so a
|
|
252
|
+
* move or resize can be applied to "this occurrence" or "this and following".
|
|
253
|
+
* Intervals count whole weeks from the week containing `startDate`.
|
|
254
|
+
*/
|
|
255
|
+
export declare function expandAvailabilityRules<T>(rules: ReadonlyArray<AvailabilityRule<T>>, range: DateRange, options?: {
|
|
256
|
+
weekStartsOn?: Weekday;
|
|
257
|
+
}): CalendarAvailability<T>[];
|
|
258
|
+
/** Visible window of a time grid, in minutes of the day. */
|
|
259
|
+
export interface TimeBounds {
|
|
260
|
+
min: number;
|
|
261
|
+
max: number;
|
|
262
|
+
}
|
|
263
|
+
/** Converts a pointer offset (px from the grid's top/left) into minutes. */
|
|
264
|
+
export declare function offsetToMinutes(offsetPx: number, pxPerMinute: number, bounds: TimeBounds): number;
|
|
265
|
+
/**
|
|
266
|
+
* New range when dragging to create: from the slot under the anchor to the
|
|
267
|
+
* slot under the pointer, inclusive, on `day`. Edges that fall in a
|
|
268
|
+
* spring-forward gap clamp to its end, so the range is never longer than the
|
|
269
|
+
* slots dragged over.
|
|
270
|
+
*/
|
|
271
|
+
export declare function computeCreateRange(day: Date, anchorMinute: number, pointerMinute: number, step: number, bounds: TimeBounds): DateRange;
|
|
272
|
+
/**
|
|
273
|
+
* New range when moving an item so the point grabbed (`grabOffsetMinutes`
|
|
274
|
+
* after its start) follows the pointer on `day`. Keeps the duration (in
|
|
275
|
+
* elapsed time, so a move never resizes across a DST change), snaps the
|
|
276
|
+
* start to `step`, and keeps a single-day item inside `bounds`.
|
|
277
|
+
*/
|
|
278
|
+
export declare function computeMoveRange(original: DateRange, day: Date, pointerMinute: number, grabOffsetMinutes: number, step: number, bounds: TimeBounds): DateRange;
|
|
279
|
+
/**
|
|
280
|
+
* New end when dragging an item's end edge on `day` (the day of its last
|
|
281
|
+
* segment). The end snaps to `step` and stays at least one step after the
|
|
282
|
+
* start (or the day's start, for an item that began earlier).
|
|
283
|
+
*/
|
|
284
|
+
export declare function computeResizeEnd(original: DateRange, day: Date, pointerMinute: number, step: number, bounds: TimeBounds): Date;
|
|
285
|
+
/**
|
|
286
|
+
* Keyboard nudge (Alt+arrow) by `minutes`, keeping the elapsed duration.
|
|
287
|
+
* Like a pointer move, an item inside the visible window stays inside it, so
|
|
288
|
+
* it never scrolls out of view and takes focus with it.
|
|
289
|
+
*/
|
|
290
|
+
export declare function computeNudgeRange(range: DateRange, minutes: number, bounds: TimeBounds): DateRange;
|
|
291
|
+
/** Moves a range by wall-clock minutes. */
|
|
292
|
+
export declare function shiftRange(range: DateRange, minutes: number): DateRange;
|
|
293
|
+
/** Moves a range by whole days, keeping wall-clock times. */
|
|
294
|
+
export declare function shiftRangeDays(range: DateRange, days: number): DateRange;
|
|
295
|
+
/** Whether two ranges are the same instants. */
|
|
296
|
+
export declare function sameRange(a: DateRange, b: DateRange): boolean;
|
|
297
|
+
/** Whether an event belongs in the all-day row rather than the time grid. */
|
|
298
|
+
export declare function isAllDayLike(item: {
|
|
299
|
+
allDay?: boolean;
|
|
300
|
+
start: Date;
|
|
301
|
+
end: Date;
|
|
302
|
+
}): boolean;
|
|
303
|
+
/** Events touching `day`, all-day first then by start time and length. */
|
|
304
|
+
export declare function eventsOnDay<E extends CalendarEvent>(events: readonly E[], day: Date): E[];
|
|
305
|
+
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../src/lib/calendar.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB,KAAK,GACL,UAAU,GACV,UAAU,GACV,MAAM,GACN,OAAO,GACP,QAAQ,GACR,UAAU,CAAC;AAEf,2DAA2D;AAC3D,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEhD,6DAA6D;AAC7D,MAAM,MAAM,aAA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AAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;CACX,GAAG,OAAO,CAKV;AAED,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,CAAC,SAAS,aAAa,EACjD,MAAM,EAAE,SAAS,CAAC,EAAE,EACpB,GAAG,EAAE,IAAI,GACR,CAAC,EAAE,CAkBL"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface CodeEdit {
|
|
2
|
+
slots: string[];
|
|
3
|
+
/** Box to focus after the edit. */
|
|
4
|
+
focus: number;
|
|
5
|
+
}
|
|
6
|
+
/** Spreads `value`'s digits across `length` slots; anything else is dropped. */
|
|
7
|
+
export declare function toSlots(value: string, length: number): string[];
|
|
8
|
+
/**
|
|
9
|
+
* Works out what the user added to a box. A box that already held a digit
|
|
10
|
+
* and still contains it received an insertion; that text ends at the caret.
|
|
11
|
+
* Otherwise (empty box, or the selected digit was replaced) it's the raw value.
|
|
12
|
+
*/
|
|
13
|
+
export declare function insertedText(raw: string, current: string, caret: number | null): string;
|
|
14
|
+
/**
|
|
15
|
+
* Applies text arriving in box `index` from typing, autofill or paste.
|
|
16
|
+
* Returns null when the text isn't usable, so the edit is ignored.
|
|
17
|
+
*
|
|
18
|
+
* - A standalone run of exactly `length` digits anywhere in the text (e.g.
|
|
19
|
+
* "Your code is 123456") replaces the whole code.
|
|
20
|
+
* - Text made only of digits, spaces and dashes fills from `index` onward,
|
|
21
|
+
* or replaces the whole code when it holds exactly `length` digits.
|
|
22
|
+
*/
|
|
23
|
+
export declare function applyText(slots: readonly string[], index: number, text: string): CodeEdit | null;
|
|
24
|
+
/** Handles an input event on box `index`; an empty value clears that box. */
|
|
25
|
+
export declare function applyInput(slots: readonly string[], index: number, raw: string, caret: number | null): CodeEdit | null;
|
|
26
|
+
/** Backspace clears the box, or steps back and clears the previous one. */
|
|
27
|
+
export declare function applyBackspace(slots: readonly string[], index: number): CodeEdit | null;
|
|
28
|
+
//# sourceMappingURL=codeInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codeInput.d.ts","sourceRoot":"","sources":["../../src/lib/codeInput.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,gFAAgF;AAChF,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAG/D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GAAG,IAAI,GACnB,MAAM,CAKR;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX,QAAQ,GAAG,IAAI,CAiBjB;AAED,6EAA6E;AAC7E,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GAAG,IAAI,GACnB,QAAQ,GAAG,IAAI,CAOjB;AAED,2EAA2E;AAC3E,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,KAAK,EAAE,MAAM,GACZ,QAAQ,GAAG,IAAI,CAMjB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** A single rule shown by `PasswordRequirements`. */
|
|
2
|
+
export interface PasswordRequirement {
|
|
3
|
+
/** Shown in the checklist. Must be unique within a rule list. */
|
|
4
|
+
label: string;
|
|
5
|
+
/** Returns true when `password` satisfies this rule. */
|
|
6
|
+
test: (password: string) => boolean;
|
|
7
|
+
}
|
|
8
|
+
/** Length, upper, lower and digit — a sensible default rule set. Frozen. */
|
|
9
|
+
export declare const defaultPasswordRequirements: readonly PasswordRequirement[];
|
|
10
|
+
/** True when `password` passes every rule — use it in submit validation. */
|
|
11
|
+
export declare function meetsPasswordRequirements(password: string, requirements?: readonly PasswordRequirement[]): boolean;
|
|
12
|
+
//# sourceMappingURL=passwordRequirements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"passwordRequirements.d.ts","sourceRoot":"","sources":["../../src/lib/passwordRequirements.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,MAAM,WAAW,mBAAmB;IAClC,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;CACrC;AASD,4EAA4E;AAC5E,eAAO,MAAM,2BAA2B,EAAE,SAAS,mBAAmB,EAC7C,CAAC;AAE1B,4EAA4E;AAC5E,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,YAAY,GAAE,SAAS,mBAAmB,EAAgC,WAG3E"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type QrErrorCorrection = "L" | "M" | "Q" | "H";
|
|
2
|
+
export interface QrMatrix {
|
|
3
|
+
/** Modules per side (21 for version 1, +4 per version). */
|
|
4
|
+
readonly size: number;
|
|
5
|
+
readonly version: number;
|
|
6
|
+
/** `modules[y][x]`, `true` for a dark module. */
|
|
7
|
+
readonly modules: ReadonlyArray<ReadonlyArray<boolean>>;
|
|
8
|
+
}
|
|
9
|
+
/** Thrown when the text doesn't fit in a version 40 symbol at the chosen level. */
|
|
10
|
+
export declare class QrCapacityError extends RangeError {
|
|
11
|
+
constructor();
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Encodes `text` (UTF-8, byte mode) as a QR Code matrix. Throws a RangeError
|
|
15
|
+
* if the level isn't L/M/Q/H, and a QrCapacityError (also a RangeError) if the
|
|
16
|
+
* text is too long for a version 40 symbol at that level (2,953 bytes at L,
|
|
17
|
+
* 2,331 at M, 1,663 at Q, 1,273 at H).
|
|
18
|
+
*/
|
|
19
|
+
export declare function encodeQrCode(text: string, errorCorrection?: QrErrorCorrection): QrMatrix;
|
|
20
|
+
//# sourceMappingURL=qrCode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qrCode.d.ts","sourceRoot":"","sources":["../../src/lib/qrCode.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,iBAAiB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEtD,MAAM,WAAW,QAAQ;IACvB,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;CACzD;AAED,mFAAmF;AACnF,qBAAa,eAAgB,SAAQ,UAAU;;CAK9C;AAwXD;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,eAAe,GAAE,iBAAuB,GACvC,QAAQ,CA8CV"}
|