formanitor 0.0.50 → 0.1.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/index.cjs +673 -349
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +116 -70
- package/dist/index.d.ts +116 -70
- package/dist/index.mjs +667 -350
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
|
-
type FieldType =
|
|
4
|
+
type FieldType = "text" | "number" | "textarea" | "diagnosis_textarea" | "richtext" | "select" | "multiselect" | "radio" | "repeatable" | "checkbox" | "image_upload" | "media_upload" | "file_upload" | "signature" | "date" | "datetime" | "editable_table" | "static_text" | "medications" | "investigations" | "procedures" | "vitals" | "hidden_vitals" | "referral" | "followup" | "toggle" | "urology_smart_history" | "urology_examination" | "urology_pathway" | string;
|
|
5
5
|
interface ValidationRule {
|
|
6
6
|
min?: number;
|
|
7
7
|
max?: number;
|
|
@@ -11,7 +11,7 @@ interface ValidationRule {
|
|
|
11
11
|
custom?: (value: any) => string | null;
|
|
12
12
|
}
|
|
13
13
|
interface Permission {
|
|
14
|
-
[role: string]:
|
|
14
|
+
[role: string]: "edit" | "view" | "hide";
|
|
15
15
|
}
|
|
16
16
|
interface DataSource {
|
|
17
17
|
source: string;
|
|
@@ -19,7 +19,7 @@ interface DataSource {
|
|
|
19
19
|
dependsOn?: string[];
|
|
20
20
|
}
|
|
21
21
|
interface EventDefinition {
|
|
22
|
-
trigger:
|
|
22
|
+
trigger: "onValueChange" | "onBlur" | "onFocus";
|
|
23
23
|
condition?: Condition;
|
|
24
24
|
emit: string;
|
|
25
25
|
}
|
|
@@ -28,6 +28,34 @@ interface FieldPrefill {
|
|
|
28
28
|
source?: string;
|
|
29
29
|
field?: string;
|
|
30
30
|
}
|
|
31
|
+
/** Optional Tailwind (or other) class names applied on top of each field’s default styles. */
|
|
32
|
+
interface FieldStyleClassNames {
|
|
33
|
+
/** Outermost wrapper around the field (typically the `space-y-*` column). */
|
|
34
|
+
wrapper?: string;
|
|
35
|
+
/** Primary field label (the `Label` next to the control). */
|
|
36
|
+
label?: string;
|
|
37
|
+
/** Main interactive control: input, textarea, select trigger, upload area, bordered option list, etc. */
|
|
38
|
+
control?: string;
|
|
39
|
+
/** Helper text under the field (`description` in schema). */
|
|
40
|
+
description?: string;
|
|
41
|
+
/** Validation / error line below the field. */
|
|
42
|
+
error?: string;
|
|
43
|
+
/** The red asterisk shown when `required` is true (only if `showRequiredAsterisk` is not false). */
|
|
44
|
+
requiredIndicator?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Per-field presentation overrides. All keys optional — omitting `style` keeps existing behaviour.
|
|
48
|
+
*/
|
|
49
|
+
interface FieldStyleConfig {
|
|
50
|
+
/** When false, the primary label row is hidden (controls should use `aria-label`). Default true. */
|
|
51
|
+
labelVisible?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* When false, the red * for required fields is not rendered. Validation still uses `required`.
|
|
54
|
+
* Default true (show asterisk when required).
|
|
55
|
+
*/
|
|
56
|
+
showRequiredAsterisk?: boolean;
|
|
57
|
+
classNames?: FieldStyleClassNames;
|
|
58
|
+
}
|
|
31
59
|
interface BaseFieldDef {
|
|
32
60
|
id: string;
|
|
33
61
|
type: FieldType;
|
|
@@ -49,7 +77,7 @@ interface BaseFieldDef {
|
|
|
49
77
|
* - "center" is the main content column and is 2× the width of side columns.
|
|
50
78
|
* Default: "center" when omitted.
|
|
51
79
|
*/
|
|
52
|
-
position?:
|
|
80
|
+
position?: "left" | "center" | "right";
|
|
53
81
|
/**
|
|
54
82
|
* How many layout columns this field spans horizontally.
|
|
55
83
|
* - 1 = occupies its own column (e.g. just "left", just "center", or just "right")
|
|
@@ -63,6 +91,8 @@ interface BaseFieldDef {
|
|
|
63
91
|
* shows the label in a colored block above the input).
|
|
64
92
|
*/
|
|
65
93
|
theme?: string;
|
|
94
|
+
/** Optional layout and class overrides for this field (see {@link FieldStyleConfig}). */
|
|
95
|
+
style?: FieldStyleConfig;
|
|
66
96
|
meta?: Record<string, unknown>;
|
|
67
97
|
/**
|
|
68
98
|
* When true, a microphone button is rendered alongside this field so the
|
|
@@ -72,22 +102,22 @@ interface BaseFieldDef {
|
|
|
72
102
|
voice?: boolean;
|
|
73
103
|
}
|
|
74
104
|
interface TextFieldDef extends BaseFieldDef {
|
|
75
|
-
type:
|
|
105
|
+
type: "text" | "textarea";
|
|
76
106
|
/** For textarea: height in pixels. If omitted, uses default min height (80px). */
|
|
77
107
|
height?: number;
|
|
78
108
|
}
|
|
79
109
|
/** Rich text (HTML) field with TipTap toolbar. Value is stored as HTML string. */
|
|
80
110
|
interface RichTextFieldDef extends BaseFieldDef {
|
|
81
|
-
type:
|
|
111
|
+
type: "richtext";
|
|
82
112
|
/** Minimum height of the editor body in pixels. Default: 160. */
|
|
83
113
|
minHeight?: number;
|
|
84
114
|
}
|
|
85
115
|
interface NumberFieldDef extends BaseFieldDef {
|
|
86
|
-
type:
|
|
116
|
+
type: "number";
|
|
87
117
|
}
|
|
88
118
|
/** Single-thumb numeric slider (e.g. VAS 0–10). Value is a number. */
|
|
89
119
|
interface SliderFieldDef extends BaseFieldDef {
|
|
90
|
-
type:
|
|
120
|
+
type: "slider";
|
|
91
121
|
/** Inclusive minimum. Default 0. */
|
|
92
122
|
min?: number;
|
|
93
123
|
/** Inclusive maximum. Default 10. */
|
|
@@ -102,44 +132,46 @@ interface SelectOption {
|
|
|
102
132
|
score?: number;
|
|
103
133
|
}
|
|
104
134
|
interface SelectFieldDef extends BaseFieldDef {
|
|
105
|
-
type:
|
|
135
|
+
type: "select" | "multiselect";
|
|
106
136
|
options?: SelectOption[];
|
|
107
137
|
}
|
|
108
138
|
interface RadioFieldDef extends BaseFieldDef {
|
|
109
|
-
type:
|
|
139
|
+
type: "radio";
|
|
110
140
|
options?: SelectOption[];
|
|
111
141
|
}
|
|
112
142
|
interface CheckboxFieldDef extends BaseFieldDef {
|
|
113
|
-
type:
|
|
143
|
+
type: "checkbox";
|
|
114
144
|
/** Options for the checkbox group; value is stored as array of selected option values. */
|
|
115
145
|
options?: SelectOption[];
|
|
116
146
|
}
|
|
117
147
|
interface RepeatableFieldDef extends BaseFieldDef {
|
|
118
|
-
type:
|
|
148
|
+
type: "repeatable";
|
|
119
149
|
row: FieldDef[];
|
|
120
150
|
}
|
|
121
151
|
interface ImageUploadFieldDef extends BaseFieldDef {
|
|
122
|
-
type:
|
|
152
|
+
type: "image_upload";
|
|
123
153
|
maxSize?: number;
|
|
124
154
|
acceptedTypes?: string[];
|
|
125
155
|
}
|
|
126
156
|
interface MediaUploadFieldDef extends BaseFieldDef {
|
|
127
|
-
type:
|
|
157
|
+
type: "media_upload";
|
|
128
158
|
maxSize?: number;
|
|
129
159
|
/** Default: images (image/*) and application/pdf */
|
|
130
160
|
acceptedTypes?: string[];
|
|
131
161
|
}
|
|
132
162
|
interface FileUploadFieldDef extends BaseFieldDef {
|
|
133
|
-
type:
|
|
163
|
+
type: "file_upload";
|
|
134
164
|
/** HTML accept string, e.g. "application/pdf,image/*" */
|
|
135
165
|
accept?: string;
|
|
136
166
|
multiple?: boolean;
|
|
137
167
|
maxSize?: number;
|
|
138
168
|
uploadPlaceholder?: string;
|
|
139
169
|
uploadFormats?: string;
|
|
170
|
+
/** When true, uploaded files render as a stacked list with removable rows. */
|
|
171
|
+
list?: boolean;
|
|
140
172
|
}
|
|
141
173
|
interface SignatureFieldDef extends BaseFieldDef {
|
|
142
|
-
type:
|
|
174
|
+
type: "signature";
|
|
143
175
|
canvasWidth?: number;
|
|
144
176
|
canvasHeight?: number;
|
|
145
177
|
strokeColor?: string;
|
|
@@ -153,7 +185,7 @@ interface EditableTableColumnDef {
|
|
|
153
185
|
allowDelete?: boolean;
|
|
154
186
|
}
|
|
155
187
|
interface EditableTableFieldDef extends BaseFieldDef {
|
|
156
|
-
type:
|
|
188
|
+
type: "editable_table";
|
|
157
189
|
/** Initial columns. Per-column allowDelete controls whether that column can be removed. */
|
|
158
190
|
columns?: EditableTableColumnDef[];
|
|
159
191
|
allowAddRow?: boolean;
|
|
@@ -167,26 +199,26 @@ interface EditableTableFieldDef extends BaseFieldDef {
|
|
|
167
199
|
/** Placeholder/hint for the new column name input. Default: "New Column Name". */
|
|
168
200
|
newColumnNameHint?: string;
|
|
169
201
|
/** How to capture new column name: "text" (input) or "datetime" (picker). Default: "text". */
|
|
170
|
-
newColumnNameInputType?:
|
|
202
|
+
newColumnNameInputType?: "text" | "datetime";
|
|
171
203
|
/** Minimum rows to keep; delete button is hidden when rows.length <= minRows. Default: 0. */
|
|
172
204
|
minRows?: number;
|
|
173
205
|
}
|
|
174
206
|
interface StaticTextFieldDef extends BaseFieldDef {
|
|
175
|
-
type:
|
|
207
|
+
type: "static_text";
|
|
176
208
|
/** Display size. Default: 'regular'. */
|
|
177
|
-
size?:
|
|
209
|
+
size?: "regular" | "large";
|
|
178
210
|
}
|
|
179
211
|
interface MedicationsFieldDef extends BaseFieldDef {
|
|
180
|
-
type:
|
|
212
|
+
type: "medications";
|
|
181
213
|
}
|
|
182
214
|
interface InvestigationsFieldDef extends BaseFieldDef {
|
|
183
|
-
type:
|
|
215
|
+
type: "investigations";
|
|
184
216
|
}
|
|
185
217
|
interface ProceduresFieldDef extends BaseFieldDef {
|
|
186
|
-
type:
|
|
218
|
+
type: "procedures";
|
|
187
219
|
}
|
|
188
220
|
interface DifferentialDiagnosisFieldDef extends BaseFieldDef {
|
|
189
|
-
type:
|
|
221
|
+
type: "differential_diagnosis";
|
|
190
222
|
}
|
|
191
223
|
/**
|
|
192
224
|
* A read-only vitals panel populated by an external API fetch.
|
|
@@ -194,7 +226,7 @@ interface DifferentialDiagnosisFieldDef extends BaseFieldDef {
|
|
|
194
226
|
* The fetched value (raw vitals object) is stored in form state and included in submission.
|
|
195
227
|
*/
|
|
196
228
|
interface VitalsFieldDef extends BaseFieldDef {
|
|
197
|
-
type:
|
|
229
|
+
type: "vitals";
|
|
198
230
|
}
|
|
199
231
|
/** One selected referral. Stored in form state as an array of these. */
|
|
200
232
|
interface ReferralItem {
|
|
@@ -207,22 +239,22 @@ interface ReferralItem {
|
|
|
207
239
|
* Options via fieldHandlers[fieldId].onFetchOptions (e.g. { specializations: string[] }).
|
|
208
240
|
*/
|
|
209
241
|
interface ReferralFieldDef extends BaseFieldDef {
|
|
210
|
-
type:
|
|
242
|
+
type: "referral";
|
|
211
243
|
options?: SelectOption[];
|
|
212
244
|
}
|
|
213
245
|
/** Stored value for followup field: false/null = no followup; object = one-time followup as number of days from current date. */
|
|
214
246
|
interface FollowupValue {
|
|
215
|
-
followupType:
|
|
247
|
+
followupType: "one time";
|
|
216
248
|
/** Number of days from (current) date when set; always stored as string. */
|
|
217
249
|
value: string;
|
|
218
|
-
unit:
|
|
250
|
+
unit: "days";
|
|
219
251
|
}
|
|
220
252
|
/**
|
|
221
253
|
* Follow-up field: "No Follow-up" | "One Time" with schedule by duration (e.g. 7 days) or by date.
|
|
222
254
|
* Value shape: false | FollowupValue.
|
|
223
255
|
*/
|
|
224
256
|
interface FollowupFieldDef extends BaseFieldDef {
|
|
225
|
-
type:
|
|
257
|
+
type: "followup";
|
|
226
258
|
}
|
|
227
259
|
/** A matched master record returned from a backend search API. */
|
|
228
260
|
interface MatchedCondition {
|
|
@@ -262,7 +294,7 @@ interface DiagnosisTextareaValue {
|
|
|
262
294
|
* Value shape: `SmartTextareaValue` — `{ text, extractedKeywords }`.
|
|
263
295
|
*/
|
|
264
296
|
interface SmartTextareaFieldDef extends BaseFieldDef {
|
|
265
|
-
type:
|
|
297
|
+
type: "smart_textarea";
|
|
266
298
|
height?: number;
|
|
267
299
|
/** Semantic label for the kind of content (e.g. 'allergies', 'chiefComplaints', 'symptoms'). */
|
|
268
300
|
componentType: string;
|
|
@@ -276,7 +308,7 @@ interface SmartTextareaFieldDef extends BaseFieldDef {
|
|
|
276
308
|
* Value shape in form state can be plain text (legacy) or `DiagnosisTextareaValue`.
|
|
277
309
|
*/
|
|
278
310
|
interface DiagnosisTextareaFieldDef extends BaseFieldDef {
|
|
279
|
-
type:
|
|
311
|
+
type: "diagnosis_textarea";
|
|
280
312
|
/** Height in pixels. If omitted, uses default min height (80px). */
|
|
281
313
|
height?: number;
|
|
282
314
|
/** Debounce delay in ms before API call triggers. Default: 700. */
|
|
@@ -294,7 +326,7 @@ interface DiagnosisTextareaFieldDef extends BaseFieldDef {
|
|
|
294
326
|
* - `complaint_chips` is an alias type string for the same widget (e.g. chief complaints).
|
|
295
327
|
*/
|
|
296
328
|
interface SuggestionTextareaFieldDef extends BaseFieldDef {
|
|
297
|
-
type:
|
|
329
|
+
type: "suggestion_textarea" | "complaint_chips";
|
|
298
330
|
options?: SelectOption[];
|
|
299
331
|
/** Height in pixels for the textarea. */
|
|
300
332
|
height?: number;
|
|
@@ -342,13 +374,13 @@ interface LensAssessmentValue {
|
|
|
342
374
|
* optional clinical notes. Shown via schema rules (e.g. chief-complaint `contains`).
|
|
343
375
|
*/
|
|
344
376
|
interface LensAssessmentFieldDef extends BaseFieldDef {
|
|
345
|
-
type:
|
|
377
|
+
type: "lens_assessment";
|
|
346
378
|
meta?: {
|
|
347
379
|
cardTitle?: string;
|
|
348
380
|
} & Record<string, unknown>;
|
|
349
381
|
}
|
|
350
382
|
/** Keys for the five-item functional impairment scale (0–3 each). */
|
|
351
|
-
type FunctionalImpairmentDimension =
|
|
383
|
+
type FunctionalImpairmentDimension = "reading" | "nightDriving" | "glare" | "occupation" | "adl";
|
|
352
384
|
/** Stored value for `functional_impairment_score` fields (sum 0–15). */
|
|
353
385
|
interface FunctionalImpairmentScoreValue {
|
|
354
386
|
reading: number;
|
|
@@ -361,13 +393,13 @@ interface FunctionalImpairmentScoreValue {
|
|
|
361
393
|
* Cataract-related functional impairment: five 0–3 items and total /15.
|
|
362
394
|
*/
|
|
363
395
|
interface FunctionalImpairmentScoreFieldDef extends BaseFieldDef {
|
|
364
|
-
type:
|
|
396
|
+
type: "functional_impairment_score";
|
|
365
397
|
meta?: {
|
|
366
398
|
cardTitle?: string;
|
|
367
399
|
} & Record<string, unknown>;
|
|
368
400
|
}
|
|
369
401
|
/** Biometry acquisition method (IOL workup). */
|
|
370
|
-
type BiometryMethod =
|
|
402
|
+
type BiometryMethod = "optical_biometry" | "ascan_immersion" | "ascan_contact";
|
|
371
403
|
/** Value for `biometry_iol_workup` — bilateral inputs, shared formula/method, optional workup flags. */
|
|
372
404
|
interface BiometryIolWorkupValue {
|
|
373
405
|
axialLengthOD: string;
|
|
@@ -388,7 +420,7 @@ interface BiometryIolWorkupValue {
|
|
|
388
420
|
}
|
|
389
421
|
/** Table + IOL formula workup (Stage 7). */
|
|
390
422
|
interface BiometryIolWorkupFieldDef extends BaseFieldDef {
|
|
391
|
-
type:
|
|
423
|
+
type: "biometry_iol_workup";
|
|
392
424
|
meta?: {
|
|
393
425
|
cardTitle?: string;
|
|
394
426
|
} & Record<string, unknown>;
|
|
@@ -400,49 +432,49 @@ interface SurgicalRiskFlagsValue {
|
|
|
400
432
|
}
|
|
401
433
|
/** Bilateral cataract surgical risk flags with derived Low/Moderate/High badge per eye (Stage 11). */
|
|
402
434
|
interface SurgicalRiskFlagsFieldDef extends BaseFieldDef {
|
|
403
|
-
type:
|
|
435
|
+
type: "surgical_risk_flags";
|
|
404
436
|
meta?: {
|
|
405
437
|
cardTitle?: string;
|
|
406
438
|
} & Record<string, unknown>;
|
|
407
439
|
}
|
|
408
440
|
/** Urology OPD: dynamic smart history (SOCRATES, IPSS, haematuria, sexual). */
|
|
409
441
|
interface UrologySmartHistoryFieldDef extends BaseFieldDef {
|
|
410
|
-
type:
|
|
442
|
+
type: "urology_smart_history";
|
|
411
443
|
}
|
|
412
444
|
/** Urology OPD: structured examination (general, abdomen, GU, DRE). */
|
|
413
445
|
interface UrologyExaminationFieldDef extends BaseFieldDef {
|
|
414
|
-
type:
|
|
446
|
+
type: "urology_examination";
|
|
415
447
|
}
|
|
416
448
|
/** Urology OPD: objective pathway metrics and risk toggles (maps to `uro_pathway`). */
|
|
417
449
|
interface UrologyPathwayFieldDef extends BaseFieldDef {
|
|
418
|
-
type:
|
|
450
|
+
type: "urology_pathway";
|
|
419
451
|
meta?: {
|
|
420
452
|
subtitle?: string;
|
|
421
453
|
} & Record<string, unknown>;
|
|
422
454
|
}
|
|
423
455
|
/** OB/GYN OPD: structured examination (general/abdomen/breast/pelvic + uterus size). */
|
|
424
456
|
interface OBGExaminationFieldDef extends BaseFieldDef {
|
|
425
|
-
type:
|
|
457
|
+
type: "obg_examination";
|
|
426
458
|
}
|
|
427
459
|
/** OB/GYN OPD: consultant zoning + 5 pathway panels (menstrual / antenatal / gynae / infertility / postop). Antenatal panels render inside the Obstetric History widget. */
|
|
428
460
|
interface OBGPathwayFieldDef extends BaseFieldDef {
|
|
429
|
-
type:
|
|
461
|
+
type: "obg_pathway";
|
|
430
462
|
}
|
|
431
463
|
/** General surgery OPD: structured smart history (SOCRATES, swelling, GI, breast, anorectal, thyroid); HOPC is template field `symptoms` embedded in the widget. */
|
|
432
464
|
interface GeneralSurgerySmartHistoryFieldDef extends BaseFieldDef {
|
|
433
|
-
type:
|
|
465
|
+
type: "general_surgery_smart_history";
|
|
434
466
|
}
|
|
435
467
|
/** General surgery OPD: general signs, regional selection, structured abdomen + regional exam cards + notes. */
|
|
436
468
|
interface GeneralSurgeryExaminationFieldDef extends BaseFieldDef {
|
|
437
|
-
type:
|
|
469
|
+
type: "general_surgery_examination";
|
|
438
470
|
}
|
|
439
471
|
/** General surgery OPD: condition-wise grading (Clearsight triggers; no surgery column). */
|
|
440
472
|
interface GeneralSurgeryGradingFieldDef extends BaseFieldDef {
|
|
441
|
-
type:
|
|
473
|
+
type: "general_surgery_grading";
|
|
442
474
|
}
|
|
443
475
|
/** Pain scale (slider) + checkbox flags in one highlight-label shell; reusable across specialties. */
|
|
444
476
|
interface PainScaleFlagsFieldDef extends BaseFieldDef {
|
|
445
|
-
type:
|
|
477
|
+
type: "pain_scale_flags";
|
|
446
478
|
min?: number;
|
|
447
479
|
max?: number;
|
|
448
480
|
step?: number;
|
|
@@ -467,13 +499,13 @@ interface MedicationFrequentItem {
|
|
|
467
499
|
duration?: string;
|
|
468
500
|
/** Optional structured duration components (preferred over duration when present). */
|
|
469
501
|
duration_value?: string;
|
|
470
|
-
duration_unit?:
|
|
502
|
+
duration_unit?: "days" | "weeks" | "months" | string;
|
|
471
503
|
/** Optional schedule slots; when omitted, Forminator falls back to "0". */
|
|
472
504
|
morning?: string;
|
|
473
505
|
afternoon?: string;
|
|
474
506
|
night?: string;
|
|
475
507
|
/** Optional food-timing hint; when omitted, Forminator defaults to "AFTER FOOD". */
|
|
476
|
-
before_after?:
|
|
508
|
+
before_after?: "AFTER FOOD" | "BEFORE FOOD" | string;
|
|
477
509
|
/** Optional notes; when omitted, Forminator may derive a note from route. */
|
|
478
510
|
notes?: string;
|
|
479
511
|
usage_count?: number;
|
|
@@ -511,7 +543,7 @@ interface DiagnosticPackage {
|
|
|
511
543
|
tests: DiagnosticPackageTest[];
|
|
512
544
|
}
|
|
513
545
|
interface PhoneInputFieldDef extends BaseFieldDef {
|
|
514
|
-
type:
|
|
546
|
+
type: "phone_input";
|
|
515
547
|
meta?: {
|
|
516
548
|
/** ID of the sibling otp_input field to clear when the phone is edited after a send. */
|
|
517
549
|
otpFieldId?: string;
|
|
@@ -520,7 +552,7 @@ interface PhoneInputFieldDef extends BaseFieldDef {
|
|
|
520
552
|
};
|
|
521
553
|
}
|
|
522
554
|
interface OtpInputFieldDef extends BaseFieldDef {
|
|
523
|
-
type:
|
|
555
|
+
type: "otp_input";
|
|
524
556
|
meta?: {
|
|
525
557
|
/** ID of the sibling phone_input field to read the number from. Defaults to "phone". */
|
|
526
558
|
phoneFieldId?: string;
|
|
@@ -539,15 +571,15 @@ interface OtpVerifiedValue {
|
|
|
539
571
|
type FieldDef = TextFieldDef | RichTextFieldDef | NumberFieldDef | SliderFieldDef | SelectFieldDef | RadioFieldDef | CheckboxFieldDef | RepeatableFieldDef | ImageUploadFieldDef | MediaUploadFieldDef | FileUploadFieldDef | SignatureFieldDef | EditableTableFieldDef | StaticTextFieldDef | MedicationsFieldDef | InvestigationsFieldDef | ProceduresFieldDef | DifferentialDiagnosisFieldDef | VitalsFieldDef | ReferralFieldDef | FollowupFieldDef | SmartTextareaFieldDef | DiagnosisTextareaFieldDef | SuggestionTextareaFieldDef | LensAssessmentFieldDef | FunctionalImpairmentScoreFieldDef | ToggleFieldDef | BiometryIolWorkupFieldDef | SurgicalRiskFlagsFieldDef | GeneralSurgerySmartHistoryFieldDef | GeneralSurgeryExaminationFieldDef | GeneralSurgeryGradingFieldDef | UrologySmartHistoryFieldDef | UrologyExaminationFieldDef | UrologyPathwayFieldDef | OBGExaminationFieldDef | OBGPathwayFieldDef | PainScaleFlagsFieldDef | PhoneInputFieldDef | OtpInputFieldDef | BaseFieldDef;
|
|
540
572
|
/** Boolean switch; value is `true` | `false`. */
|
|
541
573
|
interface ToggleFieldDef extends BaseFieldDef {
|
|
542
|
-
type:
|
|
574
|
+
type: "toggle";
|
|
543
575
|
}
|
|
544
576
|
interface ToggleFieldDef extends BaseFieldDef {
|
|
545
|
-
type:
|
|
577
|
+
type: "toggle";
|
|
546
578
|
excludes?: string[];
|
|
547
579
|
}
|
|
548
580
|
interface Condition {
|
|
549
581
|
field?: string;
|
|
550
|
-
op:
|
|
582
|
+
op: "==" | "!=" | ">" | "<" | ">=" | "<=" | "in" | "contains";
|
|
551
583
|
/**
|
|
552
584
|
* For `op: "contains"`:
|
|
553
585
|
* - If the field value is an **array**, checks `value.includes(condition.value)` (e.g. multiselect).
|
|
@@ -557,7 +589,7 @@ interface Condition {
|
|
|
557
589
|
value: any;
|
|
558
590
|
}
|
|
559
591
|
interface RuleAction {
|
|
560
|
-
action:
|
|
592
|
+
action: "hide" | "show" | "disable" | "enable" | "setRequired";
|
|
561
593
|
target: string;
|
|
562
594
|
}
|
|
563
595
|
interface Rule {
|
|
@@ -575,7 +607,7 @@ interface Workflow {
|
|
|
575
607
|
transitions: WorkflowTransition[];
|
|
576
608
|
}
|
|
577
609
|
interface ColumnLayout {
|
|
578
|
-
type:
|
|
610
|
+
type: "column_layout";
|
|
579
611
|
id: string;
|
|
580
612
|
/** Number of columns. Children take equal width. */
|
|
581
613
|
columns: number;
|
|
@@ -586,19 +618,19 @@ interface ColumnLayout {
|
|
|
586
618
|
/** Section child: either a field ID or a nested column_layout. */
|
|
587
619
|
type SectionChild = string | ColumnLayout;
|
|
588
620
|
interface Section {
|
|
589
|
-
type:
|
|
621
|
+
type: "section";
|
|
590
622
|
id: string;
|
|
591
623
|
title: string;
|
|
592
624
|
children: SectionChild[];
|
|
593
625
|
}
|
|
594
626
|
interface MultiStepNode {
|
|
595
|
-
type:
|
|
627
|
+
type: "section";
|
|
596
628
|
id: string;
|
|
597
629
|
title: string;
|
|
598
630
|
children: SectionChild[];
|
|
599
631
|
}
|
|
600
632
|
interface MultiStepLayoutNode {
|
|
601
|
-
type:
|
|
633
|
+
type: "multi_step";
|
|
602
634
|
id: string;
|
|
603
635
|
title?: string;
|
|
604
636
|
steps: MultiStepNode[];
|
|
@@ -606,14 +638,14 @@ interface MultiStepLayoutNode {
|
|
|
606
638
|
/** Show step indicator header. Default true. */
|
|
607
639
|
showStepper?: boolean;
|
|
608
640
|
/** Visual style for the stepper. Default 'numbered'. */
|
|
609
|
-
stepperVariant?:
|
|
641
|
+
stepperVariant?: "numbered" | "dots" | "labels";
|
|
610
642
|
/** Collapse completed steps into an accordion. Default true. */
|
|
611
643
|
collapseCompleted?: boolean;
|
|
612
644
|
};
|
|
613
645
|
}
|
|
614
646
|
type LayoutNode = Section | ColumnLayout | MultiStepLayoutNode;
|
|
615
647
|
interface WebhookDef {
|
|
616
|
-
method:
|
|
648
|
+
method: "GET" | "POST" | "PUT";
|
|
617
649
|
url: string;
|
|
618
650
|
}
|
|
619
651
|
interface ScoreRange {
|
|
@@ -623,31 +655,31 @@ interface ScoreRange {
|
|
|
623
655
|
}
|
|
624
656
|
interface ScoreComputation {
|
|
625
657
|
target: string;
|
|
626
|
-
type:
|
|
658
|
+
type: "score";
|
|
627
659
|
source: string;
|
|
628
660
|
ranges: ScoreRange[];
|
|
629
661
|
}
|
|
630
662
|
interface SumComputation {
|
|
631
663
|
target: string;
|
|
632
|
-
type:
|
|
664
|
+
type: "sum";
|
|
633
665
|
fields: string[];
|
|
634
666
|
}
|
|
635
667
|
/** Expression node for formula computation: field ref, number, or binary op. */
|
|
636
668
|
type FormulaExpr = {
|
|
637
|
-
type:
|
|
669
|
+
type: "field";
|
|
638
670
|
field: string;
|
|
639
671
|
} | {
|
|
640
|
-
type:
|
|
672
|
+
type: "number";
|
|
641
673
|
value: number;
|
|
642
674
|
} | {
|
|
643
|
-
type:
|
|
644
|
-
op:
|
|
675
|
+
type: "op";
|
|
676
|
+
op: "+" | "-" | "*" | "/" | "**";
|
|
645
677
|
left: FormulaExpr;
|
|
646
678
|
right: FormulaExpr;
|
|
647
679
|
};
|
|
648
680
|
interface FormulaComputation {
|
|
649
681
|
target: string;
|
|
650
|
-
type:
|
|
682
|
+
type: "formula";
|
|
651
683
|
expression: FormulaExpr;
|
|
652
684
|
}
|
|
653
685
|
type Computation = SumComputation | ScoreComputation | FormulaComputation;
|
|
@@ -1019,6 +1051,16 @@ interface SmartFormProps {
|
|
|
1019
1051
|
*/
|
|
1020
1052
|
declare const SmartForm: React.FC<SmartFormProps>;
|
|
1021
1053
|
|
|
1054
|
+
declare function isLabelVisible(fieldDef: Pick<BaseFieldDef, "style">): boolean;
|
|
1055
|
+
declare function FieldRequiredIndicator({ fieldDef, }: {
|
|
1056
|
+
fieldDef: Pick<BaseFieldDef, "required" | "style">;
|
|
1057
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
1058
|
+
declare function fieldWrapperClass(fieldDef: Pick<BaseFieldDef, "style">, ...defaults: (string | undefined)[]): string;
|
|
1059
|
+
declare function fieldLabelClass(fieldDef: Pick<BaseFieldDef, "style">, ...defaults: (string | undefined)[]): string;
|
|
1060
|
+
declare function fieldControlClass(fieldDef: Pick<BaseFieldDef, "style">, ...defaults: (string | undefined)[]): string;
|
|
1061
|
+
declare function fieldDescriptionClass(fieldDef: Pick<BaseFieldDef, "style">, ...defaults: (string | undefined)[]): string;
|
|
1062
|
+
declare function fieldErrorClass(fieldDef: Pick<BaseFieldDef, "style">, ...defaults: (string | undefined)[]): string;
|
|
1063
|
+
|
|
1022
1064
|
interface FieldRendererProps {
|
|
1023
1065
|
fieldId: string;
|
|
1024
1066
|
}
|
|
@@ -1097,8 +1139,12 @@ interface UploadProps {
|
|
|
1097
1139
|
placeholder?: string;
|
|
1098
1140
|
beforeUploadContent?: React.ReactNode;
|
|
1099
1141
|
id?: string;
|
|
1142
|
+
/**
|
|
1143
|
+
* When true, do not show "N files selected" in the drop zone; parent can render file rows.
|
|
1144
|
+
*/
|
|
1145
|
+
listLayout?: boolean;
|
|
1100
1146
|
}
|
|
1101
|
-
declare function Upload({ value, accept, multiple, disabled, onChange, className, formatsLabel, placeholder, beforeUploadContent, id: idProp, }: UploadProps): react_jsx_runtime.JSX.Element;
|
|
1147
|
+
declare function Upload({ value, accept, multiple, disabled, onChange, className, formatsLabel, placeholder, beforeUploadContent, id: idProp, listLayout, }: UploadProps): react_jsx_runtime.JSX.Element;
|
|
1102
1148
|
|
|
1103
1149
|
declare const FormFileUploadWidget: React.FC<{
|
|
1104
1150
|
fieldId: string;
|
|
@@ -1309,4 +1355,4 @@ declare const SmartTextareaWidget: React.FC<{
|
|
|
1309
1355
|
fieldId: string;
|
|
1310
1356
|
}>;
|
|
1311
1357
|
|
|
1312
|
-
export { type AIDifferentialDiagnosisItem, AddInvestigationField, type AddInvestigationFieldProps, AddMedicationField, type AddMedicationFieldProps, type BaseFieldDef, type BiometryIolWorkupFieldDef, type BiometryIolWorkupValue, type BiometryMethod, type CheckboxFieldDef, type ColumnLayout, type Computation, type Condition, type CreateUploadHandlerOptions, type DataSource, type DiagnosisGradeSelection, type DiagnosisTextareaFieldDef, type DiagnosisTextareaValue, type DiagnosticPackage, type DiagnosticPackageTest, DifferentialDiagnosis, type DifferentialDiagnosisFieldDef, type DifferentialDiagnosisItem, type DifferentialDiagnosisProps, type DoctorFrequentItems, DynamicForm, DynamicFormV2, type DynamicFormV2Props, type DynamicFormV2SectionMode, EMAIL_REGEX, type EditableTableColumnDef, type EditableTableFieldDef, type EventDefinition, type ExtractedKeywordMatch, type FieldDef, type FieldHandler, type FieldHandlersMap, type FieldPrefill, FieldRenderer, type FieldState, type FieldType, type FileUploadFieldDef, type FollowupFieldDef, type FollowupValue, FormControls, type FormControlsProps, type FormDef, type FormErrors, FormFileUploadWidget, FormProvider, type FormState, FormStore, type FormValues, type FormulaComputation, type FormulaExpr, type FunctionalImpairmentDimension, type FunctionalImpairmentScoreFieldDef, type FunctionalImpairmentScoreValue, type GeneralSurgeryExaminationFieldDef, type GeneralSurgeryGradingFieldDef, type GeneralSurgerySmartHistoryFieldDef, type ImageUploadFieldDef, ImageUploadWidget, type Investigation, type InvestigationFrequentItem, type InvestigationSearchResult, type InvestigationsFieldDef, type LayoutNode, type LensAssessmentFieldDef, type LensAssessmentValue, type LocsGrades, MAR_MEDICATION_ORDERS_META_KEY, type MatchedCondition, type MediaUploadFieldDef, MediaUploadWidget, type Medication, type MedicationFrequentItem, type MedicationSearchResult, type MedicationsFieldDef, MultiStepForm, type MultiStepFormProps, type MultiStepLayoutNode, type MultiStepNode, type NumberFieldDef, type OBGExaminationFieldDef, type OBGPathwayFieldDef, type OtpInputFieldDef, type OtpVerifiedValue, type PainScaleFlagsFieldDef, type Permission, type PhoneInputFieldDef, type PresignedUploadResponse, type ProcedureFrequentItem, type ProceduresFieldDef, type RadioFieldDef, ReadOnlyForm, ReadOnlyImageUpload, ReadOnlyMediaUpload, ReadOnlySignature, ReadOnlyTable, type ReferralFieldDef, type ReferralItem, type RepeatableFieldDef, type RichTextFieldDef, RichTextWidget, type Rule, type RuleAction, type RuleResult, type ScoreComputation, type ScoreRange, type Section, type SectionChild, type SelectFieldDef, type SelectOption, type SignatureFieldDef, SignatureUploadWidget, type SliderFieldDef, SmartForm, type SmartFormProps, type SmartKeywordsResult, type SmartTextareaFieldDef, type SmartTextareaValue, SmartTextareaWidget, type StaticTextFieldDef, type StoreAuthConfig, type StoreConfig, type SubmissionData, type SuggestionTextareaFieldDef, type SumComputation, type SurgicalRiskFlagsFieldDef, type SurgicalRiskFlagsValue, type TextFieldDef, type ToggleFieldDef, Upload, type UploadProps, type UrologyExaminationFieldDef, type UrologyPathwayFieldDef, type UrologySmartHistoryFieldDef, type ValidationRule, type VitalsFieldDef, type WebhookDef, type Workflow, type WorkflowTransition, createUploadHandler, evaluateRules, fieldMetaRequestsMarMedicationOrdersButton, useField, useFieldHandlers, useForm, useFormStore, useFrequentItems, usePackages, useSmartKeywords, validateField, validateForm };
|
|
1358
|
+
export { type AIDifferentialDiagnosisItem, AddInvestigationField, type AddInvestigationFieldProps, AddMedicationField, type AddMedicationFieldProps, type BaseFieldDef, type BiometryIolWorkupFieldDef, type BiometryIolWorkupValue, type BiometryMethod, type CheckboxFieldDef, type ColumnLayout, type Computation, type Condition, type CreateUploadHandlerOptions, type DataSource, type DiagnosisGradeSelection, type DiagnosisTextareaFieldDef, type DiagnosisTextareaValue, type DiagnosticPackage, type DiagnosticPackageTest, DifferentialDiagnosis, type DifferentialDiagnosisFieldDef, type DifferentialDiagnosisItem, type DifferentialDiagnosisProps, type DoctorFrequentItems, DynamicForm, DynamicFormV2, type DynamicFormV2Props, type DynamicFormV2SectionMode, EMAIL_REGEX, type EditableTableColumnDef, type EditableTableFieldDef, type EventDefinition, type ExtractedKeywordMatch, type FieldDef, type FieldHandler, type FieldHandlersMap, type FieldPrefill, FieldRenderer, FieldRequiredIndicator, type FieldState, type FieldStyleClassNames, type FieldStyleConfig, type FieldType, type FileUploadFieldDef, type FollowupFieldDef, type FollowupValue, FormControls, type FormControlsProps, type FormDef, type FormErrors, FormFileUploadWidget, FormProvider, type FormState, FormStore, type FormValues, type FormulaComputation, type FormulaExpr, type FunctionalImpairmentDimension, type FunctionalImpairmentScoreFieldDef, type FunctionalImpairmentScoreValue, type GeneralSurgeryExaminationFieldDef, type GeneralSurgeryGradingFieldDef, type GeneralSurgerySmartHistoryFieldDef, type ImageUploadFieldDef, ImageUploadWidget, type Investigation, type InvestigationFrequentItem, type InvestigationSearchResult, type InvestigationsFieldDef, type LayoutNode, type LensAssessmentFieldDef, type LensAssessmentValue, type LocsGrades, MAR_MEDICATION_ORDERS_META_KEY, type MatchedCondition, type MediaUploadFieldDef, MediaUploadWidget, type Medication, type MedicationFrequentItem, type MedicationSearchResult, type MedicationsFieldDef, MultiStepForm, type MultiStepFormProps, type MultiStepLayoutNode, type MultiStepNode, type NumberFieldDef, type OBGExaminationFieldDef, type OBGPathwayFieldDef, type OtpInputFieldDef, type OtpVerifiedValue, type PainScaleFlagsFieldDef, type Permission, type PhoneInputFieldDef, type PresignedUploadResponse, type ProcedureFrequentItem, type ProceduresFieldDef, type RadioFieldDef, ReadOnlyForm, ReadOnlyImageUpload, ReadOnlyMediaUpload, ReadOnlySignature, ReadOnlyTable, type ReferralFieldDef, type ReferralItem, type RepeatableFieldDef, type RichTextFieldDef, RichTextWidget, type Rule, type RuleAction, type RuleResult, type ScoreComputation, type ScoreRange, type Section, type SectionChild, type SelectFieldDef, type SelectOption, type SignatureFieldDef, SignatureUploadWidget, type SliderFieldDef, SmartForm, type SmartFormProps, type SmartKeywordsResult, type SmartTextareaFieldDef, type SmartTextareaValue, SmartTextareaWidget, type StaticTextFieldDef, type StoreAuthConfig, type StoreConfig, type SubmissionData, type SuggestionTextareaFieldDef, type SumComputation, type SurgicalRiskFlagsFieldDef, type SurgicalRiskFlagsValue, type TextFieldDef, type ToggleFieldDef, Upload, type UploadProps, type UrologyExaminationFieldDef, type UrologyPathwayFieldDef, type UrologySmartHistoryFieldDef, type ValidationRule, type VitalsFieldDef, type WebhookDef, type Workflow, type WorkflowTransition, createUploadHandler, evaluateRules, fieldControlClass, fieldDescriptionClass, fieldErrorClass, fieldLabelClass, fieldMetaRequestsMarMedicationOrdersButton, fieldWrapperClass, isLabelVisible, useField, useFieldHandlers, useForm, useFormStore, useFrequentItems, usePackages, useSmartKeywords, validateField, validateForm };
|