@alfadocs/ui-kit-debug 1.13.0 → 1.14.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/dist/_chunks/actions-cell-renderer-yy03OgRL.js +137 -0
- package/dist/_chunks/actions-cell-renderer-yy03OgRL.js.map +1 -0
- package/dist/_chunks/{balance-badge-cell--iQ_gtmi.js → balance-badge-cell-CgkxYO96.js} +7 -6
- package/dist/_chunks/{balance-badge-cell--iQ_gtmi.js.map → balance-badge-cell-CgkxYO96.js.map} +1 -1
- package/dist/_chunks/{calendar-B4Gnyu1C.js → calendar-CHT9Rm3M.js} +2 -2
- package/dist/_chunks/{calendar-B4Gnyu1C.js.map → calendar-CHT9Rm3M.js.map} +1 -1
- package/dist/_chunks/{calendar-event-card-Bjdbik8G.js → calendar-event-card-BjdHZaqz.js} +18 -14
- package/dist/_chunks/{calendar-event-card-Bjdbik8G.js.map → calendar-event-card-BjdHZaqz.js.map} +1 -1
- package/dist/_chunks/calendar-plus-BFrIRE4r.js +19 -0
- package/dist/_chunks/calendar-plus-BFrIRE4r.js.map +1 -0
- package/dist/_chunks/calendar-workspace-DI49_t6t.js +7429 -0
- package/dist/_chunks/calendar-workspace-DI49_t6t.js.map +1 -0
- package/dist/_chunks/clipboard-list-rSzfIYZB.js +25 -0
- package/dist/_chunks/clipboard-list-rSzfIYZB.js.map +1 -0
- package/dist/_chunks/{color-picker-oZ6zYks8.js → color-picker-CU303VjY.js} +4 -2
- package/dist/_chunks/{color-picker-oZ6zYks8.js.map → color-picker-CU303VjY.js.map} +1 -1
- package/dist/_chunks/data-table-DC5rO3Ty.js +1817 -0
- package/dist/_chunks/data-table-DC5rO3Ty.js.map +1 -0
- package/dist/_chunks/{field-value-DG8zaZvo.js → field-value-D-vkX9uL.js} +120 -140
- package/dist/_chunks/field-value-D-vkX9uL.js.map +1 -0
- package/dist/_chunks/{file-manager-UsD8e_AB.js → file-manager-DJMeB3V8.js} +138 -153
- package/dist/_chunks/file-manager-DJMeB3V8.js.map +1 -0
- package/dist/_chunks/folder-plus-CutOs4DP.js +22 -0
- package/dist/_chunks/folder-plus-CutOs4DP.js.map +1 -0
- package/dist/_chunks/hourglass-BEAzW1wE.js +26 -0
- package/dist/_chunks/hourglass-BEAzW1wE.js.map +1 -0
- package/dist/_chunks/{notes-panel-CymneXtl.js → notes-panel-DYAtlq_i.js} +2 -2
- package/dist/_chunks/{notes-panel-CymneXtl.js.map → notes-panel-DYAtlq_i.js.map} +1 -1
- package/dist/_chunks/{patient-details-BQaUzPqp.js → patient-details-BfzvFnxQ.js} +73 -92
- package/dist/_chunks/patient-details-BfzvFnxQ.js.map +1 -0
- package/dist/_chunks/{patient-summary-card-CvDxhbBR.js → patient-summary-card-D5Vfa321.js} +2 -2
- package/dist/_chunks/{patient-summary-card-CvDxhbBR.js.map → patient-summary-card-D5Vfa321.js.map} +1 -1
- package/dist/_chunks/{practice-results-D7ygCj_W.js → practice-results-DL_ExLYE.js} +159 -172
- package/dist/_chunks/practice-results-DL_ExLYE.js.map +1 -0
- package/dist/_chunks/{rich-text-editor-BDfFtK4H.js → rich-text-editor-DtbcA6s1.js} +2 -2
- package/dist/_chunks/{rich-text-editor-BDfFtK4H.js.map → rich-text-editor-DtbcA6s1.js.map} +1 -1
- package/dist/_chunks/signature-CpFNpsVK.js +21 -0
- package/dist/_chunks/signature-CpFNpsVK.js.map +1 -0
- package/dist/_chunks/{signature-field-0rFODJlW.js → signature-field-CEiPe-vX.js} +19 -34
- package/dist/_chunks/signature-field-CEiPe-vX.js.map +1 -0
- package/dist/_chunks/smartphone-C0rFF2if.js +15 -0
- package/dist/_chunks/smartphone-C0rFF2if.js.map +1 -0
- package/dist/_chunks/{toast.agent-D1tdg6DS.js → toast-YZz2sBzB.js} +160 -212
- package/dist/_chunks/toast-YZz2sBzB.js.map +1 -0
- package/dist/_chunks/toast.agent-DNQ0JYGv.js +56 -0
- package/dist/_chunks/toast.agent-DNQ0JYGv.js.map +1 -0
- package/dist/_chunks/{workflow-map-wcw3t6g4.js → workflow-map-dNzJjBWG.js} +103 -112
- package/dist/_chunks/workflow-map-dNzJjBWG.js.map +1 -0
- package/dist/agent-catalog.json +867 -1
- package/dist/agent-i18n/en.json +27 -0
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/calendar-event-card/index.js +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/data-table/index.js +39 -38
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/signature-field/index.js +1 -1
- package/dist/components/toast/index.js +7 -6
- package/dist/components/toast/index.js.map +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +680 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +680 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +680 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +680 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +680 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +680 -0
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +680 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +680 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +680 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +680 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +680 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +680 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +680 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +680 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +680 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +680 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +680 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +680 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +680 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +680 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +680 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +680 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +680 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +680 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +680 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +680 -0
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +680 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +680 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +680 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +680 -0
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +680 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +680 -0
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +680 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +680 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +680 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +680 -0
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +821 -803
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +680 -0
- package/dist/locales/de.json +680 -0
- package/dist/locales/el.json +680 -0
- package/dist/locales/en.json +680 -0
- package/dist/locales/es.json +680 -0
- package/dist/locales/fr.json +680 -0
- package/dist/locales/hi.json +680 -0
- package/dist/locales/it.json +680 -0
- package/dist/locales/ja.json +680 -0
- package/dist/locales/nl.json +680 -0
- package/dist/locales/pl.json +680 -0
- package/dist/locales/pt.json +680 -0
- package/dist/locales/ro.json +680 -0
- package/dist/locales/ru.json +680 -0
- package/dist/locales/sq.json +680 -0
- package/dist/locales/sv.json +680 -0
- package/dist/locales/tr.json +680 -0
- package/dist/locales/zh.json +680 -0
- package/dist/patterns/calendar/calendar-workspace.d.ts +62 -0
- package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar-workspace.model.d.ts +358 -0
- package/dist/patterns/calendar/calendar-workspace.model.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar.data.d.ts +122 -0
- package/dist/patterns/calendar/calendar.data.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar.host.d.ts +10 -0
- package/dist/patterns/calendar/calendar.host.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar.journey.d.ts +119 -0
- package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar.model.d.ts +684 -0
- package/dist/patterns/calendar/calendar.model.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar.preferences.d.ts +74 -0
- package/dist/patterns/calendar/calendar.preferences.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar.sheets.d.ts +398 -0
- package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar.surface.d.ts +77 -0
- package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar.types.d.ts +413 -0
- package/dist/patterns/calendar/calendar.types.d.ts.map +1 -0
- package/dist/patterns/calendar/index.d.ts +13 -0
- package/dist/patterns/calendar/index.d.ts.map +1 -0
- package/dist/patterns/calendar/index.js +19 -0
- package/dist/patterns/calendar/index.js.map +1 -0
- package/package.json +5 -1
- package/dist/_chunks/actions-cell-renderer-ReurEy5i.js +0 -1945
- package/dist/_chunks/actions-cell-renderer-ReurEy5i.js.map +0 -1
- package/dist/_chunks/field-value-DG8zaZvo.js.map +0 -1
- package/dist/_chunks/file-manager-UsD8e_AB.js.map +0 -1
- package/dist/_chunks/patient-details-BQaUzPqp.js.map +0 -1
- package/dist/_chunks/practice-results-D7ygCj_W.js.map +0 -1
- package/dist/_chunks/signature-field-0rFODJlW.js.map +0 -1
- package/dist/_chunks/toast.agent-D1tdg6DS.js.map +0 -1
- package/dist/_chunks/workflow-map-wcw3t6g4.js.map +0 -1
|
@@ -0,0 +1,684 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar demo — the pure model: row and display types, the editor's
|
|
3
|
+
* prefill / draft shapes, recurrence, the history ledger, the Backlog
|
|
4
|
+
* queue, closures and availability shading, the print-sheet builder and
|
|
5
|
+
* the free-slot search. No React, no i18n lookups (`closureReason`
|
|
6
|
+
* takes the caller's `t`). Shared by the Final State (rail) demo and the
|
|
7
|
+
* Increment 1 workspace, so both compute from one source. Every read of
|
|
8
|
+
* practice data goes through the explicit `data: CalendarData` parameter
|
|
9
|
+
* — the host supplies it, the model never reaches for a module global.
|
|
10
|
+
*/
|
|
11
|
+
import type { TFunction } from 'i18next';
|
|
12
|
+
import { ThumbsUp } from 'lucide-react';
|
|
13
|
+
import { type CalendarEvent, type CalendarEventStatus, type CalendarResource } from '../../components/calendar';
|
|
14
|
+
import type { CalendarData } from './calendar.data';
|
|
15
|
+
import { type CareDescriptionMode, type ColorAssociation, type CalendarBaseEvent, type CalendarBookingContact, type CalendarCareEntry, type CalendarCareLink, type CalendarClosure, type CalendarDayHours, type CalendarHistoryEntry, type CalendarPatient, type CalendarPhoneNumber, type CalendarSignDocument, type CalendarWaitingEntry } from './calendar.types';
|
|
16
|
+
export declare const STATUS_UI_KEY: Record<CalendarEventStatus, string>;
|
|
17
|
+
export interface CalendarRow {
|
|
18
|
+
event: CalendarEvent;
|
|
19
|
+
chairId?: string;
|
|
20
|
+
operatorId?: string;
|
|
21
|
+
/** Set on every occurrence of a repeating series. */
|
|
22
|
+
series?: CalendarSeries;
|
|
23
|
+
/** Care entries — the card's care line derives from these per cog mode. */
|
|
24
|
+
cares?: CalendarCareEntry[];
|
|
25
|
+
/** Free-text description (platform `name`); fixtures carry none. */
|
|
26
|
+
description?: string;
|
|
27
|
+
/** Where the cares came from — a care plan's lines or a price list. */
|
|
28
|
+
careLink?: CalendarCareLink;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A drag/resize of a PATIENT appointment awaiting confirmation (ported
|
|
32
|
+
* from the appointment-workflow pattern's move-confirm design). Rows stay
|
|
33
|
+
* UN-mutated while the dialog is open, so the OLD end/chair/operator are
|
|
34
|
+
* read live from the matching `CalendarRow`; `event` is FullCalendar's
|
|
35
|
+
* post-drop snapshot and already carries the NEW resourceId.
|
|
36
|
+
*/
|
|
37
|
+
export interface PendingMove {
|
|
38
|
+
event: CalendarEvent;
|
|
39
|
+
kind: 'drop' | 'resize';
|
|
40
|
+
oldStart: Date;
|
|
41
|
+
newStart: Date;
|
|
42
|
+
oldEnd?: Date;
|
|
43
|
+
/** Post-drop end, snapshotted so a re-commit cannot re-apply the delta. */
|
|
44
|
+
newEnd?: Date;
|
|
45
|
+
/** Post-drop column. `event.resourceId` still reports the OLD one. */
|
|
46
|
+
newResourceId?: string;
|
|
47
|
+
revert?: () => void;
|
|
48
|
+
}
|
|
49
|
+
export declare function movesSilently(event: CalendarEvent): boolean;
|
|
50
|
+
export declare function isPendingBooking(event: CalendarEvent): boolean;
|
|
51
|
+
export declare function selectPendingBookings(rows: CalendarRow[]): CalendarRow[];
|
|
52
|
+
/**
|
|
53
|
+
* What a grid click focused in the rail. A FRESH object per click (not a
|
|
54
|
+
* bare id) so re-clicking the same event re-docks its panel after the user
|
|
55
|
+
* collapsed the rail — the registrar's effect keys on the object identity.
|
|
56
|
+
*/
|
|
57
|
+
export type RailFocus = {
|
|
58
|
+
kind: 'appointment';
|
|
59
|
+
eventId: string;
|
|
60
|
+
} | {
|
|
61
|
+
kind: 'task';
|
|
62
|
+
eventId: string;
|
|
63
|
+
} | null;
|
|
64
|
+
/**
|
|
65
|
+
* The RANGE views of the standard calendar experience — a dedicated
|
|
66
|
+
* segmented split button in the header (Day · 3 days · Working week ·
|
|
67
|
+
* Week · Month). The chair/operator axis and the columns/timeline
|
|
68
|
+
* orientation are NOT views: they are per-user display settings and live
|
|
69
|
+
* in the cog. Month has no resource variant (platform parity) — it is
|
|
70
|
+
* always the plain calendar.
|
|
71
|
+
*/
|
|
72
|
+
export type ViewOptionId = 'day' | 'threeDays' | 'workingWeek' | 'week' | 'month';
|
|
73
|
+
export interface ViewOption {
|
|
74
|
+
id: ViewOptionId;
|
|
75
|
+
/** CalendarView stem — composed with the cog's group-by axis. */
|
|
76
|
+
stem: 'Day' | 'ThreeDays' | 'Week' | 'Month';
|
|
77
|
+
/** Working week trims the weekend regardless of the Sundays setting. */
|
|
78
|
+
workingWeek?: boolean;
|
|
79
|
+
}
|
|
80
|
+
export declare const VIEW_OPTIONS: ViewOption[];
|
|
81
|
+
/**
|
|
82
|
+
* On-the-fly DISPLAY settings — the platform buries these per-user knobs in
|
|
83
|
+
* Settings; the sketch surfaces them in a header cog so users adjust the
|
|
84
|
+
* view without leaving the agenda. The view knobs are display-only and
|
|
85
|
+
* instantly reversible. The cog also carries the two per-user data-entry
|
|
86
|
+
* defaults (care description, colour association): they govern what NEW or
|
|
87
|
+
* MOVED appointments get, never what is already painted. Default duration
|
|
88
|
+
* and the business hours themselves stay in Settings.
|
|
89
|
+
*/
|
|
90
|
+
export interface DisplaySettings {
|
|
91
|
+
/** Which resource axis the columns/rows group by. */
|
|
92
|
+
resourceKind: 'chair' | 'operator' | 'none';
|
|
93
|
+
/** Vertical resource columns vs the horizontal timeline. */
|
|
94
|
+
orientation: 'vertical' | 'horizontal';
|
|
95
|
+
zebraRows: boolean;
|
|
96
|
+
showTime: boolean;
|
|
97
|
+
slotDuration: '00:15' | '00:30' | '01:00';
|
|
98
|
+
window: 'working' | 'extended' | 'full';
|
|
99
|
+
/** How the card describes its cares (platform care visualization). */
|
|
100
|
+
careDescription: CareDescriptionMode;
|
|
101
|
+
/** Which colour a new or moved appointment inherits. */
|
|
102
|
+
colorAssociation: ColorAssociation;
|
|
103
|
+
}
|
|
104
|
+
export declare const DEFAULT_DISPLAY: DisplaySettings;
|
|
105
|
+
/** A remembered range view, only while the segment still exists. */
|
|
106
|
+
export declare function readViewOptionId(raw: unknown): ViewOptionId | undefined;
|
|
107
|
+
export declare const DISPLAY_READERS: {
|
|
108
|
+
[K in keyof DisplaySettings]: (raw: unknown) => DisplaySettings[K] | undefined;
|
|
109
|
+
};
|
|
110
|
+
export declare function readDisplayField<K extends keyof DisplaySettings>(target: DisplaySettings, field: K, raw: unknown): void;
|
|
111
|
+
/**
|
|
112
|
+
* Remembered display settings, validated PER FIELD over the defaults —
|
|
113
|
+
* a stale shape from an earlier session keeps every knob it still knows
|
|
114
|
+
* and never wipes the newer ones. Anything but an object is rejected.
|
|
115
|
+
*/
|
|
116
|
+
export declare function readDisplaySettings(raw: unknown): DisplaySettings | undefined;
|
|
117
|
+
/** Remembered chair / operator selections, kept to the practice's ids. */
|
|
118
|
+
export declare function readChairIds(data: CalendarData): (raw: unknown) => string[] | undefined;
|
|
119
|
+
export declare function readOperatorIds(data: CalendarData): (raw: unknown) => string[] | undefined;
|
|
120
|
+
/** Tri-state for a select-all row over `ids`. */
|
|
121
|
+
export declare function selectionState(selected: readonly string[], ids: readonly string[]): boolean | 'indeterminate';
|
|
122
|
+
/** Time-only Intl options for the peek's semantic `<time>` pair. */
|
|
123
|
+
export declare const PEEK_TIME_FORMAT: Intl.DateTimeFormatOptions;
|
|
124
|
+
export declare const DAY_WINDOWS: Record<DisplaySettings['window'], {
|
|
125
|
+
min: string;
|
|
126
|
+
max: string;
|
|
127
|
+
}>;
|
|
128
|
+
export declare function formatTimeRange(locale: string, start: Date | string, end?: Date | string): string;
|
|
129
|
+
export declare function formatDay(locale: string, value: Date | string): string;
|
|
130
|
+
/** Completed years between a birth date and the practice's fixed "now" —
|
|
131
|
+
* the platform popover's "(NN anni)" beside the patient's name. Pinned
|
|
132
|
+
* to `data.nowIso` so the figure never drifts under a test. */
|
|
133
|
+
export declare function patientAgeYears(dobIso: string, data: CalendarData): number;
|
|
134
|
+
export interface EditorPrefill {
|
|
135
|
+
/** Set = the editor EDITS this existing event; unset = create. */
|
|
136
|
+
editEventId?: string;
|
|
137
|
+
patientId?: string;
|
|
138
|
+
isTelehealth?: boolean;
|
|
139
|
+
date?: Date;
|
|
140
|
+
time?: {
|
|
141
|
+
hours: number;
|
|
142
|
+
minutes: number;
|
|
143
|
+
};
|
|
144
|
+
durationMin?: number;
|
|
145
|
+
operatorId?: string;
|
|
146
|
+
chairId?: string;
|
|
147
|
+
colorHex?: string;
|
|
148
|
+
care?: string;
|
|
149
|
+
/** Care entries riding along (an edit, or a find-free-slots hand-off). */
|
|
150
|
+
cares?: CalendarCareEntry[];
|
|
151
|
+
/** The plan lines or price-list picks the cares came from. */
|
|
152
|
+
careLink?: CalendarCareLink;
|
|
153
|
+
allDay?: boolean;
|
|
154
|
+
status?: CalendarEventStatus;
|
|
155
|
+
/** Online-booking triage: what the person typed on the booking site
|
|
156
|
+
* (no patient record yet). Drives the booker block + the platform's
|
|
157
|
+
* "search for this patient below" call to action. */
|
|
158
|
+
bookingContact?: CalendarBookingContact;
|
|
159
|
+
/** The waiting-list entry this save settles — it leaves the queue when
|
|
160
|
+
* the save lands (Schedule creates, Bring forward moves). */
|
|
161
|
+
waitingEntryId?: string;
|
|
162
|
+
/** Backlog hand-off: what this edit must settle — a booking needs a
|
|
163
|
+
* patient AND an operator; an operator-less appointment needs one. */
|
|
164
|
+
callToAction?: 'processBooking' | 'assignOperator';
|
|
165
|
+
/** The platform's `simpleSave`. `false` — a deep-link arrival that has
|
|
166
|
+
* somewhere to go back to — splits Save into "save and go back" and
|
|
167
|
+
* "save and continue"; anything else keeps the one Save. */
|
|
168
|
+
simpleSave?: boolean;
|
|
169
|
+
}
|
|
170
|
+
/** Platform's six `recurrence_frequency` values, in its dropdown order. */
|
|
171
|
+
export type RecurrenceFrequency = 'daily' | 'weekly' | 'monthly' | 'quarterly' | 'semiannual' | 'yearly';
|
|
172
|
+
/** Repetition cap — platform asserts 2..100 on the entity. */
|
|
173
|
+
export declare const RECURRENCE_MAX_COUNT = 100;
|
|
174
|
+
/** Dropdown order, matching the platform modal's own. */
|
|
175
|
+
export declare const RECURRENCE_FREQUENCIES: readonly RecurrenceFrequency[];
|
|
176
|
+
/** Literal map (not a template) so key extractors see every key. */
|
|
177
|
+
export declare const RECURRENCE_LABEL_KEY: Record<RecurrenceFrequency, string>;
|
|
178
|
+
export interface EditorRecurrence {
|
|
179
|
+
frequency: RecurrenceFrequency;
|
|
180
|
+
/** Count XOR until — the exclusivity `DoctorAppointment` enforces. */
|
|
181
|
+
ends: 'count' | 'until';
|
|
182
|
+
/** Occurrences INCLUDING the first, when `ends === 'count'`. */
|
|
183
|
+
count: number;
|
|
184
|
+
/** Last date an occurrence may land on, when `ends === 'until'`. */
|
|
185
|
+
untilDate?: Date;
|
|
186
|
+
/** Beyond platform: drop occurrences the practice could not honour. */
|
|
187
|
+
skipClosedDays: boolean;
|
|
188
|
+
}
|
|
189
|
+
/** Step per frequency. Platform's RRULE factory has no QUARTERLY or
|
|
190
|
+
* SEMIANNUAL freq either — it rewrites both to MONTHLY with INTERVAL
|
|
191
|
+
* 3 / 6, which is the same arithmetic. */
|
|
192
|
+
export declare const RECURRENCE_STEP: Record<RecurrenceFrequency, {
|
|
193
|
+
days?: number;
|
|
194
|
+
months?: number;
|
|
195
|
+
}>;
|
|
196
|
+
/** Month arithmetic that never rolls over: 31 Jan + 1 month is 28/29
|
|
197
|
+
* Feb, not 2/3 March (what a naive `setMonth` would give). */
|
|
198
|
+
export declare function addMonthsClamped(base: Date, months: number): Date;
|
|
199
|
+
/**
|
|
200
|
+
* A day this appointment cannot be honoured: the practice is shut (no
|
|
201
|
+
* business hours for that weekday) or the chosen operator is away.
|
|
202
|
+
* Chair-only bookings check the practice alone.
|
|
203
|
+
*/
|
|
204
|
+
export declare function isUnbookableDay(date: Date, operatorId: string | undefined, data: CalendarData): boolean;
|
|
205
|
+
/**
|
|
206
|
+
* Expand a rule into the dates that actually get booked. Skipped
|
|
207
|
+
* candidates do NOT consume the count — asking for 4 appointments
|
|
208
|
+
* yields 4 appointments, with the closed days stepped over rather than
|
|
209
|
+
* silently swallowing an occurrence.
|
|
210
|
+
*/
|
|
211
|
+
export declare function expandRecurrence(start: Date, rule: EditorRecurrence, operatorId: string | undefined, data: CalendarData): {
|
|
212
|
+
dates: Date[];
|
|
213
|
+
skipped: number;
|
|
214
|
+
};
|
|
215
|
+
/** What an occurrence knows about the series it belongs to — drives the
|
|
216
|
+
* details panel's read-only summary (platform disables the recurrence
|
|
217
|
+
* inputs once an appointment exists, so this is the only place the
|
|
218
|
+
* rule surfaces after saving). */
|
|
219
|
+
export interface CalendarSeries {
|
|
220
|
+
id: string;
|
|
221
|
+
frequency: RecurrenceFrequency;
|
|
222
|
+
/** 1-based position of this occurrence. */
|
|
223
|
+
index: number;
|
|
224
|
+
total: number;
|
|
225
|
+
lastIso: string;
|
|
226
|
+
/** Candidates dropped as closed/absent days. */
|
|
227
|
+
skipped: number;
|
|
228
|
+
}
|
|
229
|
+
export interface EditorDraft {
|
|
230
|
+
editEventId?: string;
|
|
231
|
+
patientId?: string;
|
|
232
|
+
isTelehealth: boolean;
|
|
233
|
+
date: Date;
|
|
234
|
+
time: {
|
|
235
|
+
hours: number;
|
|
236
|
+
minutes: number;
|
|
237
|
+
};
|
|
238
|
+
durationMin: number;
|
|
239
|
+
operatorId?: string;
|
|
240
|
+
chairId?: string;
|
|
241
|
+
colorHex: string;
|
|
242
|
+
care?: string;
|
|
243
|
+
cares?: CalendarCareEntry[];
|
|
244
|
+
careLink?: CalendarCareLink;
|
|
245
|
+
/** The waiting-list entry this save settles (removed from the queue). */
|
|
246
|
+
waitingEntryId?: string;
|
|
247
|
+
allDay?: boolean;
|
|
248
|
+
/** Platform "Lista d'attesa" checkbox — also queue the patient. */
|
|
249
|
+
addToWaitingList?: boolean;
|
|
250
|
+
/** Edit mode only — the platform changes status from the popover, but
|
|
251
|
+
the rail's details-as-form surface owns it here. */
|
|
252
|
+
status?: CalendarEventStatus;
|
|
253
|
+
/** Create only, matching platform (its recurrence inputs go disabled
|
|
254
|
+
the moment an appointment id exists). */
|
|
255
|
+
recurrence?: EditorRecurrence;
|
|
256
|
+
}
|
|
257
|
+
/** Full-edit prefill for an existing grid event. */
|
|
258
|
+
export declare function editPrefillFromRow(row: CalendarRow): EditorPrefill;
|
|
259
|
+
/**
|
|
260
|
+
* The slot an open editor is composing, mirrored on the grid as a draft
|
|
261
|
+
* placeholder so the user can see WHICH timeslot they picked. Carries
|
|
262
|
+
* `editEventId` when editing an existing appointment — the mirror is
|
|
263
|
+
* suppressed there, since the real card is already on the grid.
|
|
264
|
+
*/
|
|
265
|
+
export interface DraftSlot {
|
|
266
|
+
editEventId?: string;
|
|
267
|
+
date: Date;
|
|
268
|
+
time: {
|
|
269
|
+
hours: number;
|
|
270
|
+
minutes: number;
|
|
271
|
+
};
|
|
272
|
+
durationMin: number;
|
|
273
|
+
allDay: boolean;
|
|
274
|
+
chairId?: string;
|
|
275
|
+
operatorId?: string;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* A slot edit made ON THE GRID (dragging or resizing the draft mirror),
|
|
279
|
+
* pushed back into the open editor. Applied by `tick` so it patches only
|
|
280
|
+
* the slot fields — the patient, care, colour and the rest of the form
|
|
281
|
+
* survive untouched.
|
|
282
|
+
*/
|
|
283
|
+
export interface SlotPatch {
|
|
284
|
+
tick: number;
|
|
285
|
+
date?: Date;
|
|
286
|
+
time?: {
|
|
287
|
+
hours: number;
|
|
288
|
+
minutes: number;
|
|
289
|
+
};
|
|
290
|
+
durationMin?: number;
|
|
291
|
+
chairId?: string;
|
|
292
|
+
operatorId?: string;
|
|
293
|
+
}
|
|
294
|
+
export declare const DRAFT_SNAP = "00:15";
|
|
295
|
+
export declare const NONE = "none";
|
|
296
|
+
export declare const DURATION_PRESETS_MIN: number[];
|
|
297
|
+
export declare function durationDigitsFilter(candidate: string, search: string): number;
|
|
298
|
+
/**
|
|
299
|
+
* The editor's opening colour (platform `_setStateColorId` on mount): an
|
|
300
|
+
* existing appointment keeps its stored colour; a new one under operator or
|
|
301
|
+
* chair association adopts the preselected resource's colour, under care
|
|
302
|
+
* association the hand-off's colour, else the first catalogued care's.
|
|
303
|
+
*/
|
|
304
|
+
export declare function initialEditorColor(prefill: EditorPrefill | undefined, association: ColorAssociation, data: CalendarData): string;
|
|
305
|
+
/** A plan line's booked appointments — entry id → [{ eventId, startIso }]
|
|
306
|
+
* in start order (the checklist's "scheduled" chips, the rail's links). */
|
|
307
|
+
export declare function scheduleByEntryId(rows: ReadonlyArray<{
|
|
308
|
+
event: {
|
|
309
|
+
id: string;
|
|
310
|
+
start: string | Date;
|
|
311
|
+
};
|
|
312
|
+
careLink?: CalendarCareLink;
|
|
313
|
+
}>): Record<string, Array<{
|
|
314
|
+
eventId: string;
|
|
315
|
+
startIso: string;
|
|
316
|
+
}>>;
|
|
317
|
+
/** What a link implies for the form (platform `_getAppointmentDuration`,
|
|
318
|
+
* `_getColorIdFromCarePlanEntry` / `_getColorIdFromPriceList`): the
|
|
319
|
+
* summed duration, the FIRST line's care colour in plan order, a label. */
|
|
320
|
+
export declare function deriveCareLinkDefaults(link: CalendarCareLink | undefined, data: CalendarData): {
|
|
321
|
+
durationMin?: number;
|
|
322
|
+
colorHex?: string;
|
|
323
|
+
description?: string;
|
|
324
|
+
};
|
|
325
|
+
/** `Omit` that keeps a union's variants apart (plain Omit collapses it). */
|
|
326
|
+
export type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
327
|
+
/** A ledger line before the journey stamps id, time and actor onto it. */
|
|
328
|
+
export type HistoryInput = DistributiveOmit<CalendarHistoryEntry, 'id' | 'atIso' | 'actor'>;
|
|
329
|
+
/** Absolute stamp for booked-at and ledger lines — day and time. */
|
|
330
|
+
export declare const DETAIL_STAMP_FORMAT: Intl.DateTimeFormatOptions;
|
|
331
|
+
/** Live stamps advance from the practice clock, never the real one. */
|
|
332
|
+
export declare function historyStampIso(seq: number, data: CalendarData): string;
|
|
333
|
+
/** Timeline 'newest-first' is a plain column — DOM order must already be. */
|
|
334
|
+
export declare function sortHistoryNewestFirst(entries: readonly CalendarHistoryEntry[]): CalendarHistoryEntry[];
|
|
335
|
+
/** Documents still awaiting a required party (the chip's own rule). */
|
|
336
|
+
export declare function signingSummary(docs: readonly CalendarSignDocument[]): {
|
|
337
|
+
toSign: number;
|
|
338
|
+
allSigned: boolean;
|
|
339
|
+
};
|
|
340
|
+
/**
|
|
341
|
+
* What a Save changed, as ledger lines: a status change, a move (start
|
|
342
|
+
* differs), a resize (other duration) and one `edited` line naming the
|
|
343
|
+
* other fields that differ. Empty when nothing changed.
|
|
344
|
+
*/
|
|
345
|
+
export declare function historyEntriesFromEdit(prev: CalendarRow, draft: EditorDraft, data: CalendarData): HistoryInput[];
|
|
346
|
+
/** One "From price list" row: a care pick and its (editable) price. */
|
|
347
|
+
export interface PriceRow {
|
|
348
|
+
key: number;
|
|
349
|
+
careId: string;
|
|
350
|
+
priceCents: number | null;
|
|
351
|
+
/** Booked subset of the care's catalogue phases (platform per-row
|
|
352
|
+
* phase checkboxes); empty when the care has none. */
|
|
353
|
+
phases?: string[];
|
|
354
|
+
/** Already invoiced — the whole row is read-only (platform "Azione
|
|
355
|
+
* non consentita: Prestazione già fatturata"). */
|
|
356
|
+
billed?: boolean;
|
|
357
|
+
}
|
|
358
|
+
export declare const EMPTY_SCHEDULE: Record<string, Array<{
|
|
359
|
+
eventId: string;
|
|
360
|
+
startIso: string;
|
|
361
|
+
}>>;
|
|
362
|
+
/** The patient's price list by name, else the practice default. */
|
|
363
|
+
export declare function priceListIdFor(patientId: string | undefined, data: CalendarData): string;
|
|
364
|
+
export declare const STATUS_CHIP: Record<CalendarEventStatus, {
|
|
365
|
+
variant: 'success' | 'info' | 'warning' | 'error' | 'accentSoft';
|
|
366
|
+
Icon: typeof ThumbsUp;
|
|
367
|
+
}>;
|
|
368
|
+
export type BacklogType = 'booking' | 'waiting' | 'unconfirmed' | 'noOperator' | 'signature';
|
|
369
|
+
/** The filter strip's segments — every type, or all of them grouped. */
|
|
370
|
+
export type BacklogFilter = BacklogType | 'all';
|
|
371
|
+
/** Group order in the All view (and the strip's segment order). */
|
|
372
|
+
export declare const BACKLOG_TYPES: readonly BacklogType[];
|
|
373
|
+
/** One row of the queue. `startIso` sorts each group in day order. */
|
|
374
|
+
export type BacklogItem = {
|
|
375
|
+
type: 'booking';
|
|
376
|
+
id: string;
|
|
377
|
+
startIso: string;
|
|
378
|
+
row: CalendarRow;
|
|
379
|
+
} | {
|
|
380
|
+
type: 'waiting';
|
|
381
|
+
id: string;
|
|
382
|
+
startIso: string;
|
|
383
|
+
entry: CalendarWaitingEntry;
|
|
384
|
+
} | {
|
|
385
|
+
type: 'unconfirmed';
|
|
386
|
+
id: string;
|
|
387
|
+
startIso: string;
|
|
388
|
+
row: CalendarRow;
|
|
389
|
+
} | {
|
|
390
|
+
type: 'noOperator';
|
|
391
|
+
id: string;
|
|
392
|
+
startIso: string;
|
|
393
|
+
row: CalendarRow;
|
|
394
|
+
} | {
|
|
395
|
+
type: 'signature';
|
|
396
|
+
id: string;
|
|
397
|
+
startIso: string;
|
|
398
|
+
row: CalendarRow;
|
|
399
|
+
toSign: number;
|
|
400
|
+
};
|
|
401
|
+
/** A concluded appointment has nobody left to assign. */
|
|
402
|
+
export declare const SETTLED_STATUSES: ReadonlySet<CalendarEventStatus>;
|
|
403
|
+
/** Epoch ms of an event start — date-only starts are LOCAL midnight. */
|
|
404
|
+
export declare function eventStartMs(iso: string): number;
|
|
405
|
+
/** What the waiting-list entry is about, if a loaded appointment. */
|
|
406
|
+
export declare function waitingEntryAppointment(entry: CalendarWaitingEntry, data: CalendarData): CalendarBaseEvent | undefined;
|
|
407
|
+
/**
|
|
408
|
+
* Derive the whole queue from live state. Bookings, operator-less
|
|
409
|
+
* appointments and pending signatures span the fixture week; unconfirmed
|
|
410
|
+
* appointments are scoped to the grid's visible range (the week would
|
|
411
|
+
* list every not-yet-confirmed filler row). Groups sort by day.
|
|
412
|
+
*/
|
|
413
|
+
export declare function buildBacklog(args: {
|
|
414
|
+
rows: CalendarRow[];
|
|
415
|
+
waitingList: CalendarWaitingEntry[];
|
|
416
|
+
visibleRange: {
|
|
417
|
+
start: number;
|
|
418
|
+
end: number;
|
|
419
|
+
} | null;
|
|
420
|
+
}, data: CalendarData): BacklogItem[];
|
|
421
|
+
/** Per-type counts — the strip's segment badges. */
|
|
422
|
+
export declare function backlogCounts(items: readonly BacklogItem[]): Record<BacklogType, number>;
|
|
423
|
+
/** The patient behind a row (bookings have none — a typed name only). */
|
|
424
|
+
export declare function backlogPatient(item: BacklogItem, data: CalendarData): CalendarPatient | undefined;
|
|
425
|
+
/** The row's headline — patient name, the booker's typed name, or the
|
|
426
|
+
* free-text hold. */
|
|
427
|
+
export declare function backlogName(item: BacklogItem, data: CalendarData): string | undefined;
|
|
428
|
+
/**
|
|
429
|
+
* Text search over what the ROW renders: the patient's name (own, or the
|
|
430
|
+
* linked appointment's) and the description (own, or the linked
|
|
431
|
+
* appointment's care). Case-insensitive substring; empty matches all.
|
|
432
|
+
*/
|
|
433
|
+
export declare function waitingEntryMatches(entry: CalendarWaitingEntry, query: string, data: CalendarData): boolean;
|
|
434
|
+
/** Text search over a row: name, care line, note and operator. */
|
|
435
|
+
export declare function backlogItemMatches(item: BacklogItem, query: string, data: CalendarData): boolean;
|
|
436
|
+
/** The strip segment plus the text search, in one pass. */
|
|
437
|
+
export declare function filterBacklog(items: readonly BacklogItem[], filter: BacklogFilter, query: string, data: CalendarData): BacklogItem[];
|
|
438
|
+
export type WaitingQuickView = 'all' | 'noAppointment' | 'scheduledOver30' | 'waitingOver30';
|
|
439
|
+
export declare const WAITING_QUICK_VIEWS: readonly WaitingQuickView[];
|
|
440
|
+
/** Literal map (not a template) so key extractors see every key. */
|
|
441
|
+
export declare const WAITING_QUICK_VIEW_LABEL_KEY: Record<WaitingQuickView, string>;
|
|
442
|
+
/** The platform's threshold for both "over 30 days" quick views. */
|
|
443
|
+
export declare const WAITING_QUICK_VIEW_DAYS = 30;
|
|
444
|
+
/** Whether an entry passes a quick view, measured from the practice clock. */
|
|
445
|
+
export declare function waitingEntryInQuickView(entry: CalendarWaitingEntry, view: WaitingQuickView, data: CalendarData): boolean;
|
|
446
|
+
/** Apply a quick view to a queue — every non-waiting row passes through
|
|
447
|
+
* untouched (the platform's dropdown only ever saw waiting entries). */
|
|
448
|
+
export declare function filterWaitingQuickView(items: readonly BacklogItem[], view: WaitingQuickView, data: CalendarData): BacklogItem[];
|
|
449
|
+
/**
|
|
450
|
+
* Process an online booking: the editor opens for THAT event with the
|
|
451
|
+
* booker's typed details, a matching record pre-selected, and BOTH the
|
|
452
|
+
* patient and the operator marked required — the two things the booking
|
|
453
|
+
* needs before it leaves the queue.
|
|
454
|
+
*/
|
|
455
|
+
export declare function processBookingPrefill(row: CalendarRow, data: CalendarData): EditorPrefill;
|
|
456
|
+
/** Assign an operator: the editor opens for the event with the operator
|
|
457
|
+
* select as the call to action. */
|
|
458
|
+
export declare function assignOperatorPrefill(row: CalendarRow): EditorPrefill;
|
|
459
|
+
/**
|
|
460
|
+
* Whether the editor's Backlog call to action is settled: processing a
|
|
461
|
+
* booking needs the patient record AND the operator, assigning needs the
|
|
462
|
+
* operator; with no call to action Save is never held back.
|
|
463
|
+
*/
|
|
464
|
+
export declare function callToActionSatisfied(callToAction: EditorPrefill['callToAction'], draft: {
|
|
465
|
+
patientId?: string;
|
|
466
|
+
operatorId?: string;
|
|
467
|
+
}): boolean;
|
|
468
|
+
/** Confirm a waiting appointment in place; other rows untouched. */
|
|
469
|
+
export declare function confirmAppointment(rows: readonly CalendarRow[], eventId: string): CalendarRow[];
|
|
470
|
+
/** What the waiting-list rail sub-view is showing: the queue, or the
|
|
471
|
+
* entry form (add when `entry` is absent, edit when present). */
|
|
472
|
+
export type BacklogSubView = {
|
|
473
|
+
kind: 'queue';
|
|
474
|
+
} | {
|
|
475
|
+
kind: 'form';
|
|
476
|
+
entry?: CalendarWaitingEntry;
|
|
477
|
+
};
|
|
478
|
+
/** What the entry form commits — the journey assigns the id on add. */
|
|
479
|
+
export interface WaitingEntryDraft {
|
|
480
|
+
id?: string;
|
|
481
|
+
patientId?: string;
|
|
482
|
+
operatorId?: string;
|
|
483
|
+
colorHex: string;
|
|
484
|
+
description?: string;
|
|
485
|
+
}
|
|
486
|
+
/** Platform AddModal rule: an entry needs a patient OR a description. */
|
|
487
|
+
export declare function waitingEntryIsValid(draft: Pick<WaitingEntryDraft, 'patientId' | 'description'>): boolean;
|
|
488
|
+
/**
|
|
489
|
+
* Commit the entry form: with an id the matching entry is updated in
|
|
490
|
+
* place (its link and waiting-since survive); without one a new entry
|
|
491
|
+
* joins the end of the queue as of the demo's today.
|
|
492
|
+
*/
|
|
493
|
+
export declare function upsertWaitingEntry(list: readonly CalendarWaitingEntry[], draft: WaitingEntryDraft, newId: string): CalendarWaitingEntry[];
|
|
494
|
+
export declare const ANY = "any";
|
|
495
|
+
export declare const FREE_SLOT_CAP = 20;
|
|
496
|
+
export declare const SLOT_STEP_MIN = 30;
|
|
497
|
+
/** Platform `FreeSlot::MAX_DAYS_TO_LOOK_AHEAD` — the finder warns past it. */
|
|
498
|
+
export declare const FREE_SLOT_MAX_RANGE_DAYS = 185;
|
|
499
|
+
/** Whole days between two dates — the finder's range rule. */
|
|
500
|
+
export declare function rangeDays(from: Date, to: Date): number;
|
|
501
|
+
export interface CalendarFreeSlot {
|
|
502
|
+
start: Date;
|
|
503
|
+
durationMin: number;
|
|
504
|
+
chairId: string;
|
|
505
|
+
operatorId: string;
|
|
506
|
+
/** The care the search was scoped to — carries name/colour into the
|
|
507
|
+
* prefill when a projected slot is clicked on the grid. */
|
|
508
|
+
careId?: string;
|
|
509
|
+
}
|
|
510
|
+
/** Local ISO date (YYYY-MM-DD) — the fixtures' local-wall-clock idiom;
|
|
511
|
+
* absence lookups and shading ids key on local days, never UTC. */
|
|
512
|
+
export declare function localIsoDate(d: Date): string;
|
|
513
|
+
/** The closed complement of one day's working range — up to two
|
|
514
|
+
* segments (midnight→open, close→midnight); a closed day (undefined
|
|
515
|
+
* hours) is one full-day segment. Minutes from local midnight. */
|
|
516
|
+
export declare function dayComplement(hours: CalendarDayHours | undefined): Array<{
|
|
517
|
+
startMin: number;
|
|
518
|
+
endMin: number;
|
|
519
|
+
}>;
|
|
520
|
+
/** Intersect an operator's day with the practice's — closed (undefined)
|
|
521
|
+
* when either side is closed or the overlap is empty. */
|
|
522
|
+
export declare function intersectDayHours(a: CalendarDayHours | undefined, b: CalendarDayHours | undefined): CalendarDayHours | undefined;
|
|
523
|
+
/**
|
|
524
|
+
* Project the COMPLEMENT of the business hours as background events
|
|
525
|
+
* (`unavail-` ids — distinct from the find-slots glow's `avail-`
|
|
526
|
+
* namespace): chair and plain axes shade outside the PRACTICE hours;
|
|
527
|
+
* the operator axis shades outside each operator's own hours
|
|
528
|
+
* (intersected with the practice's), with absence days
|
|
529
|
+
* (`data.operatorAbsences`) washing that operator's whole column.
|
|
530
|
+
* Untitled ON PURPOSE: a titled isInternal event renders the Calendar's
|
|
531
|
+
* "✓ Free" bookable chip — these washes are decorative unavailability,
|
|
532
|
+
* painted by FC's own `.fc-bg-event` rule through the
|
|
533
|
+
* `--fc-bg-event-color` override on the Calendar's className.
|
|
534
|
+
*/
|
|
535
|
+
export declare function buildUnavailabilityEvents(args: {
|
|
536
|
+
axisKind: DisplaySettings['resourceKind'];
|
|
537
|
+
rangeStart: Date;
|
|
538
|
+
rangeEnd: Date;
|
|
539
|
+
visibleChairIds: string[];
|
|
540
|
+
visibleOperatorIds: string[];
|
|
541
|
+
/** True only when `hiddenDates` actually removes the absent column —
|
|
542
|
+
* the kit honours it in `resourceTimeGrid*` (vertical) views only. */
|
|
543
|
+
columnsHiddenWhenAbsent: boolean;
|
|
544
|
+
/** Month: daygrid paints a background fill for day-spanning events
|
|
545
|
+
* only, so emit ONE all-day wash per fully closed day and nothing for
|
|
546
|
+
* a partial day (a timed slice renders no fill there). */
|
|
547
|
+
wholeDayOnly?: boolean;
|
|
548
|
+
}, data: CalendarData): CalendarEvent[];
|
|
549
|
+
export declare const CLOSURE_HOLIDAY_ACCENT = "var(--warning)";
|
|
550
|
+
/** Closure banners (closed date · holiday · operator absence) share one
|
|
551
|
+
* id prefix — the peek and click handlers route on it. */
|
|
552
|
+
export declare function isClosureEvent(event: CalendarEvent): boolean;
|
|
553
|
+
/**
|
|
554
|
+
* All-day closure banners, one per visible column (platform: one closeDay
|
|
555
|
+
* event per resource) — chair/operator axes need a resourceId or FC drops
|
|
556
|
+
* the event; `'none'` (plain axis, and Month later) gets one resource-less.
|
|
557
|
+
*/
|
|
558
|
+
export declare function buildClosureBanners(args: {
|
|
559
|
+
axisKind: DisplaySettings['resourceKind'];
|
|
560
|
+
rangeStart: Date;
|
|
561
|
+
rangeEnd: Date;
|
|
562
|
+
visibleChairIds: string[];
|
|
563
|
+
visibleOperatorIds: string[];
|
|
564
|
+
/** The absent column is already gone via `hiddenDates` — no banner. */
|
|
565
|
+
columnsHiddenWhenAbsent: boolean;
|
|
566
|
+
labels: {
|
|
567
|
+
closed: string;
|
|
568
|
+
holiday: (name: string) => string;
|
|
569
|
+
absence: (title?: string) => string;
|
|
570
|
+
};
|
|
571
|
+
}, data: CalendarData): CalendarEvent[];
|
|
572
|
+
export interface PrintRow {
|
|
573
|
+
id: string;
|
|
574
|
+
start: Date;
|
|
575
|
+
end?: Date;
|
|
576
|
+
allDay: boolean;
|
|
577
|
+
/** Masked exactly like the grid card under the privacy toggle. */
|
|
578
|
+
patientName: string;
|
|
579
|
+
/** Every labelled number; empty under privacy. */
|
|
580
|
+
phones: CalendarPhoneNumber[];
|
|
581
|
+
/** Free-text description (platform `name`) — unmasked, like the card. */
|
|
582
|
+
description?: string;
|
|
583
|
+
/** Care entries with their tooth elements — unmasked, like the card. */
|
|
584
|
+
careLines: CalendarCareEntry[];
|
|
585
|
+
chairId?: string;
|
|
586
|
+
operatorId?: string;
|
|
587
|
+
status?: CalendarEventStatus;
|
|
588
|
+
/** An online booking still without a patient record. */
|
|
589
|
+
unassigned: boolean;
|
|
590
|
+
}
|
|
591
|
+
export interface PrintGroup {
|
|
592
|
+
id: string;
|
|
593
|
+
kind: 'chair' | 'operator' | 'all' | 'no-operator';
|
|
594
|
+
title?: string;
|
|
595
|
+
rows: PrintRow[];
|
|
596
|
+
}
|
|
597
|
+
/** Closed date · holiday · operator absence (the closures vocabulary),
|
|
598
|
+
* plus the plain non-working weekday the full Week view shows. */
|
|
599
|
+
export type PrintDayNote = CalendarClosure | {
|
|
600
|
+
kind: 'nonWorking';
|
|
601
|
+
};
|
|
602
|
+
export interface PrintDaySection {
|
|
603
|
+
date: Date;
|
|
604
|
+
groups: PrintGroup[];
|
|
605
|
+
tasks: Array<{
|
|
606
|
+
id: string;
|
|
607
|
+
start: Date;
|
|
608
|
+
allDay: boolean;
|
|
609
|
+
title: string;
|
|
610
|
+
}>;
|
|
611
|
+
notes: PrintDayNote[];
|
|
612
|
+
}
|
|
613
|
+
export interface PrintSheetInput {
|
|
614
|
+
rows: CalendarRow[];
|
|
615
|
+
days: Date[];
|
|
616
|
+
axisKind: DisplaySettings['resourceKind'];
|
|
617
|
+
visibleChairIds: string[];
|
|
618
|
+
visibleOperatorIds: string[];
|
|
619
|
+
privacy: boolean;
|
|
620
|
+
}
|
|
621
|
+
/** A date-only start (all-day rows) is already a local day; anything
|
|
622
|
+
* else parses as the wall clock the fixtures and the editor write. */
|
|
623
|
+
export declare function parseEventDate(value: string | Date): Date;
|
|
624
|
+
export declare function maskedTitle(event: CalendarEvent, privacy: boolean): string;
|
|
625
|
+
export declare function printRowOf(row: CalendarRow, privacy: boolean, data: CalendarData): PrintRow;
|
|
626
|
+
export declare function byStart(a: PrintRow, b: PrintRow): number;
|
|
627
|
+
/**
|
|
628
|
+
* One section per printable day: the appointments the grid would show
|
|
629
|
+
* (same chair/operator filter), grouped by the active axis, plus the
|
|
630
|
+
* day's tasks and closure notes for the footer. Ids and keys only — the
|
|
631
|
+
* sheet localises, so this stays unit-testable.
|
|
632
|
+
*/
|
|
633
|
+
export declare function buildPrintSheet(input: PrintSheetInput, data: CalendarData): PrintDaySection[];
|
|
634
|
+
export declare const PRINT_LINE_PX = 26;
|
|
635
|
+
export declare const PRINT_ROW_PAD_PX = 10;
|
|
636
|
+
/** Characters per wrapped line of free text in the cares column. */
|
|
637
|
+
export declare const PRINT_WRAP_CHARS = 22;
|
|
638
|
+
/** Cells and headers tighten to the small step — the sheet has to fit an
|
|
639
|
+
* A4 portrait; the var is read on the cell itself, so no cascade fight. */
|
|
640
|
+
export declare const PRINT_CELL_CLASS = "ds:[--ag-cell-horizontal-padding:var(--spacing-sm)]";
|
|
641
|
+
/** Every line the two stacked cells need; `minLines` lets the plain axis
|
|
642
|
+
* reserve the two-line chair / operator cell. */
|
|
643
|
+
export declare function printRowHeight(row: PrintRow, minLines?: number): number;
|
|
644
|
+
export declare function closureReason(t: TFunction, locale: string, closure: CalendarClosure, date: Date, data: CalendarData): string;
|
|
645
|
+
/** External seeding for the finder — e.g. the waiting list's per-entry
|
|
646
|
+
* "find slots" action prefills the filters AND carries the patient
|
|
647
|
+
* (plus care text/colour) through to the Book prefill. */
|
|
648
|
+
export interface FindSlotsSeed {
|
|
649
|
+
tick: number;
|
|
650
|
+
operatorId?: string;
|
|
651
|
+
chairId?: string;
|
|
652
|
+
durationMin?: number;
|
|
653
|
+
patientId?: string;
|
|
654
|
+
care?: string;
|
|
655
|
+
/** A linked appointment's cares — ride into Book as linked cares. */
|
|
656
|
+
cares?: CalendarCareEntry[];
|
|
657
|
+
colorHex?: string;
|
|
658
|
+
/**
|
|
659
|
+
* Set when the search is a RESCHEDULE: booking a slot must move this
|
|
660
|
+
* appointment rather than create a second one.
|
|
661
|
+
*/
|
|
662
|
+
rescheduleEventId?: string;
|
|
663
|
+
/** The waiting entry the search came from — cleared once it is booked. */
|
|
664
|
+
waitingEntryId?: string;
|
|
665
|
+
}
|
|
666
|
+
/** Booking context that rides ALONG with a projection — so booking by
|
|
667
|
+
* clicking a green range on the GRID prefills the same patient/care
|
|
668
|
+
* the panel's own Book button would. */
|
|
669
|
+
export type AvailabilityContext = Pick<FindSlotsSeed, 'patientId' | 'care' | 'cares' | 'colorHex'>;
|
|
670
|
+
/**
|
|
671
|
+
* The in-memory free-slot search over the fixture week: closed dates and
|
|
672
|
+
* holidays yield nothing, an operator away that day drops out of it, and
|
|
673
|
+
* a slot clashes with any row on its chair or a non-task row's operator.
|
|
674
|
+
*/
|
|
675
|
+
export declare function searchFreeSlots(args: {
|
|
676
|
+
rows: CalendarRow[];
|
|
677
|
+
chairs: readonly CalendarResource[];
|
|
678
|
+
operators: readonly CalendarResource[];
|
|
679
|
+
durationMin: number;
|
|
680
|
+
fromDate: Date;
|
|
681
|
+
toDate: Date;
|
|
682
|
+
careId?: string;
|
|
683
|
+
}, data: CalendarData): CalendarFreeSlot[];
|
|
684
|
+
//# sourceMappingURL=calendar.model.d.ts.map
|