@alfadocs/ui-kit 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/{balance-badge-cell--iQ_gtmi.js → balance-badge-cell-CgkxYO96.js} +7 -6
- package/dist/_chunks/{calendar-B4Gnyu1C.js → calendar-CHT9Rm3M.js} +2 -2
- package/dist/_chunks/{calendar-event-card-Bjdbik8G.js → calendar-event-card-BjdHZaqz.js} +18 -14
- package/dist/_chunks/calendar-plus-BFrIRE4r.js +19 -0
- package/dist/_chunks/calendar-workspace-DI49_t6t.js +7429 -0
- package/dist/_chunks/clipboard-list-rSzfIYZB.js +25 -0
- package/dist/_chunks/{color-picker-oZ6zYks8.js → color-picker-CU303VjY.js} +4 -2
- package/dist/_chunks/data-table-DC5rO3Ty.js +1817 -0
- package/dist/_chunks/{field-value-DG8zaZvo.js → field-value-D-vkX9uL.js} +120 -140
- package/dist/_chunks/{file-manager-UsD8e_AB.js → file-manager-DJMeB3V8.js} +138 -153
- package/dist/_chunks/folder-plus-CutOs4DP.js +22 -0
- package/dist/_chunks/hourglass-BEAzW1wE.js +26 -0
- package/dist/_chunks/{notes-panel-CymneXtl.js → notes-panel-DYAtlq_i.js} +2 -2
- package/dist/_chunks/{patient-details-BQaUzPqp.js → patient-details-BfzvFnxQ.js} +73 -92
- package/dist/_chunks/{patient-summary-card-CvDxhbBR.js → patient-summary-card-D5Vfa321.js} +2 -2
- package/dist/_chunks/{practice-results-D7ygCj_W.js → practice-results-DL_ExLYE.js} +159 -172
- package/dist/_chunks/{rich-text-editor-BDfFtK4H.js → rich-text-editor-DtbcA6s1.js} +2 -2
- package/dist/_chunks/signature-CpFNpsVK.js +21 -0
- package/dist/_chunks/{signature-field-0rFODJlW.js → signature-field-CEiPe-vX.js} +19 -34
- package/dist/_chunks/smartphone-C0rFF2if.js +15 -0
- package/dist/_chunks/{toast.agent-D1tdg6DS.js → toast-YZz2sBzB.js} +160 -212
- package/dist/_chunks/toast.agent-DNQ0JYGv.js +56 -0
- package/dist/_chunks/{workflow-map-wcw3t6g4.js → workflow-map-dNzJjBWG.js} +103 -112
- 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/file-manager/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- 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/workflow/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +680 -0
- package/dist/i18n/locales/ar.js +680 -0
- package/dist/i18n/locales/de.d.ts +680 -0
- package/dist/i18n/locales/de.js +680 -0
- package/dist/i18n/locales/el.d.ts +680 -0
- package/dist/i18n/locales/el.js +680 -0
- package/dist/i18n/locales/en.d.ts +680 -0
- package/dist/i18n/locales/en.js +680 -0
- package/dist/i18n/locales/es.d.ts +680 -0
- package/dist/i18n/locales/es.js +680 -0
- package/dist/i18n/locales/fr.d.ts +680 -0
- package/dist/i18n/locales/fr.js +680 -0
- package/dist/i18n/locales/hi.d.ts +680 -0
- package/dist/i18n/locales/hi.js +680 -0
- package/dist/i18n/locales/it.d.ts +680 -0
- package/dist/i18n/locales/it.js +680 -0
- package/dist/i18n/locales/ja.d.ts +680 -0
- package/dist/i18n/locales/ja.js +680 -0
- package/dist/i18n/locales/nl.d.ts +680 -0
- package/dist/i18n/locales/nl.js +680 -0
- package/dist/i18n/locales/pl.d.ts +680 -0
- package/dist/i18n/locales/pl.js +680 -0
- package/dist/i18n/locales/pt.d.ts +680 -0
- package/dist/i18n/locales/pt.js +680 -0
- package/dist/i18n/locales/ro.d.ts +680 -0
- package/dist/i18n/locales/ro.js +680 -0
- package/dist/i18n/locales/ru.d.ts +680 -0
- package/dist/i18n/locales/ru.js +680 -0
- package/dist/i18n/locales/sq.d.ts +680 -0
- package/dist/i18n/locales/sq.js +680 -0
- package/dist/i18n/locales/sv.d.ts +680 -0
- package/dist/i18n/locales/sv.js +680 -0
- package/dist/i18n/locales/tr.d.ts +680 -0
- package/dist/i18n/locales/tr.js +680 -0
- package/dist/i18n/locales/zh.d.ts +680 -0
- package/dist/i18n/locales/zh.js +680 -0
- package/dist/index.js +821 -803
- 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.model.d.ts +358 -0
- package/dist/patterns/calendar/calendar.data.d.ts +122 -0
- package/dist/patterns/calendar/calendar.host.d.ts +10 -0
- package/dist/patterns/calendar/calendar.journey.d.ts +119 -0
- package/dist/patterns/calendar/calendar.model.d.ts +684 -0
- package/dist/patterns/calendar/calendar.preferences.d.ts +74 -0
- package/dist/patterns/calendar/calendar.sheets.d.ts +398 -0
- package/dist/patterns/calendar/calendar.surface.d.ts +77 -0
- package/dist/patterns/calendar/calendar.types.d.ts +413 -0
- package/dist/patterns/calendar/index.d.ts +13 -0
- package/dist/patterns/calendar/index.js +19 -0
- package/package.json +5 -1
- package/dist/_chunks/actions-cell-renderer-ReurEy5i.js +0 -1945
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type CalendarData } from './calendar.data';
|
|
2
|
+
import type { CalendarJourney } from './calendar.journey';
|
|
3
|
+
import { type CalendarPreferenceAdapter } from './calendar.preferences';
|
|
4
|
+
import { type EditorPrefill } from './calendar.model';
|
|
5
|
+
import { type WorkspaceDisplaySettings } from './calendar-workspace.model';
|
|
6
|
+
export declare const WORKSPACE_TOOL: {
|
|
7
|
+
readonly appointments: "appointments";
|
|
8
|
+
readonly editor: "appointment-editor";
|
|
9
|
+
readonly waitingList: "waiting-list";
|
|
10
|
+
readonly bookings: "online-bookings";
|
|
11
|
+
readonly findSlots: "find-slots";
|
|
12
|
+
};
|
|
13
|
+
export interface CalendarWorkspaceProps {
|
|
14
|
+
/** The domain state and its handlers — the host implements them. */
|
|
15
|
+
journey: CalendarJourney;
|
|
16
|
+
/** The practice's read model, stable for a page load. */
|
|
17
|
+
data: CalendarData;
|
|
18
|
+
locale?: string;
|
|
19
|
+
/** Host-level cog overrides. */
|
|
20
|
+
initialDisplay?: Partial<WorkspaceDisplaySettings>;
|
|
21
|
+
/** The platform's `practice_appointment_edit` right — false turns the
|
|
22
|
+
* page read-only (no drag, no create, details without write actions). */
|
|
23
|
+
permissions?: {
|
|
24
|
+
editAppointment?: boolean;
|
|
25
|
+
};
|
|
26
|
+
/** Deep link `focusAppointmentId`: open on the appointment's day, ring
|
|
27
|
+
* and scroll to its card and dock its details. */
|
|
28
|
+
focusAppointmentId?: string;
|
|
29
|
+
/** Deep link `createParameters`: arrive in CREATE mode — the banner
|
|
30
|
+
* stands and the next free-slot click opens the editor prefilled. */
|
|
31
|
+
createParameters?: {
|
|
32
|
+
prefill: EditorPrefill;
|
|
33
|
+
patientName?: string;
|
|
34
|
+
};
|
|
35
|
+
/** Deep link `freeSlotClicked`: jump to the slot and open the editor
|
|
36
|
+
* prefilled with it. */
|
|
37
|
+
freeSlot?: EditorPrefill;
|
|
38
|
+
/** Platform advisories the finder raises when the scheduler is empty. */
|
|
39
|
+
businessHours?: {
|
|
40
|
+
practice?: boolean;
|
|
41
|
+
operators?: boolean;
|
|
42
|
+
};
|
|
43
|
+
/** Where the cog's settings, the view, the weekend choice and the
|
|
44
|
+
* chair / operator selections are remembered — the host's per-user
|
|
45
|
+
* store. Defaults to the session-scoped in-memory adapter. */
|
|
46
|
+
preferences?: CalendarPreferenceAdapter;
|
|
47
|
+
/** The grid's instance id — the agent registry's handle for this
|
|
48
|
+
* calendar and the DOM hook anything outside React reaches it by.
|
|
49
|
+
* Override it only when two workspaces share one page. */
|
|
50
|
+
id?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The cog's settings as the workspace opens with them: the remembered
|
|
54
|
+
* entry under the workspace's own key, a caller's `initialDisplay`
|
|
55
|
+
* winning for the keys it names. Exported so a host seeding its journey
|
|
56
|
+
* (row colours follow `colorAssociation`) starts from the same values
|
|
57
|
+
* the workspace will show.
|
|
58
|
+
*/
|
|
59
|
+
export declare function initialWorkspaceDisplay(initialDisplay: Partial<WorkspaceDisplaySettings> | undefined, preferences?: CalendarPreferenceAdapter): WorkspaceDisplaySettings;
|
|
60
|
+
/** The workspace root: the read model, then the rail scope, then the page. */
|
|
61
|
+
export declare function CalendarWorkspace({ data, ...props }: CalendarWorkspaceProps): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
//# sourceMappingURL=calendar-workspace.d.ts.map
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar demo, Increment 1 — the pure model the rail-hosted surface
|
|
3
|
+
* adds on top of `calendar.model.ts`: the four-way range view with its
|
|
4
|
+
* keyboard shortcuts, the extended display settings (default duration,
|
|
5
|
+
* name display, map link), the practice-hours time axis, the platform's
|
|
6
|
+
* filter semantics (nothing ticked = everyone) and the split-button
|
|
7
|
+
* badge count. No React, no i18n lookups. Every read of practice data
|
|
8
|
+
* goes through the explicit `data: CalendarData` parameter.
|
|
9
|
+
*/
|
|
10
|
+
import type { AppointmentItem } from '../../components/appointment-card';
|
|
11
|
+
import type { CalendarResource } from '../../components/calendar';
|
|
12
|
+
import type { CalendarData } from './calendar.data';
|
|
13
|
+
import type { CalendarPatient, CalendarWaitingEntry } from './calendar.types';
|
|
14
|
+
import { type CalendarRow, type DisplaySettings, type EditorDraft, type EditorPrefill, type WaitingQuickView } from './calendar.model';
|
|
15
|
+
/** The platform's four ranges; "Working week" became the Show-weekends
|
|
16
|
+
* item, so it is no longer a view of its own. */
|
|
17
|
+
export type WorkspaceViewId = 'day' | 'threeDays' | 'week' | 'month';
|
|
18
|
+
export declare const WORKSPACE_VIEWS: readonly WorkspaceViewId[];
|
|
19
|
+
/** CalendarView stem per range — composed with the column axis. */
|
|
20
|
+
export declare const WORKSPACE_VIEW_STEM: Record<WorkspaceViewId, 'Day' | 'ThreeDays' | 'Week' | 'Month'>;
|
|
21
|
+
/** Google-Calendar-style single-key shortcuts (X = 3 days, as GCal). */
|
|
22
|
+
export declare const VIEW_SHORTCUT_KEYS: Record<WorkspaceViewId, string>;
|
|
23
|
+
export declare const readWorkspaceViewId: (raw: unknown) => WorkspaceViewId | undefined;
|
|
24
|
+
/** The range a bare key press selects, case-insensitive; undefined when
|
|
25
|
+
* the key is not a shortcut. */
|
|
26
|
+
export declare function viewForShortcutKey(key: string): WorkspaceViewId | undefined;
|
|
27
|
+
export declare function shortcutAllowedOn(target: EventTarget | null): boolean;
|
|
28
|
+
/** The keydown shape the shortcut resolver reads — a subset of
|
|
29
|
+
* KeyboardEvent so tests can pass plain objects. */
|
|
30
|
+
export interface ShortcutKeydown {
|
|
31
|
+
key: string;
|
|
32
|
+
altKey: boolean;
|
|
33
|
+
ctrlKey: boolean;
|
|
34
|
+
metaKey: boolean;
|
|
35
|
+
shiftKey: boolean;
|
|
36
|
+
repeat: boolean;
|
|
37
|
+
defaultPrevented: boolean;
|
|
38
|
+
target: EventTarget | null;
|
|
39
|
+
}
|
|
40
|
+
/** The range a page-level keydown switches to, or undefined when the
|
|
41
|
+
* press must be left alone (modifier, auto-repeat, typing, an open
|
|
42
|
+
* menu or dialog, already handled). */
|
|
43
|
+
export declare function shortcutViewForKeydown(event: ShortcutKeydown): WorkspaceViewId | undefined;
|
|
44
|
+
/** Weekend visibility is a per-user choice now (platform hidden days):
|
|
45
|
+
* off hides Saturday and Sunday in every range view. */
|
|
46
|
+
export declare function weekendHiddenDays(showWeekends: boolean): number[];
|
|
47
|
+
export type OperatorNameDisplay = 'full' | 'initials';
|
|
48
|
+
export type ChairNameDisplay = 'full' | 'short';
|
|
49
|
+
export interface WorkspaceDisplaySettings extends DisplaySettings {
|
|
50
|
+
/** The per-user default appointment length (platform 30). */
|
|
51
|
+
defaultDurationMin: number;
|
|
52
|
+
/** Column header treatment for people: dot + name, or initials disc. */
|
|
53
|
+
operatorNameDisplay: OperatorNameDisplay;
|
|
54
|
+
/** Column header treatment for chairs: full name or the short code. */
|
|
55
|
+
chairNameDisplay: ChairNameDisplay;
|
|
56
|
+
/** Show the Google Maps link in the appointment details. */
|
|
57
|
+
mapsLink: boolean;
|
|
58
|
+
}
|
|
59
|
+
export declare const DEFAULT_DURATION_RANGE: {
|
|
60
|
+
readonly min: 5;
|
|
61
|
+
readonly max: 240;
|
|
62
|
+
readonly step: 5;
|
|
63
|
+
};
|
|
64
|
+
export declare const DEFAULT_WORKSPACE_DISPLAY: WorkspaceDisplaySettings;
|
|
65
|
+
/** Remembered Increment 1 display settings, validated per field over the
|
|
66
|
+
* Increment 1 defaults (a Final State shape keeps every knob it knows). */
|
|
67
|
+
export declare function readWorkspaceDisplaySettings(raw: unknown): WorkspaceDisplaySettings | undefined;
|
|
68
|
+
/** Earliest opening and latest closing across the practice's week —
|
|
69
|
+
* the platform's `openingTime` / `closingTime` for the time axis. */
|
|
70
|
+
export declare function practiceDayWindow(data: CalendarData): {
|
|
71
|
+
min: string;
|
|
72
|
+
max: string;
|
|
73
|
+
};
|
|
74
|
+
/** The axis for a cog window: `working` is the practice's own hours;
|
|
75
|
+
* extended and full stay the Final State overrides. */
|
|
76
|
+
export declare function workspaceDayWindow(window: DisplaySettings['window'], data: CalendarData): {
|
|
77
|
+
min: string;
|
|
78
|
+
max: string;
|
|
79
|
+
};
|
|
80
|
+
/** The ids a selection shows: the ticked ones, or all when none is. */
|
|
81
|
+
export declare function effectiveIds(selected: readonly string[], all: readonly string[]): string[];
|
|
82
|
+
/** Tick or untick `ids` in a selection (a row or a whole group). */
|
|
83
|
+
export declare function toggleSelectedIds(prev: readonly string[], ids: readonly string[], checked: boolean | 'indeterminate'): string[];
|
|
84
|
+
/** What the Reset chip counts: every ticked chair and operator. */
|
|
85
|
+
export declare function activeFilterCount(selectedChairIds: readonly string[], selectedOperatorIds: readonly string[]): number;
|
|
86
|
+
/**
|
|
87
|
+
* Disabled operators holding at least one appointment that STARTS inside
|
|
88
|
+
* the visible range — the platform's carve-out
|
|
89
|
+
* (`NewCalendar/Library.js`: `isActive(op) || hasAppointments(op)`).
|
|
90
|
+
* Their column stands whatever the "Show disabled operators" switch
|
|
91
|
+
* says, so hiding the operator can never hide an appointment.
|
|
92
|
+
*/
|
|
93
|
+
export declare function bookedDisabledOperatorIds(rows: readonly CalendarRow[], inactiveIds: readonly string[], range: {
|
|
94
|
+
start: number;
|
|
95
|
+
end: number;
|
|
96
|
+
} | null): string[];
|
|
97
|
+
/**
|
|
98
|
+
* The operators the grid may give a column to when NOTHING is ticked:
|
|
99
|
+
* every active one, the disabled ones while the switch reveals them, and
|
|
100
|
+
* any disabled operator the carve-out keeps. An explicit selection still
|
|
101
|
+
* wins over all three (platform: `kept.filter(selected)`).
|
|
102
|
+
*/
|
|
103
|
+
export declare function columnableOperatorIds(args: {
|
|
104
|
+
operators: readonly CalendarResource[];
|
|
105
|
+
inactiveIds: readonly string[];
|
|
106
|
+
showDisabled: boolean;
|
|
107
|
+
keepIds: readonly string[];
|
|
108
|
+
}): string[];
|
|
109
|
+
/** The operators the filter list offers — disabled ones only once the
|
|
110
|
+
* session switch reveals them (the carve-out is a column, not a row). */
|
|
111
|
+
export declare function listedOperators(operators: readonly CalendarResource[], inactiveIds: readonly string[], showDisabled: boolean): CalendarResource[];
|
|
112
|
+
/** Chair column label per the cog: the full name, or the fixture's short
|
|
113
|
+
* code (the platform's "first two letters" setting). */
|
|
114
|
+
export declare function chairResourceTitle(chair: CalendarResource, mode: ChairNameDisplay): string;
|
|
115
|
+
/** Operator column label: the plain name, or the name plus the muted
|
|
116
|
+
* Disabled marker when the practice has disabled them. The kit Calendar
|
|
117
|
+
* renders a resource header from its `title`, so the marker rides
|
|
118
|
+
* there — and reaches the Avatar's accessible name under initials. */
|
|
119
|
+
export declare function operatorResourceTitle(operator: CalendarResource, isDisabled: boolean, disabledLabel: string): string;
|
|
120
|
+
/** Whole minutes between two instants — the resize toast's figure. */
|
|
121
|
+
export declare function minutesBetween(start: Date | string, end: Date | string): number;
|
|
122
|
+
/** Re-ends one appointment. The resize path writes through this twice —
|
|
123
|
+
* once for the drag, once for the Undo that restores the old end — so
|
|
124
|
+
* the two can never drift apart. */
|
|
125
|
+
export declare function rowsWithEnd(rows: readonly CalendarRow[], eventId: string, end: Date): CalendarRow[];
|
|
126
|
+
/** The platform's recurring-mode chooser (move, delete, save on edit). */
|
|
127
|
+
export type RecurringScope = 'this' | 'following' | 'all';
|
|
128
|
+
export declare const RECURRING_SCOPES: readonly RecurringScope[];
|
|
129
|
+
/** Literal map (not a template) so key extractors see every key. */
|
|
130
|
+
export declare const RECURRING_SCOPE_LABEL_KEY: Record<RecurringScope, string>;
|
|
131
|
+
/** How the create form asks for the required documents' signature. */
|
|
132
|
+
export type RequiredDocsSignMode = 'sms' | 'email' | 'none';
|
|
133
|
+
/** What the editor reports beside the draft — the platform-only choices
|
|
134
|
+
* the shared `EditorDraft` never needed. */
|
|
135
|
+
export interface EditorDraftExtras {
|
|
136
|
+
recurringSaveMode?: RecurringScope;
|
|
137
|
+
requiredDocsSignMode?: RequiredDocsSignMode;
|
|
138
|
+
branchId?: string;
|
|
139
|
+
}
|
|
140
|
+
/** Delete confirmation choices — the recurring scope and, for a
|
|
141
|
+
* price-list recurrence parent, the care-plan cleanup. */
|
|
142
|
+
export interface DeleteOptions {
|
|
143
|
+
scope: RecurringScope;
|
|
144
|
+
removeFromCarePlan?: boolean;
|
|
145
|
+
}
|
|
146
|
+
/** The occurrences a scope names, in series order — the event itself
|
|
147
|
+
* for `this`, it and its later occurrences for `following`, the whole
|
|
148
|
+
* series for `all`. A row outside a series only ever names itself. */
|
|
149
|
+
export declare function seriesScopeEventIds(rows: readonly CalendarRow[], eventId: string, scope: RecurringScope): string[];
|
|
150
|
+
/** Every timed appointment overlapping `[start, end)` — cancelled and
|
|
151
|
+
* absent ones, tasks, washes and the row itself never count (platform
|
|
152
|
+
* busy check). */
|
|
153
|
+
export declare function slotConflicts(rows: readonly CalendarRow[], slot: {
|
|
154
|
+
start: Date;
|
|
155
|
+
end: Date;
|
|
156
|
+
chairId?: string;
|
|
157
|
+
operatorId?: string;
|
|
158
|
+
excludeEventId?: string;
|
|
159
|
+
}): {
|
|
160
|
+
chairBusy: boolean;
|
|
161
|
+
operatorBusy: boolean;
|
|
162
|
+
};
|
|
163
|
+
/** Devices the chosen cares need, deduplicated, in care order. */
|
|
164
|
+
export declare function devicesForCares(cares: readonly {
|
|
165
|
+
careId?: string;
|
|
166
|
+
}[] | undefined, devicesByCare: Readonly<Record<string, readonly string[]>>): string[];
|
|
167
|
+
/** Which sign channels a patient can take a request on. */
|
|
168
|
+
export declare function signChannelsFor(patient: CalendarPatient | undefined): {
|
|
169
|
+
sms: boolean;
|
|
170
|
+
email: boolean;
|
|
171
|
+
};
|
|
172
|
+
/** The platform's default: SMS when the patient can take one, else
|
|
173
|
+
* email, else nothing. */
|
|
174
|
+
export declare function defaultSignMode(patient: CalendarPatient | undefined): RequiredDocsSignMode;
|
|
175
|
+
/** Google Maps search for the patient's address — the popover's map link. */
|
|
176
|
+
export declare function patientMapsUrl(patient: CalendarPatient): string;
|
|
177
|
+
/** A CREATE mode armed by a deep link (`createParameters`) or the
|
|
178
|
+
* Backlog's Schedule: the next empty-slot click opens the editor with
|
|
179
|
+
* this context already filled in (platform `_switchMode('create')`). */
|
|
180
|
+
export interface CreateModeRequest {
|
|
181
|
+
tick: number;
|
|
182
|
+
prefill: EditorPrefill;
|
|
183
|
+
/** Named in the banner when the context carries a patient. */
|
|
184
|
+
patientName?: string;
|
|
185
|
+
}
|
|
186
|
+
/** Legible ink for a mode banner tinted with an appointment colour. The
|
|
187
|
+
* Google palette ships no text colour, so the pair is settled by the
|
|
188
|
+
* kit's own contrast maths rather than by eye. */
|
|
189
|
+
export declare function bannerTextColor(backgroundHex?: string): string | undefined;
|
|
190
|
+
/** A Move… or Copy… armed from the details dialog: the next empty-slot
|
|
191
|
+
* click places the source appointment there. */
|
|
192
|
+
export interface PlacementRequest {
|
|
193
|
+
kind: 'move' | 'copy';
|
|
194
|
+
eventId: string;
|
|
195
|
+
/** Copy only — carry the linked treatments along (platform's two copies). */
|
|
196
|
+
withTreatments?: boolean;
|
|
197
|
+
/** Armed from a waiting-list Reschedule — the entry leaves the queue
|
|
198
|
+
* once the move lands (platform parity). */
|
|
199
|
+
waitingEntryId?: string;
|
|
200
|
+
}
|
|
201
|
+
/** The platform's "Copia & incolla": the same appointment on a new slot
|
|
202
|
+
* with a fresh id — never a series member, treatments only on request.
|
|
203
|
+
* An all-day source stays all-day on the target date. */
|
|
204
|
+
export declare function copyRowAt(source: CalendarRow, target: {
|
|
205
|
+
start: Date;
|
|
206
|
+
resourceId?: string;
|
|
207
|
+
axisKind: DisplaySettings['resourceKind'];
|
|
208
|
+
}, id: string, withTreatments: boolean): CalendarRow;
|
|
209
|
+
/** Apply an edit saved with "this and following" / "all" to the other
|
|
210
|
+
* occurrences: each keeps its own day shifted by the same delta as the
|
|
211
|
+
* edited one, and takes the edited duration, allocation, colour, status,
|
|
212
|
+
* type and description. */
|
|
213
|
+
export declare function applySeriesEdit(rows: readonly CalendarRow[], primaryPrev: CalendarRow, draft: EditorDraft, siblingIds: readonly string[], data: CalendarData): CalendarRow[];
|
|
214
|
+
/** What the post-save toast needs to decide whether the saved
|
|
215
|
+
* appointment is on screen: its day and its allocation. */
|
|
216
|
+
export interface SaveNotice {
|
|
217
|
+
tick: number;
|
|
218
|
+
date: Date;
|
|
219
|
+
chairId?: string;
|
|
220
|
+
operatorId?: string;
|
|
221
|
+
}
|
|
222
|
+
/** Why a saved appointment is not on the grid right now — empty when it
|
|
223
|
+
* is visible. The "Go to" action undoes exactly these. */
|
|
224
|
+
export declare function hiddenReasons(notice: Pick<SaveNotice, 'date' | 'chairId' | 'operatorId'>, view: {
|
|
225
|
+
visibleRange: {
|
|
226
|
+
start: number;
|
|
227
|
+
end: number;
|
|
228
|
+
} | null;
|
|
229
|
+
hiddenDays: readonly number[];
|
|
230
|
+
selectedChairIds: readonly string[];
|
|
231
|
+
selectedOperatorIds: readonly string[];
|
|
232
|
+
}): Array<'range' | 'weekend' | 'chair' | 'operator'>;
|
|
233
|
+
/**
|
|
234
|
+
* The platform DASHBOARD widget's window (`upcomingAppointmentsAction`):
|
|
235
|
+
* NOW → `forwardDays` later at 23:59:59.999, cancelled excluded, date
|
|
236
|
+
* ascending, no row limit. `backDays` is 0 at rest — the kit timeline's
|
|
237
|
+
* presets and its edge loaders widen the derived window in place of a
|
|
238
|
+
* fetch, so the panel can look further than the platform's seven days.
|
|
239
|
+
*/
|
|
240
|
+
export interface UpcomingWindow {
|
|
241
|
+
/** Days of history the panel has been widened to; 0 starts at NOW. */
|
|
242
|
+
backDays: number;
|
|
243
|
+
/** Days ahead — the platform's seven at rest. */
|
|
244
|
+
forwardDays: number;
|
|
245
|
+
}
|
|
246
|
+
/** Platform default: now to the end of the seventh day. */
|
|
247
|
+
export declare const UPCOMING_FORWARD_DAYS = 7;
|
|
248
|
+
/** How far one widening step reaches at either edge. */
|
|
249
|
+
export declare const UPCOMING_STEP_DAYS = 7;
|
|
250
|
+
/** Where the widening stops — the demo's own ceiling, not the platform's. */
|
|
251
|
+
export declare const UPCOMING_MAX_DAYS = 180;
|
|
252
|
+
export declare const DEFAULT_UPCOMING_WINDOW: UpcomingWindow;
|
|
253
|
+
/** Epoch bounds of a window, inclusive of its closing second. */
|
|
254
|
+
export declare function upcomingWindowBounds(nowIso: string, window: UpcomingWindow): {
|
|
255
|
+
startMs: number;
|
|
256
|
+
endMs: number;
|
|
257
|
+
};
|
|
258
|
+
/** One widening step at either edge, capped at the ceiling. */
|
|
259
|
+
export declare function widenUpcomingWindow(window: UpcomingWindow, edge: 'earlier' | 'later'): UpcomingWindow;
|
|
260
|
+
/** Widen just far enough to reach `targetIso` — the timeline's presets and
|
|
261
|
+
* its jump-to-date land on days the default seven never covered. */
|
|
262
|
+
export declare function upcomingWindowCovering(window: UpcomingWindow, nowIso: string, targetIso: string): UpcomingWindow;
|
|
263
|
+
/**
|
|
264
|
+
* The rows the widget lists: appointments starting inside the window,
|
|
265
|
+
* cancelled excluded, date ascending. Background washes and the composing
|
|
266
|
+
* draft never qualify; tasks are already out of the Increment 1 feed.
|
|
267
|
+
*/
|
|
268
|
+
export declare function upcomingAppointmentRows(rows: CalendarRow[], bounds: {
|
|
269
|
+
startMs: number;
|
|
270
|
+
endMs: number;
|
|
271
|
+
}): CalendarRow[];
|
|
272
|
+
/** One agenda row as the kit timeline's item — identity, allocation and
|
|
273
|
+
* care lines; the row id stays the event id so a click maps straight
|
|
274
|
+
* back onto the grid. */
|
|
275
|
+
export declare function upcomingAppointmentItem(row: CalendarRow, privacy: boolean, data: CalendarData): AppointmentItem;
|
|
276
|
+
/** How far back the platform's booking query looks, on `createdAt`. */
|
|
277
|
+
export declare const ONLINE_BOOKINGS_WINDOW_DAYS = 30;
|
|
278
|
+
/**
|
|
279
|
+
* Bookings still to check: created online (or through the API) within
|
|
280
|
+
* the last 30 days, not cancelled, and still missing a patient OR an
|
|
281
|
+
* operator. Mirrors the repository query behind the platform's alert
|
|
282
|
+
* strip; Increment 1 renders the same count on a toolbar button.
|
|
283
|
+
*/
|
|
284
|
+
export declare function onlineBookingsToCheck(rows: readonly CalendarRow[], data: CalendarData): CalendarRow[];
|
|
285
|
+
/**
|
|
286
|
+
* One row of the platform's "Prenotazioni online" page, which Increment 1
|
|
287
|
+
* hosts in the rail instead of sending the user to a separate page.
|
|
288
|
+
* Columns mirror it: when it was booked, what was asked for, whether it
|
|
289
|
+
* was paid online, and what is still missing before it is a real
|
|
290
|
+
* appointment.
|
|
291
|
+
*/
|
|
292
|
+
export interface BookingRowView {
|
|
293
|
+
row: CalendarRow;
|
|
294
|
+
eventId: string;
|
|
295
|
+
/** The appointment's own start. */
|
|
296
|
+
start: Date;
|
|
297
|
+
/** Platform `createdAt` — "del <date>" under the appointment date. */
|
|
298
|
+
bookedAt: Date | null;
|
|
299
|
+
/** The booking reason, or the platform's "Non specificato". */
|
|
300
|
+
reason: string | null;
|
|
301
|
+
chairTitle: string | null;
|
|
302
|
+
/** Stripe amount when the patient paid at booking. */
|
|
303
|
+
paidOnline: number | null;
|
|
304
|
+
needsPatient: boolean;
|
|
305
|
+
needsOperator: boolean;
|
|
306
|
+
/** Booked after the user last opened the page — the "(Nuovo)" marker. */
|
|
307
|
+
isNew: boolean;
|
|
308
|
+
}
|
|
309
|
+
/** Bookings made after this instant carry the platform's "(Nuovo)" tag. */
|
|
310
|
+
export declare const DEFAULT_BOOKINGS_LAST_SEEN_ISO = "2026-06-23T00:00:00";
|
|
311
|
+
export declare function bookingRowView(row: CalendarRow, data: CalendarData, lastSeenMs?: number): BookingRowView;
|
|
312
|
+
/** The nine advanced inputs, all optional. Empty = the input is unset;
|
|
313
|
+
* `operatorId` also accepts `NONE`, the platform's "no operator". */
|
|
314
|
+
export interface WaitingListFilters {
|
|
315
|
+
patientId: string;
|
|
316
|
+
patientAssigned: '' | 'yes' | 'no';
|
|
317
|
+
operatorId: string;
|
|
318
|
+
appointmentScheduled: '' | 'yes' | 'no';
|
|
319
|
+
appointmentFrom?: Date;
|
|
320
|
+
appointmentTo?: Date;
|
|
321
|
+
waitingFrom?: Date;
|
|
322
|
+
waitingTo?: Date;
|
|
323
|
+
description: string;
|
|
324
|
+
}
|
|
325
|
+
export declare const EMPTY_WAITING_FILTERS: WaitingListFilters;
|
|
326
|
+
/** How many of the nine inputs carry a value — the toggle's badge. */
|
|
327
|
+
export declare function waitingFiltersActiveCount(filters: WaitingListFilters): number;
|
|
328
|
+
/**
|
|
329
|
+
* One waiting row resolved the way the platform's serializer resolves
|
|
330
|
+
* it: the entry's OWN patient, the linked appointment with its patient,
|
|
331
|
+
* care line and colour, and the operator default. `noConnection` is the
|
|
332
|
+
* platform's "Nessun collegamento" test — none of the four is present.
|
|
333
|
+
*/
|
|
334
|
+
export interface WaitingListRowView {
|
|
335
|
+
entry: CalendarWaitingEntry;
|
|
336
|
+
/** Platform `patientId` / `patientName` / `patientPhoneNumber`. */
|
|
337
|
+
patient?: CalendarPatient;
|
|
338
|
+
/** The linked appointment, live from the grid's rows. */
|
|
339
|
+
appointment?: CalendarRow;
|
|
340
|
+
/** Platform `appointmentPatientId` — the linked appointment's patient. */
|
|
341
|
+
appointmentPatient?: CalendarPatient;
|
|
342
|
+
/** Platform `operatorName`. */
|
|
343
|
+
operatorTitle?: string;
|
|
344
|
+
/** Platform `appointmentName` — the linked appointment's care line. */
|
|
345
|
+
appointmentName?: string;
|
|
346
|
+
noConnection: boolean;
|
|
347
|
+
}
|
|
348
|
+
export declare function waitingListRowView(entry: CalendarWaitingEntry, rows: readonly CalendarRow[], data: CalendarData): WaitingListRowView;
|
|
349
|
+
/**
|
|
350
|
+
* The platform's advanced predicates, in its own order. A patient
|
|
351
|
+
* matches the entry's OWN patient or the linked appointment's; the
|
|
352
|
+
* operator and the description only ever read the ENTRY's own fields.
|
|
353
|
+
*/
|
|
354
|
+
export declare function waitingEntryMatchesFilters(view: WaitingListRowView, filters: WaitingListFilters, data: CalendarData): boolean;
|
|
355
|
+
/** The quick view first, then the advanced predicates — the platform's
|
|
356
|
+
* own order (`_filterForAdvancedSearch` re-runs the view). */
|
|
357
|
+
export declare function filterWaitingEntries(entries: readonly CalendarWaitingEntry[], rows: readonly CalendarRow[], quickView: WaitingQuickView, filters: WaitingListFilters, data: CalendarData): WaitingListRowView[];
|
|
358
|
+
//# sourceMappingURL=calendar-workspace.model.d.ts.map
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar pattern — the READ MODEL the host supplies, stable for a page
|
|
3
|
+
* load: the practice's resources, catalogue, agenda extras and lookups.
|
|
4
|
+
* It mirrors what the demo once read straight from its fixture module —
|
|
5
|
+
* one property per constant, one method per fixture-backed helper — so
|
|
6
|
+
* the demos hand in their fixtures and the platform island hands in what
|
|
7
|
+
* `/internalApi/...` returned, and the model, panels and surface compute
|
|
8
|
+
* from either without knowing which.
|
|
9
|
+
*
|
|
10
|
+
* Provided once with `<CalendarDataProvider value={data}>`; components
|
|
11
|
+
* read it with `useCalendarData()`, pure model functions take it as an
|
|
12
|
+
* explicit `data` parameter — never a module-level global.
|
|
13
|
+
*
|
|
14
|
+
* Every REQUIRED member is one the shipped runtime actually reads. The
|
|
15
|
+
* handful marked optional are read only by the story-only Final State
|
|
16
|
+
* demo (`src/patterns/demos/calendar/`), which keeps supplying them; a
|
|
17
|
+
* platform host mounting `CalendarWorkspace` can leave them out.
|
|
18
|
+
*/
|
|
19
|
+
import { type ReactNode } from 'react';
|
|
20
|
+
import type { CalendarResource } from '../../components/calendar';
|
|
21
|
+
import type { AppointmentItem } from '../../components/appointment-card';
|
|
22
|
+
import type { NotesPanelNote } from '../../components/notes-panel';
|
|
23
|
+
import type { TasksPanelItem } from '../../components/tasks-panel';
|
|
24
|
+
import type { CalendarAppointmentMeta, CalendarBaseEvent, CalendarBookingContact, CalendarBranch, CalendarBusinessHours, CalendarCare, CalendarCareEntry, CalendarCareLink, CalendarCarePlan, CalendarClosure, CalendarHistoryEntry, CalendarHoliday, CalendarOperatorGroup, CalendarPatient, CalendarPracticeFeatures, CalendarPriceList, CalendarTaskDetail, CalendarWaitingEntry } from './calendar.types';
|
|
25
|
+
export interface CalendarData {
|
|
26
|
+
chairs: readonly CalendarResource[];
|
|
27
|
+
operators: readonly CalendarResource[];
|
|
28
|
+
/** Operator groups (platform `OperatorGroup`) for the grouped filter. */
|
|
29
|
+
operatorGroups: readonly CalendarOperatorGroup[];
|
|
30
|
+
/** Operators the practice has disabled (platform `isActive === false`). */
|
|
31
|
+
inactiveOperatorIds: readonly string[];
|
|
32
|
+
/** Operator id → local ISO dates the operator is away. */
|
|
33
|
+
operatorAbsences: Record<string, readonly string[]>;
|
|
34
|
+
/** Operator id → absence display title (a sibling map, optional per operator). */
|
|
35
|
+
operatorAbsenceTitles: Record<string, string>;
|
|
36
|
+
holidays: readonly CalendarHoliday[];
|
|
37
|
+
/** Practice-closed local ISO dates. */
|
|
38
|
+
closedDates: readonly string[];
|
|
39
|
+
/** JS `getDay()` numbers the practice does not work. Optional: the
|
|
40
|
+
* shipped workspace derives its hidden days from `businessHours` and
|
|
41
|
+
* the weekend toggle; only the Final State demo reads this. */
|
|
42
|
+
nonWorkingDays?: readonly number[];
|
|
43
|
+
businessHours: CalendarBusinessHours;
|
|
44
|
+
/** The clock every relative label and ledger stamp is pinned to. */
|
|
45
|
+
nowIso: string;
|
|
46
|
+
/** The date the calendar opens on. */
|
|
47
|
+
initialDateIso: string;
|
|
48
|
+
cares: readonly CalendarCare[];
|
|
49
|
+
priceLists: readonly CalendarPriceList[];
|
|
50
|
+
/** Optional: no shipped code reads the flat list — the panels go
|
|
51
|
+
* through `carePlanById` / `openCarePlansForPatient`. */
|
|
52
|
+
carePlans?: readonly CalendarCarePlan[];
|
|
53
|
+
patients: readonly CalendarPatient[];
|
|
54
|
+
/** The appointments and tasks as the host loaded them, no resource axis. */
|
|
55
|
+
baseEvents: readonly CalendarBaseEvent[];
|
|
56
|
+
/** Event id → appointment extras (patient, operator, chair, care, billing). */
|
|
57
|
+
metaById: Record<string, CalendarAppointmentMeta>;
|
|
58
|
+
/** Event id → the note the patient left on the online booking form. */
|
|
59
|
+
bookingNotes: Record<string, string>;
|
|
60
|
+
/** Event id → what the person typed on the booking website. */
|
|
61
|
+
bookingContacts: Record<string, CalendarBookingContact>;
|
|
62
|
+
/** Task-event id → its chair / operator axis (tasks carry no meta).
|
|
63
|
+
* Optional: the shipped workspace drops tasks at the feed boundary;
|
|
64
|
+
* only the Final State demo, which shows them, reads this. */
|
|
65
|
+
taskAxis?: Record<string, {
|
|
66
|
+
chairId: string;
|
|
67
|
+
operatorId: string;
|
|
68
|
+
}>;
|
|
69
|
+
/** Event id → platform-shaped task detail. */
|
|
70
|
+
taskDetails: Record<string, CalendarTaskDetail>;
|
|
71
|
+
/** The waiting list as loaded — the journey seeds its state from it. */
|
|
72
|
+
waitingList: readonly CalendarWaitingEntry[];
|
|
73
|
+
/** Event id → the modification ledger as loaded. Optional: the
|
|
74
|
+
* workspace reads the ledger off `CalendarJourney.history`, which the
|
|
75
|
+
* host seeds however it likes. */
|
|
76
|
+
appointmentHistory?: Record<string, CalendarHistoryEntry[]>;
|
|
77
|
+
practiceFeatures: CalendarPracticeFeatures;
|
|
78
|
+
branches: readonly CalendarBranch[];
|
|
79
|
+
/** Care id → the medical devices it needs. */
|
|
80
|
+
careDevices: Readonly<Record<string, readonly string[]>>;
|
|
81
|
+
/** Patient id → required documents still unsigned. */
|
|
82
|
+
unsignedRequiredDocs: Readonly<Record<string, number>>;
|
|
83
|
+
/** Patients with an advanced e-signature (AES) setup. */
|
|
84
|
+
patientsWithAes: ReadonlySet<string>;
|
|
85
|
+
/** Appointment id → the deposit paid online when booking. */
|
|
86
|
+
paidOnline: Readonly<Record<string, number>>;
|
|
87
|
+
/** Appointment id → the phone typed on the booking site. */
|
|
88
|
+
bookingPhones: Readonly<Record<string, string>>;
|
|
89
|
+
patientById(id: string): CalendarPatient | undefined;
|
|
90
|
+
patientNotes(patientId: string): NotesPanelNote[];
|
|
91
|
+
patientAppointments(patientId: string): AppointmentItem[];
|
|
92
|
+
patientTasks(patientId: string): TasksPanelItem[];
|
|
93
|
+
careById(id: string): CalendarCare | undefined;
|
|
94
|
+
carePlanById(id: string): CalendarCarePlan | undefined;
|
|
95
|
+
/** Optional: no shipped code calls it — the editor links through
|
|
96
|
+
* `openCarePlansForPatient`, the details panel through
|
|
97
|
+
* `carePlanById`. */
|
|
98
|
+
carePlansForPatient?(patientId: string): CalendarCarePlan[];
|
|
99
|
+
/** Plans the editor may link to: not discarded or closed, with undone lines. */
|
|
100
|
+
openCarePlansForPatient(patientId: string): CalendarCarePlan[];
|
|
101
|
+
/** The care entries a link resolves to — plan lines in plan order, or
|
|
102
|
+
* the price-list picks. Unknown ids are dropped. */
|
|
103
|
+
careEntriesFromLink(link: CalendarCareLink): CalendarCareEntry[];
|
|
104
|
+
/** Closed dates plus holidays, unless the practice stays open on them. */
|
|
105
|
+
practiceClosedOn(dateIso: string): boolean;
|
|
106
|
+
/** Why a date (or, given an operator, that column) cannot take a
|
|
107
|
+
* booking — closed > holiday > absence; null when it can. */
|
|
108
|
+
closureOn(dateIso: string, operatorId?: string): CalendarClosure | null;
|
|
109
|
+
/** Local dates in [from, to] with practice hours that are neither
|
|
110
|
+
* closed nor a holiday. */
|
|
111
|
+
openDatesBetween(from: Date, to: Date): string[];
|
|
112
|
+
/** Waiting-since instant for an entry (platform `createdAt`). */
|
|
113
|
+
waitingSinceIso(entry: CalendarWaitingEntry): string;
|
|
114
|
+
}
|
|
115
|
+
/** Wrap whatever renders the calendar's panels and surface — one provider
|
|
116
|
+
* per subtree is fine (a rail renders its panels outside the page tree). */
|
|
117
|
+
export declare function CalendarDataProvider({ value, children, }: {
|
|
118
|
+
value: CalendarData;
|
|
119
|
+
children?: ReactNode;
|
|
120
|
+
}): import("react").FunctionComponentElement<import("react").ProviderProps<CalendarData | null>>;
|
|
121
|
+
export declare function useCalendarData(): CalendarData;
|
|
122
|
+
//# sourceMappingURL=calendar.data.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type SheetId = 'appointment-editor' | 'appointment-details' | 'find-slots' | 'backlog' | 'patient-care-plan';
|
|
2
|
+
export interface SheetHostContext {
|
|
3
|
+
open(id: SheetId): void;
|
|
4
|
+
close(): void;
|
|
5
|
+
}
|
|
6
|
+
/** Wrap whatever renders the panels and the surface — one provider per
|
|
7
|
+
* subtree is fine (a rail renders its panels outside the page tree). */
|
|
8
|
+
export declare const SheetHostProvider: import("react").Provider<SheetHostContext | null>;
|
|
9
|
+
export declare function useSheetHost(): SheetHostContext;
|
|
10
|
+
//# sourceMappingURL=calendar.host.d.ts.map
|