@alfadocs/ui-kit 1.13.0 → 1.15.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-CGuY4kmv.js +7480 -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 +82 -0
- package/dist/patterns/calendar/calendar-workspace.model.d.ts +380 -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 +85 -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,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar pattern — remembered per-user preferences.
|
|
3
|
+
*
|
|
4
|
+
* SHIPPED runtime module of the calendar pattern: everything exported
|
|
5
|
+
* here is public API of `@alfadocs/ui-kit/patterns/calendar`.
|
|
6
|
+
*
|
|
7
|
+
* The platform stores each user's calendar view and chair/operator
|
|
8
|
+
* selections server-side (`DoctorAddressUser.calendarView`,
|
|
9
|
+
* `calendarSelectedChairIds`, `calendarSelectedOperatorIds`, written by
|
|
10
|
+
* `setCalendarView` and the events-fetch side effect) and its display
|
|
11
|
+
* knobs in per-user settings. `CalendarPreferenceAdapter` is that seam:
|
|
12
|
+
* a host passes `CalendarWorkspace` a `preferences` adapter backed by
|
|
13
|
+
* whatever it already has — a PATCH-on-change client, `localStorage`,
|
|
14
|
+
* anything with get / set / clear — and the workspace, its surface and
|
|
15
|
+
* its cog all read and write through it.
|
|
16
|
+
*
|
|
17
|
+
* The default is `memoryPreferenceAdapter`, a module-level map: it
|
|
18
|
+
* survives remounts, re-renders and locale switches within one page
|
|
19
|
+
* load and resets on reload. Deliberately NOT `localStorage` and not
|
|
20
|
+
* the kit's `usePersistentState` — an unconfigured host (and every
|
|
21
|
+
* Storybook story) must not leak one mount's selections into the next,
|
|
22
|
+
* or into Chromatic. A host that wants durable preferences supplies the
|
|
23
|
+
* adapter.
|
|
24
|
+
*
|
|
25
|
+
* The adapter validates nothing; each call site passes a `read` guard,
|
|
26
|
+
* so a stale or foreign stored shape falls back to the default rather
|
|
27
|
+
* than leaking into render.
|
|
28
|
+
*/
|
|
29
|
+
import { type Dispatch, type SetStateAction } from 'react';
|
|
30
|
+
/** The per-user preference store — the platform's server-side seam. */
|
|
31
|
+
export interface CalendarPreferenceAdapter {
|
|
32
|
+
get(key: string): unknown;
|
|
33
|
+
set(key: string, value: unknown): void;
|
|
34
|
+
clear(): void;
|
|
35
|
+
}
|
|
36
|
+
/** Session-scoped, per-reload store — the default adapter. */
|
|
37
|
+
export declare const memoryPreferenceAdapter: CalendarPreferenceAdapter;
|
|
38
|
+
/** Forget everything in the default adapter — the tests' `afterEach`. */
|
|
39
|
+
export declare function resetCalendarPreferences(): void;
|
|
40
|
+
/**
|
|
41
|
+
* The storage keys the workspace remembers, in one place.
|
|
42
|
+
*
|
|
43
|
+
* The VALUES are load-bearing: they are what is already sitting in every
|
|
44
|
+
* host store and browser that has run this workspace. Renaming a key
|
|
45
|
+
* here silently forgets that user's view, weekend choice, chair and
|
|
46
|
+
* operator selections and cog settings — change a value only with a
|
|
47
|
+
* migration. The member names are free to change; the strings are not.
|
|
48
|
+
*/
|
|
49
|
+
export declare const CALENDAR_PREFERENCE_KEYS: {
|
|
50
|
+
readonly view: "calendarWorkspace.view";
|
|
51
|
+
readonly display: "calendarWorkspace.display";
|
|
52
|
+
readonly showWeekends: "calendarWorkspace.showWeekends";
|
|
53
|
+
readonly chairIds: "calendarWorkspace.chairIds";
|
|
54
|
+
readonly operatorIds: "calendarWorkspace.operatorIds";
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* `useState` whose value is remembered through the adapter. `read`
|
|
58
|
+
* validates the stored value — a stale or foreign shape falls back to
|
|
59
|
+
* `defaultValue` rather than leaking into render. Writes happen on set,
|
|
60
|
+
* never on mount, so merely opening a story remembers nothing.
|
|
61
|
+
*/
|
|
62
|
+
export declare function usePersistedPreference<T>(key: string, defaultValue: T | (() => T), read: (raw: unknown) => T | undefined, adapter?: CalendarPreferenceAdapter): [T, Dispatch<SetStateAction<T>>];
|
|
63
|
+
/** One of a closed set of string literals, else undefined. */
|
|
64
|
+
export declare function readEnum<T extends string>(allowed: readonly T[]): (raw: unknown) => T | undefined;
|
|
65
|
+
export declare function readBoolean(raw: unknown): boolean | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* A remembered id selection, kept to the ids that still exist (a retired
|
|
68
|
+
* chair or operator drops out silently). Any non-array is rejected; an
|
|
69
|
+
* empty array is a real "nothing selected" choice.
|
|
70
|
+
*/
|
|
71
|
+
export declare function readIdList(known: ReadonlyArray<{
|
|
72
|
+
id: string;
|
|
73
|
+
}>): (raw: unknown) => string[] | undefined;
|
|
74
|
+
//# sourceMappingURL=calendar.preferences.d.ts.map
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar demo — the SECONDARY SURFACES (the sheets): task details, the
|
|
3
|
+
* patient record / notes / appointments / tasks panels, the appointment
|
|
4
|
+
* editor (create, edit and details in ONE form) with its identity and
|
|
5
|
+
* extras blocks, the patient care plan, the Final State's Backlog and
|
|
6
|
+
* Increment 1's platform waiting list with their shared entry form,
|
|
7
|
+
* Increment 1's online-bookings panel, the find-free-slots finder and
|
|
8
|
+
* the front-desk print sheet.
|
|
9
|
+
*
|
|
10
|
+
* The editor's form is a DENSITY-TIERED grid: a container query on the
|
|
11
|
+
* panel's own inline size pairs its short fields from 30rem and moves the
|
|
12
|
+
* label beside the control from 44rem, so it fits the rail without
|
|
13
|
+
* scrolling. No target shrinks — only the column count and the label's
|
|
14
|
+
* position change.
|
|
15
|
+
*
|
|
16
|
+
* Every panel composes kit primitives over the host-supplied read model
|
|
17
|
+
* (`useCalendarData()`, see `calendar.data.ts`) and the pure model in
|
|
18
|
+
* `calendar.model.ts`; none knows WHERE it is hosted — the open / close
|
|
19
|
+
* seam is `calendar.host.ts`, which the Final State demo maps onto its
|
|
20
|
+
* full Control Room rail and the shipped `CalendarWorkspace` onto a
|
|
21
|
+
* minimal five-tool one. Nothing here imports from the stories module,
|
|
22
|
+
* the demos or the shared story shell.
|
|
23
|
+
*/
|
|
24
|
+
import { type ReactNode } from 'react';
|
|
25
|
+
import { type CalendarEvent } from '../../components/calendar';
|
|
26
|
+
import { type NotesPanelNote, type NotesPanelProps, type NotesPanelSubmission } from '../../components/notes-panel';
|
|
27
|
+
import { type ColorAssociation, type CalendarCarePlan, type CalendarAnamnesisAnswer, type CalendarOperatorGroup, type CalendarPatient, type CalendarWaitingEntry, type CalendarHistoryEntry, type CalendarSignChannel } from './calendar.types';
|
|
28
|
+
import { type CalendarRow, type DisplaySettings, type EditorPrefill, type EditorDraft, type DraftSlot, type SlotPatch, type BacklogFilter, type BacklogItem, type WaitingEntryDraft, type CalendarFreeSlot, type PrintDaySection, type FindSlotsSeed, type AvailabilityContext } from './calendar.model';
|
|
29
|
+
import { type EditorDraftExtras, type DeleteOptions } from './calendar-workspace.model';
|
|
30
|
+
export declare function TaskDetailsPanel({ row, locale, }: {
|
|
31
|
+
row: CalendarRow;
|
|
32
|
+
locale: string;
|
|
33
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare function PatientRecordPanel({ patientId, locale, }: {
|
|
35
|
+
patientId: string;
|
|
36
|
+
locale: string;
|
|
37
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
38
|
+
/**
|
|
39
|
+
* Where a note WRITE goes. The workspace builds one of these from its
|
|
40
|
+
* `CalendarJourney` and hands it down; the panel renders `notes` and
|
|
41
|
+
* reports intent, holding no note state and composing no note text of
|
|
42
|
+
* its own. Nothing the kit invented — a draft paragraph, a transcript,
|
|
43
|
+
* an author's name — can reach a patient's record through it.
|
|
44
|
+
*/
|
|
45
|
+
export interface PatientNotesSeam {
|
|
46
|
+
/** The patient's notes as the HOST holds them, newest first. */
|
|
47
|
+
notes: NotesPanelNote[];
|
|
48
|
+
/** Commit what was typed. The host stamps the id, date and author. */
|
|
49
|
+
onAddNote: (submission: NotesPanelSubmission) => void;
|
|
50
|
+
/** Replace a note's body with the plain text typed in the dialog. */
|
|
51
|
+
onEditNote: (noteId: string, content: string) => void;
|
|
52
|
+
onDeleteNote: (noteId: string) => void;
|
|
53
|
+
onTogglePin: (noteId: string) => void;
|
|
54
|
+
/** The practice's own drafting endpoint. Omitted → no AI affordance. */
|
|
55
|
+
onRequestAiDraft?: NotesPanelProps['onRequestAiDraft'];
|
|
56
|
+
/** The host's live transcription. Omitted → no microphone. */
|
|
57
|
+
onDictate?: NotesPanelProps['onDictate'];
|
|
58
|
+
}
|
|
59
|
+
export declare function PatientNotesPanel({ patientId, seam, editable, }: {
|
|
60
|
+
patientId: string;
|
|
61
|
+
/**
|
|
62
|
+
* Where every write goes. WITHOUT one the panel is a read-only
|
|
63
|
+
* timeline read from the host's read model: there is nowhere to
|
|
64
|
+
* persist to, so no write is offered and none can be lost.
|
|
65
|
+
*/
|
|
66
|
+
seam?: PatientNotesSeam;
|
|
67
|
+
/**
|
|
68
|
+
* Whether this reader may write at all — the platform's
|
|
69
|
+
* `practice_appointment_edit` right, off in read-only mode. False (or
|
|
70
|
+
* no `seam`) leaves the composer, the pin and the per-note edit /
|
|
71
|
+
* delete dialogs unmounted.
|
|
72
|
+
*/
|
|
73
|
+
editable?: boolean;
|
|
74
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
export declare function PatientAppointmentsTimeline({ patientId, locale, }: {
|
|
76
|
+
patientId: string;
|
|
77
|
+
locale?: string;
|
|
78
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
export declare function PatientTasksPanel({ patientId }: {
|
|
80
|
+
patientId: string;
|
|
81
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
82
|
+
export declare function DurationCombobox({ value, onChange, }: {
|
|
83
|
+
value: number | null;
|
|
84
|
+
onChange: (next: number | null) => void;
|
|
85
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
86
|
+
/** Channels the editor's send-reminder group may offer. */
|
|
87
|
+
export type ReminderChannel = 'whatsapp' | 'sms' | 'email';
|
|
88
|
+
/** The Final State's full set — the default when a host says nothing. */
|
|
89
|
+
export declare const REMINDER_CHANNELS: readonly ReminderChannel[];
|
|
90
|
+
/** The platform facts the Increment 1 editor adds — every field optional,
|
|
91
|
+
* so a host that passes nothing gets the Final State form unchanged. */
|
|
92
|
+
export interface EditorPlatformOptions {
|
|
93
|
+
/** Practice branches (platform "Branca"); the select shows for > 1. */
|
|
94
|
+
branches?: readonly {
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
}[];
|
|
98
|
+
/** Care id → device names; drives the read-only devices line. */
|
|
99
|
+
devicesByCare?: Readonly<Record<string, readonly string[]>>;
|
|
100
|
+
/** Required documents still unsigned for a patient (sign-mode radios). */
|
|
101
|
+
unsignedRequiredDocs?: (patientId: string) => number;
|
|
102
|
+
/** The agenda, for the busy chair / busy operator warnings. */
|
|
103
|
+
rows?: readonly CalendarRow[];
|
|
104
|
+
/** Enter in a text field submits (the platform's modal never did). */
|
|
105
|
+
submitOnEnter?: boolean;
|
|
106
|
+
/** The edited appointment belongs to a series — offer the save scope. */
|
|
107
|
+
recurringScope?: boolean;
|
|
108
|
+
/** Price-list recurrence parent — ask about the care-plan lines on delete. */
|
|
109
|
+
carePlanCleanup?: boolean;
|
|
110
|
+
/** Create bill asks before executing the linked treatments. */
|
|
111
|
+
confirmCreateBill?: boolean;
|
|
112
|
+
/** Operator options for the select — defaults to the shared active
|
|
113
|
+
* cast. A host whose appointment is held by an operator the practice
|
|
114
|
+
* has since DISABLED passes the wider list, so the name still shows
|
|
115
|
+
* (a new appointment keeps the active cast, as on the platform). */
|
|
116
|
+
operatorOptions?: readonly {
|
|
117
|
+
id: string;
|
|
118
|
+
title: string;
|
|
119
|
+
}[];
|
|
120
|
+
/** Reminder channels in the action footer — defaults to all three.
|
|
121
|
+
* The platform has NO "send reminder now" action on the calendar; its
|
|
122
|
+
* only outbound bridge is the popover's WhatsApp Snippets island, so
|
|
123
|
+
* Increment 1 narrows this to `['whatsapp']` (audit A2). */
|
|
124
|
+
reminderChannels?: readonly ReminderChannel[];
|
|
125
|
+
/** Offer the Final State's extra recurrence rules — the "Ends: after N
|
|
126
|
+
* / on a date" choice and the skip-closed-days switch. The platform's
|
|
127
|
+
* modal only ever sets a repetition count, so Increment 1 turns this
|
|
128
|
+
* off and keeps frequency + count alone (audit A3). */
|
|
129
|
+
recurrenceExtras?: boolean;
|
|
130
|
+
/** Warn — never block — when the chosen operator is away that day, as
|
|
131
|
+
* a third sibling of the busy warnings. Off: an absence keeps the
|
|
132
|
+
* date-side closure banner and holds the save (audit C9). */
|
|
133
|
+
operatorAbsenceWarning?: boolean;
|
|
134
|
+
/** Show the reminder checkboxes only once a patient is chosen, and
|
|
135
|
+
* disable each channel the patient cannot take, with the platform's
|
|
136
|
+
* "(disabled)" suffix on the label (audit C10). */
|
|
137
|
+
reminderCapability?: boolean;
|
|
138
|
+
/** Show "First visit" only once a patient is chosen (audit C11). */
|
|
139
|
+
firstVisitRequiresPatient?: boolean;
|
|
140
|
+
/** Give each price-list row its catalogue phases, and lock a row the
|
|
141
|
+
* practice has already invoiced (audit C12). */
|
|
142
|
+
priceListPhases?: boolean;
|
|
143
|
+
/** Refuse a description longer than this and say so (platform: 255
|
|
144
|
+
* characters, silently blocking; audit C14). */
|
|
145
|
+
descriptionMaxLength?: number;
|
|
146
|
+
/** Where "save and go back" goes — the deep link's origin. Only ever
|
|
147
|
+
* reached from a prefill with `simpleSave: false` (audit C13). */
|
|
148
|
+
onSaveAndReturn?: () => void;
|
|
149
|
+
}
|
|
150
|
+
export declare function AppointmentEditorPanel({ prefill, onSave, onDelete, onDuplicate, panelTitle, headerIcon, identity, after, closeOnSave, onDraftChange, slotPatch, colorAssociation, locale, scheduleByEntry, history, notes, onMove, onCopy, onWhatsApp, readOnly, platform, className, }: {
|
|
151
|
+
prefill?: EditorPrefill;
|
|
152
|
+
onSave: (draft: EditorDraft, extras?: EditorDraftExtras) => void;
|
|
153
|
+
/** Live composition feed — the grid mirrors the slot being filled as a
|
|
154
|
+
* draft placeholder while this panel is open. Emits `null` on unmount
|
|
155
|
+
* so the placeholder clears with the panel. */
|
|
156
|
+
onDraftChange?: (draft: DraftSlot | null) => void;
|
|
157
|
+
/** Slot edits made on the grid (dragging or resizing the draft mirror).
|
|
158
|
+
* Applied by `tick` and only to the slot fields, so everything else
|
|
159
|
+
* the user has typed survives. */
|
|
160
|
+
slotPatch?: SlotPatch | null;
|
|
161
|
+
/** Edit mode only — removes the event; confirmed via an alert dialog
|
|
162
|
+
* that also asks the recurring scope and the care-plan cleanup. */
|
|
163
|
+
onDelete?: (eventId: string, options?: DeleteOptions) => void;
|
|
164
|
+
/** Edit mode only — re-seeds the CREATE editor from the current form
|
|
165
|
+
* state (everything but the identity). Unset hides the Duplicate icon
|
|
166
|
+
* altogether, leaving Copy… placement as the one copy path. */
|
|
167
|
+
onDuplicate?: (prefill: EditorPrefill) => void;
|
|
168
|
+
/** Panel-chrome heading override — "Appointment details" reuses this
|
|
169
|
+
* SAME form so read and edit are one surface, not two paradigms. */
|
|
170
|
+
panelTitle?: string;
|
|
171
|
+
headerIcon?: ReactNode;
|
|
172
|
+
/** Identity block (avatar · name · status chip) above the form. */
|
|
173
|
+
identity?: ReactNode;
|
|
174
|
+
/** Read-only extras (billing, patient contact) below the form. */
|
|
175
|
+
after?: ReactNode;
|
|
176
|
+
closeOnSave?: boolean;
|
|
177
|
+
/** The cog's colour association: the default colour on create and the
|
|
178
|
+
* re-colour when the chair/operator select changes. */
|
|
179
|
+
colorAssociation: ColorAssociation;
|
|
180
|
+
/** BCP 47 locale for the checklist's scheduled-date chips and prices. */
|
|
181
|
+
locale?: string;
|
|
182
|
+
/** Plan line id → its booked appointments (`scheduleByEntryId`). */
|
|
183
|
+
scheduleByEntry?: Record<string, Array<{
|
|
184
|
+
eventId: string;
|
|
185
|
+
startIso: string;
|
|
186
|
+
}>>;
|
|
187
|
+
/** Details only — the ledger behind the History sub-view (newest first). */
|
|
188
|
+
history?: CalendarHistoryEntry[];
|
|
189
|
+
/** Details only — the patient notes behind the Notes sub-view. */
|
|
190
|
+
notes?: ReactNode;
|
|
191
|
+
/** Edit only — arm the grid's move mode (the platform's "Sposta"). */
|
|
192
|
+
onMove?: () => void;
|
|
193
|
+
/** Edit only — arm the grid's copy mode; a linked appointment offers
|
|
194
|
+
* the platform's two copies (appointment only / with treatments). */
|
|
195
|
+
onCopy?: (withTreatments: boolean) => void;
|
|
196
|
+
/** Bridge the WhatsApp reminder to the legacy Snippets island. */
|
|
197
|
+
onWhatsApp?: () => void;
|
|
198
|
+
/** No edit permission: every write action goes, the form locks and a
|
|
199
|
+
* note says why. */
|
|
200
|
+
readOnly?: boolean;
|
|
201
|
+
/** Platform parity extras — see `EditorPlatformOptions`. */
|
|
202
|
+
platform?: EditorPlatformOptions;
|
|
203
|
+
/** Root class — a dialog host bounds the panel's height through it. */
|
|
204
|
+
className?: string;
|
|
205
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
206
|
+
export declare function IndicatorChips({ event }: {
|
|
207
|
+
event: CalendarEvent;
|
|
208
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
209
|
+
export declare function AppointmentIdentity({ row, patient, showAge, onOpenPatient, anamnesisAnswers, }: {
|
|
210
|
+
row: CalendarRow;
|
|
211
|
+
patient?: CalendarPatient;
|
|
212
|
+
/** Append the platform popover's "(NN anni)" to the name (audit C15). */
|
|
213
|
+
showAge?: boolean;
|
|
214
|
+
/** Set = the name becomes the platform's patient-folder link. */
|
|
215
|
+
onOpenPatient?: (patient: CalendarPatient) => void;
|
|
216
|
+
/** The highlighted anamnesis answers themselves — the platform's
|
|
217
|
+
* details dialog lists them, the popover only counts (audit C16). */
|
|
218
|
+
anamnesisAnswers?: readonly CalendarAnamnesisAnswer[];
|
|
219
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
220
|
+
export declare function SendReminderGroup({ patient, onWhatsApp, channels: allowed, }: {
|
|
221
|
+
patient: CalendarPatient;
|
|
222
|
+
/** When set, the WhatsApp segment bridges to the legacy Snippets
|
|
223
|
+
* island instead of the demo-fake send. */
|
|
224
|
+
onWhatsApp?: () => void;
|
|
225
|
+
/** Which channels to offer — defaults to all three. Increment 1 keeps
|
|
226
|
+
* the WhatsApp bridge alone, the platform's only outbound path. */
|
|
227
|
+
channels?: readonly ReminderChannel[];
|
|
228
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
229
|
+
/** The platform popover facts the Final State never modelled — every
|
|
230
|
+
* field optional, so a host that passes nothing sees the extras as before. */
|
|
231
|
+
export interface ExtrasPlatformOptions {
|
|
232
|
+
/** The patient has an advanced e-signature setup (else "Enable AES"). */
|
|
233
|
+
aesEnabled?: boolean;
|
|
234
|
+
/** Deposit paid online when booking (Stripe). */
|
|
235
|
+
paidOnlineAmount?: number;
|
|
236
|
+
/** The patient's outstanding balance. */
|
|
237
|
+
toCollectAmount?: number;
|
|
238
|
+
/** Payment automation is off and the upsell toggle is on. */
|
|
239
|
+
pauUpsell?: boolean;
|
|
240
|
+
/** The user's map-link setting (the display cog). */
|
|
241
|
+
mapsLink?: boolean;
|
|
242
|
+
/** The phone typed on the booking site, when it differs from the record. */
|
|
243
|
+
bookingPhone?: string;
|
|
244
|
+
}
|
|
245
|
+
export declare function AppointmentExtras({ row, patient, locale, signRequestedVia, onRequestSignature, onRequestSignatureOnDevice, readOnly, platform, }: {
|
|
246
|
+
row: CalendarRow;
|
|
247
|
+
patient?: CalendarPatient;
|
|
248
|
+
locale: string;
|
|
249
|
+
/** Channel the signature request went out on (journey state wins). */
|
|
250
|
+
signRequestedVia?: CalendarSignChannel;
|
|
251
|
+
onRequestSignature?: (eventId: string, channel: CalendarSignChannel) => void;
|
|
252
|
+
/** "On this device…" — bridges to the legacy e-signature flow. */
|
|
253
|
+
onRequestSignatureOnDevice?: () => void;
|
|
254
|
+
/** No edit permission: the request menu and the setup links go. */
|
|
255
|
+
readOnly?: boolean;
|
|
256
|
+
/** Platform parity extras — see `ExtrasPlatformOptions`. */
|
|
257
|
+
platform?: ExtrasPlatformOptions;
|
|
258
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
259
|
+
export declare function PatientCarePlanPanel({ plans, linkedPlanId, linkedEntryIds, schedule, locale, onReveal, }: {
|
|
260
|
+
plans: CalendarCarePlan[];
|
|
261
|
+
/** The selected appointment's plan — listed first, entries expanded. */
|
|
262
|
+
linkedPlanId?: string;
|
|
263
|
+
linkedEntryIds: string[];
|
|
264
|
+
schedule: Record<string, Array<{
|
|
265
|
+
eventId: string;
|
|
266
|
+
startIso: string;
|
|
267
|
+
}>>;
|
|
268
|
+
locale: string;
|
|
269
|
+
/** Navigate the grid to the appointment and select it. */
|
|
270
|
+
onReveal: (eventId: string) => void;
|
|
271
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
272
|
+
export declare function BacklogPanel({ items, locale, seed, signRequests, onProcess, onFocusEvent, onConfirm, onRequestSignature, onScheduleWaiting, onRemoveWaiting, onFindSlotsForWaiting, onUpsertWaiting, quickView, onOpenEntryForm, onPlaceWaiting, }: {
|
|
273
|
+
items: BacklogItem[];
|
|
274
|
+
locale: string;
|
|
275
|
+
/** A fresh tick preselects `type` — how every caller opens the queue
|
|
276
|
+
* on one segment without reaching into panel state. */
|
|
277
|
+
seed: {
|
|
278
|
+
tick: number;
|
|
279
|
+
type: BacklogFilter;
|
|
280
|
+
};
|
|
281
|
+
/** Event id → the channel a signature request went out on this session. */
|
|
282
|
+
signRequests: Record<string, CalendarSignChannel>;
|
|
283
|
+
/** Dock the editor prefilled (Process booking, Assign operator). */
|
|
284
|
+
onProcess: (prefill: EditorPrefill) => void;
|
|
285
|
+
/** Ring the appointment on the grid so it is clear which one is meant. */
|
|
286
|
+
onFocusEvent: (eventId: string) => void;
|
|
287
|
+
/** Unconfirmed → confirmed, in place. */
|
|
288
|
+
onConfirm: (eventId: string) => void;
|
|
289
|
+
onRequestSignature: (eventId: string, channel: CalendarSignChannel) => void;
|
|
290
|
+
onScheduleWaiting: (entry: CalendarWaitingEntry) => void;
|
|
291
|
+
onRemoveWaiting: (entry: CalendarWaitingEntry) => void;
|
|
292
|
+
/** Hand the entry to the find-free-slots tool, prefilled. */
|
|
293
|
+
onFindSlotsForWaiting: (entry: CalendarWaitingEntry) => void;
|
|
294
|
+
/** The entry form's Save — add (no id) or update (id) in the queue. */
|
|
295
|
+
onUpsertWaiting: (draft: WaitingEntryDraft) => void;
|
|
296
|
+
/** Increment 1: the platform's waiting-list quick views above the queue. */
|
|
297
|
+
quickView?: boolean;
|
|
298
|
+
/** Set = Add entry and the row's edit open the HOST's entry form (a
|
|
299
|
+
* dialog) instead of the in-panel sub-view. */
|
|
300
|
+
onOpenEntryForm?: (entry?: CalendarWaitingEntry) => void;
|
|
301
|
+
/** Set = Schedule / Reschedule hands the entry to the host's placement
|
|
302
|
+
* mode (create / move banner) instead of opening the editor at once. */
|
|
303
|
+
onPlaceWaiting?: (entry: CalendarWaitingEntry) => void;
|
|
304
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
305
|
+
export declare function BookingsPanel({ bookings, locale, privacy, onShowInCalendar, onComplete, }: {
|
|
306
|
+
bookings: readonly CalendarRow[];
|
|
307
|
+
locale?: string;
|
|
308
|
+
/** Masks the patient names, in step with the grid. */
|
|
309
|
+
privacy?: boolean;
|
|
310
|
+
/** Steers the grid to the booking and rings its card. */
|
|
311
|
+
onShowInCalendar: (eventId: string) => void;
|
|
312
|
+
/** Opens the editor to complete it (platform "Completa appuntamento"). */
|
|
313
|
+
onComplete: (row: CalendarRow) => void;
|
|
314
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
315
|
+
export declare function WaitingListPanel({ entries, rows, locale, onPlaceWaiting, onRemoveWaiting, onOpenEntryForm, onOpenPatient, onOpenAppointment, }: {
|
|
316
|
+
entries: CalendarWaitingEntry[];
|
|
317
|
+
/** Live grid rows — the linked appointment's date, colour and care. */
|
|
318
|
+
rows: CalendarRow[];
|
|
319
|
+
locale: string;
|
|
320
|
+
/** Schedule / Reschedule → the host's create / move placement mode. */
|
|
321
|
+
onPlaceWaiting: (entry: CalendarWaitingEntry) => void;
|
|
322
|
+
/** Delete — immediate, as on the platform (the host toasts an Undo). */
|
|
323
|
+
onRemoveWaiting: (entry: CalendarWaitingEntry) => void;
|
|
324
|
+
/** Add entry, and a row's edit → the host's entry sub-view. */
|
|
325
|
+
onOpenEntryForm: (entry?: CalendarWaitingEntry) => void;
|
|
326
|
+
/** The patient-folder hop the platform's name link makes. */
|
|
327
|
+
onOpenPatient: (patient: CalendarPatient) => void;
|
|
328
|
+
/** The platform's `focusAppointmentId` deep link — steer and ring. */
|
|
329
|
+
onOpenAppointment: (eventId: string) => void;
|
|
330
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
331
|
+
/**
|
|
332
|
+
* The platform's waiting-list AddModal as a rail sub-view — same field
|
|
333
|
+
* order (patient, operator, colour, description) and its one rule:
|
|
334
|
+
* a patient OR a description, checked on submit with an inline error.
|
|
335
|
+
*/
|
|
336
|
+
export declare function WaitingListEntryForm({ entry, onSave, onCancel, chrome, }: {
|
|
337
|
+
/** Set = edit this entry; unset = add a new one. */
|
|
338
|
+
entry?: CalendarWaitingEntry;
|
|
339
|
+
onSave: (draft: WaitingEntryDraft) => void;
|
|
340
|
+
onCancel: () => void;
|
|
341
|
+
/** `'dialog'` drops the rail's back arrow — the dialog's own Close and
|
|
342
|
+
* the form's Cancel already dismiss it. */
|
|
343
|
+
chrome?: 'panel' | 'dialog';
|
|
344
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
345
|
+
/**
|
|
346
|
+
* The call sheet itself. A portal to `document.body`: the shell's AppFrame
|
|
347
|
+
* is an `h-dvh overflow-hidden` clamp that prints one screenful, so the
|
|
348
|
+
* sheet lives outside it — hidden on screen, the only thing on paper.
|
|
349
|
+
*/
|
|
350
|
+
export declare function PrintSheet({ sections, rangeTitle, axisKind, visibleChairIds, visibleOperatorIds, privacy, locale, }: {
|
|
351
|
+
sections: PrintDaySection[];
|
|
352
|
+
rangeTitle: string;
|
|
353
|
+
axisKind: DisplaySettings['resourceKind'];
|
|
354
|
+
visibleChairIds: string[];
|
|
355
|
+
visibleOperatorIds: string[];
|
|
356
|
+
privacy: boolean;
|
|
357
|
+
locale: string;
|
|
358
|
+
}): import("react").ReactPortal | null;
|
|
359
|
+
/** The platform depth the dialog host asks for (decision 6). Every field
|
|
360
|
+
* is optional, so the rail keeps exactly the behaviour it had. */
|
|
361
|
+
export interface FindSlotsPlatformOptions {
|
|
362
|
+
/** Results as clickable rows and NO grid projection — the dialog host. */
|
|
363
|
+
listOnly?: boolean;
|
|
364
|
+
/** Care id → medical devices it needs (`FIND_FREE_SLOTS_BY_CARE`). */
|
|
365
|
+
devicesByCare?: Readonly<Record<string, readonly string[]>>;
|
|
366
|
+
/** Warn past the platform's look-ahead ceiling; the search still runs. */
|
|
367
|
+
maxRangeDays?: number;
|
|
368
|
+
/** "Show more slots" pushes the To date out by this many days. */
|
|
369
|
+
pagerStepDays?: number;
|
|
370
|
+
/** Advisory: the practice has at least one business-hours row. */
|
|
371
|
+
practiceHasBusinessHours?: boolean;
|
|
372
|
+
/** Advisory: at least one operator has business-hours rows. */
|
|
373
|
+
operatorsHaveBusinessHours?: boolean;
|
|
374
|
+
/** The advisory's scheduler link. */
|
|
375
|
+
onOpenScheduler?: () => void;
|
|
376
|
+
/** Operator and chair scope as grouped checklists (the platform's
|
|
377
|
+
* `OperatorDropdown` / `ChairDropdown`) instead of one Select plus
|
|
378
|
+
* "Any". Nothing ticked means every eligible resource, exactly as
|
|
379
|
+
* the platform's empty selection does server-side. */
|
|
380
|
+
multiSelectScope?: boolean;
|
|
381
|
+
/** Group sections for that operator checklist (platform
|
|
382
|
+
* `GetGroupedOperatorService`); absent = one flat list. */
|
|
383
|
+
operatorGroups?: readonly CalendarOperatorGroup[];
|
|
384
|
+
}
|
|
385
|
+
export declare function FindFreeSlotsPanel({ rows, locale, seed, onBookSlot, onShowInCalendar, platform, }: {
|
|
386
|
+
rows: CalendarRow[];
|
|
387
|
+
locale: string;
|
|
388
|
+
/** Prefill context (the tool keys its panel by seed.tick). */
|
|
389
|
+
seed?: FindSlotsSeed | null;
|
|
390
|
+
onBookSlot: (prefill: EditorPrefill) => void;
|
|
391
|
+
/** Platform depth the rail never needed — absent = rail behaviour. */
|
|
392
|
+
platform?: FindSlotsPlatformOptions;
|
|
393
|
+
/** Project the found free ranges onto the grid (null = clear) — the
|
|
394
|
+
* Calendar dims booked cards and glows the free ranges. The context
|
|
395
|
+
* carries the seeded patient/care into grid-click bookings. */
|
|
396
|
+
onShowInCalendar: (slots: CalendarFreeSlot[] | null, fromDate?: Date, context?: AvailabilityContext) => void;
|
|
397
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
398
|
+
//# sourceMappingURL=calendar.sheets.d.ts.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type CalendarPreferenceAdapter } from './calendar.preferences';
|
|
2
|
+
import { type CalendarRow, type RailFocus, type EditorPrefill, type HistoryInput, type AvailabilityContext, type CalendarFreeSlot } from './calendar.model';
|
|
3
|
+
import { type WorkspaceDisplaySettings, type CreateModeRequest, type PlacementRequest, type SaveNotice, type CalendarWorkspaceToolId } from './calendar-workspace.model';
|
|
4
|
+
export declare function CalendarSurface({ rows, setRows, onFocus, locale, onComposeNew, onOpenWaitingList, onAddWaitingEntry, onOpenOnlineBookings, onlineBookingsCount, waitingBadgeCount, onVisibleRangeChange, selectedEventId, gotoRequest, onBookSlot, display, setDisplay, onHistory, readOnly, placement, onPlacementEnd, createMode, onCreateModeEnd, focusScroll, saveNotice, privacy, onPrivacyChange, availability, availabilityContext, availableTools, schedulerLicenseKey, id, preferences, }: {
|
|
5
|
+
rows: CalendarRow[];
|
|
6
|
+
setRows: React.Dispatch<React.SetStateAction<CalendarRow[]>>;
|
|
7
|
+
onFocus: (focus: RailFocus) => void;
|
|
8
|
+
locale: string;
|
|
9
|
+
/** Masks patient names on the grid, the peek and the print sheet. Owned
|
|
10
|
+
* by the journey so the rail's Appointments panel masks in step. */
|
|
11
|
+
privacy: boolean;
|
|
12
|
+
onPrivacyChange: (next: boolean) => void;
|
|
13
|
+
/** The finder's live projection: free ranges glow, booked cards dim,
|
|
14
|
+
* and a click inside a range books it. Null when no search is shown. */
|
|
15
|
+
availability: CalendarFreeSlot[] | null;
|
|
16
|
+
availabilityContext: AvailabilityContext | null;
|
|
17
|
+
/** No edit permission: no drag, no slot-click create. */
|
|
18
|
+
readOnly?: boolean;
|
|
19
|
+
/** A Move… / Copy… armed from the details panel — the grid shows the
|
|
20
|
+
* mode banner and the next empty-slot click places the appointment. */
|
|
21
|
+
placement?: PlacementRequest | null;
|
|
22
|
+
/** The placement landed (`true`) or was cancelled. */
|
|
23
|
+
onPlacementEnd?: (landed?: boolean) => void;
|
|
24
|
+
/** A create mode armed by a deep link or the Backlog's Schedule — the
|
|
25
|
+
* banner stands until the next empty-slot click or Cancel. */
|
|
26
|
+
createMode?: CreateModeRequest | null;
|
|
27
|
+
/** The create mode landed or was cancelled. */
|
|
28
|
+
onCreateModeEnd?: () => void;
|
|
29
|
+
/** Deep link `focusAppointmentId`: scroll the card into view and ring
|
|
30
|
+
* it. Tick-keyed so the same id can be re-focused. */
|
|
31
|
+
focusScroll?: {
|
|
32
|
+
tick: number;
|
|
33
|
+
eventId: string;
|
|
34
|
+
} | null;
|
|
35
|
+
/** A save just landed — toast "Saved for {date}" and, when the day is
|
|
36
|
+
* off screen or filtered out, a Go to action (decision 10). */
|
|
37
|
+
saveNotice?: SaveNotice | null;
|
|
38
|
+
/** New appointment — seeds a clean editor (the host docks the panel). */
|
|
39
|
+
onComposeNew: () => void;
|
|
40
|
+
/** The split button's main segment — the waiting-list panel. */
|
|
41
|
+
onOpenWaitingList: () => void;
|
|
42
|
+
/** The split button's plus segment — the waiting-list entry form. */
|
|
43
|
+
onAddWaitingEntry: () => void;
|
|
44
|
+
/** Waiting ENTRIES only — online bookings carry their own count. */
|
|
45
|
+
waitingBadgeCount: number;
|
|
46
|
+
/** The Online bookings button — the platform's page hop (a toast). */
|
|
47
|
+
onOpenOnlineBookings: () => void;
|
|
48
|
+
/** Bookings of the last thirty days still missing a patient or an
|
|
49
|
+
* operator — the count the platform's alert strip carries. */
|
|
50
|
+
onlineBookingsCount: number;
|
|
51
|
+
/** The grid event whose details panel is docked — ringed on the grid. */
|
|
52
|
+
selectedEventId: string | null;
|
|
53
|
+
/** Navigate seam — tick-keyed so re-steering to the same day works. */
|
|
54
|
+
gotoRequest: {
|
|
55
|
+
tick: number;
|
|
56
|
+
date: Date;
|
|
57
|
+
} | null;
|
|
58
|
+
/** Seed the editor prefilled (an empty-slot click, a booking to process). */
|
|
59
|
+
onBookSlot: (prefill: EditorPrefill) => void;
|
|
60
|
+
/** The cog's settings — owned by the journey (the editor reads them). */
|
|
61
|
+
display: WorkspaceDisplaySettings;
|
|
62
|
+
setDisplay: React.Dispatch<React.SetStateAction<WorkspaceDisplaySettings>>;
|
|
63
|
+
/** Ledger feed — a committed drag or resize of a patient appointment. */
|
|
64
|
+
onHistory: (eventId: string, entry: HistoryInput) => void;
|
|
65
|
+
/** The grid's visible range (epoch ms) — scopes the unconfirmed queue. */
|
|
66
|
+
onVisibleRangeChange: (range: {
|
|
67
|
+
start: number;
|
|
68
|
+
end: number;
|
|
69
|
+
}) => void;
|
|
70
|
+
/** The rail tools this host can back. A toolbar control whose tool is
|
|
71
|
+
* not in the set is not rendered at all — a button that opens a
|
|
72
|
+
* panel the host has no data for is worse than a missing one. */
|
|
73
|
+
availableTools: ReadonlySet<CalendarWorkspaceToolId>;
|
|
74
|
+
/** The host's FullCalendar Scheduler licence key, handed to the kit
|
|
75
|
+
* `Calendar`. Undefined leaves the component on its own environment
|
|
76
|
+
* default — the grid behaves exactly as it did without this prop. */
|
|
77
|
+
schedulerLicenseKey?: string;
|
|
78
|
+
/** The kit Calendar's instance id — the agent registry's handle and a
|
|
79
|
+
* public DOM hook. One workspace per page keeps the default. */
|
|
80
|
+
id?: string;
|
|
81
|
+
/** Where the toolbar's remembered choices live — the host's per-user
|
|
82
|
+
* store. Defaults to the session-scoped in-memory adapter. */
|
|
83
|
+
preferences?: CalendarPreferenceAdapter;
|
|
84
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
85
|
+
//# sourceMappingURL=calendar.surface.d.ts.map
|