@formbox/htmx 0.4.4 → 0.6.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.d.ts +720 -52
- package/dist/index.js +140 -59
- package/dist/templates/AnswerList.html.hbs +3 -0
- package/dist/templates/AnswerScaffold.html.hbs +3 -0
- package/dist/templates/Checkbox.html.hbs +3 -0
- package/dist/templates/CheckboxList.html.hbs +3 -0
- package/dist/templates/CustomOptionForm.html.hbs +3 -0
- package/dist/templates/DateInput.html.hbs +3 -0
- package/dist/templates/DateTimeInput.html.hbs +3 -0
- package/dist/templates/DisplayRenderer.html.hbs +3 -0
- package/dist/templates/Errors.html.hbs +3 -0
- package/dist/templates/FileInput.html.hbs +3 -0
- package/dist/templates/Flyover.html.hbs +3 -0
- package/dist/templates/Footer.html.hbs +3 -0
- package/dist/templates/Form.html.hbs +22 -4
- package/dist/templates/FormDescription.html.hbs +10 -0
- package/dist/templates/FormTitle.html.hbs +10 -0
- package/dist/templates/GroupList.html.hbs +3 -0
- package/dist/templates/GroupScaffold.html.hbs +3 -0
- package/dist/templates/Header.html.hbs +3 -0
- package/dist/templates/Help.html.hbs +3 -0
- package/dist/templates/InputGroup.html.hbs +3 -0
- package/dist/templates/Label.html.hbs +3 -0
- package/dist/templates/LabelContent.html.hbs +15 -0
- package/dist/templates/LanguageSelector.html.hbs +3 -0
- package/dist/templates/Legal.html.hbs +3 -0
- package/dist/templates/Link.html.hbs +3 -0
- package/dist/templates/Media.html.hbs +29 -0
- package/dist/templates/MultiSelectInput.html.hbs +3 -0
- package/dist/templates/NumberInput.html.hbs +3 -0
- package/dist/templates/OptionDisplay.html.hbs +3 -0
- package/dist/templates/OptionsLoading.html.hbs +3 -0
- package/dist/templates/Pagination.html.hbs +24 -0
- package/dist/templates/QuestionScaffold.html.hbs +3 -0
- package/dist/templates/RadioButton.html.hbs +3 -0
- package/dist/templates/RadioButtonList.html.hbs +3 -0
- package/dist/templates/SelectInput.html.hbs +3 -0
- package/dist/templates/ShortTextStyle.html.hbs +10 -0
- package/dist/templates/SignatureInput.html.hbs +3 -0
- package/dist/templates/SliderInput.html.hbs +3 -0
- package/dist/templates/SpinnerInput.html.hbs +3 -0
- package/dist/templates/Stack.html.hbs +3 -0
- package/dist/templates/SubmitButton.html.hbs +13 -0
- package/dist/templates/TabContainer.html.hbs +3 -0
- package/dist/templates/Table.html.hbs +3 -0
- package/dist/templates/TextArea.html.hbs +3 -0
- package/dist/templates/TextInput.html.hbs +3 -0
- package/dist/templates/TimeInput.html.hbs +3 -0
- package/package.json +10 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,56 +1,8 @@
|
|
|
1
|
-
import { AnswerListProperties } from '@formbox/theme';
|
|
2
|
-
import { AnswerScaffoldProperties } from '@formbox/theme';
|
|
3
|
-
import { Attachment } from '@formbox/theme';
|
|
4
|
-
import { CheckboxListProperties } from '@formbox/theme';
|
|
5
|
-
import { CheckboxProperties } from '@formbox/theme';
|
|
6
|
-
import { CustomExtensionDefinitions } from '@formbox/theme';
|
|
7
|
-
import { CustomOptionFormProperties } from '@formbox/theme';
|
|
8
|
-
import { DateInputProperties } from '@formbox/theme';
|
|
9
|
-
import { DateTimeInputProperties } from '@formbox/theme';
|
|
10
|
-
import { DisplayRendererProperties } from '@formbox/theme';
|
|
11
|
-
import { ErrorsProperties } from '@formbox/theme';
|
|
12
1
|
import { FhirVersion } from '@formbox/fhir';
|
|
13
|
-
import {
|
|
14
|
-
import { FlyoverProperties } from '@formbox/theme';
|
|
15
|
-
import { FooterProperties } from '@formbox/theme';
|
|
16
|
-
import { FormPagination } from '@formbox/theme';
|
|
17
|
-
import { FormProperties } from '@formbox/theme';
|
|
18
|
-
import { GroupListProperties } from '@formbox/theme';
|
|
19
|
-
import { GroupScaffoldProperties } from '@formbox/theme';
|
|
20
|
-
import { HeaderProperties } from '@formbox/theme';
|
|
21
|
-
import { HelpProperties } from '@formbox/theme';
|
|
22
|
-
import { InputGroupProperties } from '@formbox/theme';
|
|
23
|
-
import { LabelProperties } from '@formbox/theme';
|
|
24
|
-
import { LanguageSelectorProperties } from '@formbox/theme';
|
|
25
|
-
import { LegalProperties } from '@formbox/theme';
|
|
26
|
-
import { LinkProperties } from '@formbox/theme';
|
|
27
|
-
import { MultiSelectInputProperties } from '@formbox/theme';
|
|
28
|
-
import { NodePath } from '@formbox/theme';
|
|
29
|
-
import { NumberInputProperties } from '@formbox/theme';
|
|
30
|
-
import { OptionDisplayProperties } from '@formbox/theme';
|
|
31
|
-
import { OptionItem } from '@formbox/theme';
|
|
32
|
-
import { OptionsLoadingProperties } from '@formbox/theme';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
33
3
|
import { QuestionnaireOf } from '@formbox/fhir';
|
|
34
4
|
import { QuestionnaireResponseOf } from '@formbox/fhir';
|
|
35
|
-
import { QuestionScaffoldProperties } from '@formbox/theme';
|
|
36
|
-
import { RadioButtonListProperties } from '@formbox/theme';
|
|
37
|
-
import { RadioButtonProperties } from '@formbox/theme';
|
|
38
5
|
import { ReactNode } from 'react';
|
|
39
|
-
import { SelectedOptionItem } from '@formbox/theme';
|
|
40
|
-
import { SelectInputProperties } from '@formbox/theme';
|
|
41
|
-
import { SignatureInputProperties } from '@formbox/theme';
|
|
42
|
-
import { SliderInputProperties } from '@formbox/theme';
|
|
43
|
-
import { SpinnerInputProperties } from '@formbox/theme';
|
|
44
|
-
import { StackProperties } from '@formbox/theme';
|
|
45
|
-
import { Strings } from '@formbox/theme';
|
|
46
|
-
import { TabContainerProperties } from '@formbox/theme';
|
|
47
|
-
import { TableCell } from '@formbox/theme';
|
|
48
|
-
import { TableColumn } from '@formbox/theme';
|
|
49
|
-
import { TableProperties } from '@formbox/theme';
|
|
50
|
-
import { TableRow } from '@formbox/theme';
|
|
51
|
-
import { TextAreaProperties } from '@formbox/theme';
|
|
52
|
-
import { TextInputProperties } from '@formbox/theme';
|
|
53
|
-
import { TimeInputProperties } from '@formbox/theme';
|
|
54
6
|
|
|
55
7
|
export declare const ACTION_FIELD = "fb[action]";
|
|
56
8
|
|
|
@@ -70,23 +22,67 @@ export declare type AddActionProperties = {
|
|
|
70
22
|
|
|
71
23
|
export declare type AnswerField = "value" | "system" | "code" | "display" | "unit" | "baseline" | "signature";
|
|
72
24
|
|
|
25
|
+
declare type AnswerListProperties = {
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
onAdd?: (() => void) | undefined;
|
|
28
|
+
canAdd?: boolean | undefined;
|
|
29
|
+
path?: NodePath | undefined;
|
|
30
|
+
};
|
|
31
|
+
|
|
73
32
|
export declare type AnswerListTemplateProperties = Omit<TemplateBase<AnswerListProperties>, "children"> & {
|
|
74
33
|
readonly children: string;
|
|
75
34
|
readonly hasCount: boolean;
|
|
76
35
|
} & AddActionProperties;
|
|
77
36
|
|
|
37
|
+
declare type AnswerScaffoldProperties = {
|
|
38
|
+
control: ReactNode;
|
|
39
|
+
onRemove?: (() => void) | undefined;
|
|
40
|
+
canRemove?: boolean | undefined;
|
|
41
|
+
errors?: ReactNode;
|
|
42
|
+
children?: ReactNode;
|
|
43
|
+
path?: NodePath | undefined;
|
|
44
|
+
};
|
|
45
|
+
|
|
78
46
|
export declare type AnswerScaffoldTemplateProperties = Omit<TemplateBase<AnswerScaffoldProperties>, "children" | "control" | "errors"> & {
|
|
79
47
|
readonly control: string;
|
|
80
48
|
readonly errors?: string | undefined;
|
|
81
49
|
readonly children?: string | undefined;
|
|
82
50
|
} & RemoveActionProperties;
|
|
83
51
|
|
|
52
|
+
declare type Attachment = {
|
|
53
|
+
title?: string | undefined;
|
|
54
|
+
url?: string | undefined;
|
|
55
|
+
size?: number | undefined;
|
|
56
|
+
contentType?: string | undefined;
|
|
57
|
+
data?: string | undefined;
|
|
58
|
+
};
|
|
59
|
+
|
|
84
60
|
export declare function attribute(name: string, value: unknown): string;
|
|
85
61
|
|
|
62
|
+
declare type BivariantExtract<TContext, TValue> = {
|
|
63
|
+
bivarianceHack(context: TContext): TValue;
|
|
64
|
+
}["bivarianceHack"];
|
|
65
|
+
|
|
86
66
|
export declare function calculatedName(path: NodePath): string;
|
|
87
67
|
|
|
88
68
|
export declare function checkboxHiddenValue(properties: CheckboxProperties, checkedValue: string): string | undefined;
|
|
89
69
|
|
|
70
|
+
declare type CheckboxListProperties = {
|
|
71
|
+
options: readonly OptionItem[];
|
|
72
|
+
selectedOptions: readonly SelectedOptionItem[];
|
|
73
|
+
orientation?: ChoiceOrientation | undefined;
|
|
74
|
+
onSelect: (token: string) => void;
|
|
75
|
+
onDeselect: (token: string) => void;
|
|
76
|
+
specifyOtherOption?: OptionItem | undefined;
|
|
77
|
+
customOptionForm?: ReactNode;
|
|
78
|
+
id: string;
|
|
79
|
+
path?: NodePath | undefined;
|
|
80
|
+
ariaLabelledBy: string;
|
|
81
|
+
ariaDescribedBy?: string | undefined;
|
|
82
|
+
disabled?: boolean | undefined;
|
|
83
|
+
isLoading?: boolean | undefined;
|
|
84
|
+
};
|
|
85
|
+
|
|
90
86
|
export declare type CheckboxListTemplateProperties = Omit<FieldTemplateProperties<CheckboxListProperties>, "customOptionForm" | "options" | "selectedOptions" | "specifyOtherOption"> & {
|
|
91
87
|
readonly baselineName?: string | undefined;
|
|
92
88
|
readonly hiddenInputs: readonly HiddenTemplateInput[];
|
|
@@ -105,11 +101,26 @@ export declare type CheckboxOptionTemplateItem = TemplateOptionItem & {
|
|
|
105
101
|
readonly hiddenInput?: HiddenTemplateInput | undefined;
|
|
106
102
|
};
|
|
107
103
|
|
|
104
|
+
declare type CheckboxProperties = {
|
|
105
|
+
id: string;
|
|
106
|
+
path?: NodePath | undefined;
|
|
107
|
+
checkedValue?: string | undefined;
|
|
108
|
+
uncheckedValue?: string | undefined;
|
|
109
|
+
checked: boolean;
|
|
110
|
+
onChange: () => void;
|
|
111
|
+
ariaLabelledBy: string;
|
|
112
|
+
ariaDescribedBy?: string | undefined;
|
|
113
|
+
disabled?: boolean;
|
|
114
|
+
label?: ReactNode;
|
|
115
|
+
};
|
|
116
|
+
|
|
108
117
|
export declare type CheckboxTemplateProperties = Omit<FieldTemplateProperties<CheckboxProperties>, "label"> & {
|
|
109
118
|
readonly hiddenValue?: string | undefined;
|
|
110
119
|
readonly label?: string | undefined;
|
|
111
120
|
};
|
|
112
121
|
|
|
122
|
+
declare type ChoiceOrientation = "horizontal" | "vertical";
|
|
123
|
+
|
|
113
124
|
export declare type CollapsibleActionProperties = {
|
|
114
125
|
readonly actionName?: string | undefined;
|
|
115
126
|
readonly collapseLabel?: string | undefined;
|
|
@@ -125,6 +136,28 @@ export declare function compileTemplates(sources: TemplateSources): Templates;
|
|
|
125
136
|
|
|
126
137
|
export declare function countName(path: NodePath): string;
|
|
127
138
|
|
|
139
|
+
declare type CustomExtensionDefinition<TContext = unknown, TValue = unknown, TRepeats extends boolean = boolean> = {
|
|
140
|
+
readonly target: CustomExtensionTarget;
|
|
141
|
+
readonly url: string;
|
|
142
|
+
readonly repeats: TRepeats;
|
|
143
|
+
readonly extract: BivariantExtract<TContext, TValue>;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
declare type CustomExtensionDefinitions<TContext = unknown> = Readonly<Record<string, CustomExtensionDefinition<TContext, unknown, boolean>>>;
|
|
147
|
+
|
|
148
|
+
declare type CustomExtensionTarget = "questionnaire" | "item";
|
|
149
|
+
|
|
150
|
+
declare type CustomExtensionValues = Readonly<Record<string, unknown>>;
|
|
151
|
+
|
|
152
|
+
declare type CustomOptionFormProperties = {
|
|
153
|
+
id?: string | undefined;
|
|
154
|
+
content: ReactNode;
|
|
155
|
+
errors?: ReactNode | undefined;
|
|
156
|
+
onCancel: () => void;
|
|
157
|
+
onSubmit: () => void;
|
|
158
|
+
canSubmit?: boolean | undefined;
|
|
159
|
+
};
|
|
160
|
+
|
|
128
161
|
export declare type CustomOptionFormTemplateProperties = Omit<TemplateBase<CustomOptionFormProperties>, "content" | "errors"> & {
|
|
129
162
|
readonly actionName: string;
|
|
130
163
|
readonly cancelLabel: string;
|
|
@@ -137,6 +170,19 @@ export declare type CustomOptionFormTemplateProperties = Omit<TemplateBase<Custo
|
|
|
137
170
|
|
|
138
171
|
export declare function customUnitFormName(path: NodePath): string;
|
|
139
172
|
|
|
173
|
+
declare type DateInputProperties = {
|
|
174
|
+
id: string;
|
|
175
|
+
path?: NodePath | undefined;
|
|
176
|
+
value: string;
|
|
177
|
+
onChange: (v: string) => void;
|
|
178
|
+
disabled?: boolean | undefined;
|
|
179
|
+
placeholder?: string | undefined;
|
|
180
|
+
ariaLabelledBy: string;
|
|
181
|
+
ariaDescribedBy?: string | undefined;
|
|
182
|
+
min?: string | undefined;
|
|
183
|
+
max?: string | undefined;
|
|
184
|
+
};
|
|
185
|
+
|
|
140
186
|
export declare type DateInputTemplateProperties = FieldTemplateProperties<DateInputProperties> & {
|
|
141
187
|
readonly inputType: "date" | "text";
|
|
142
188
|
readonly step: undefined;
|
|
@@ -144,6 +190,19 @@ export declare type DateInputTemplateProperties = FieldTemplateProperties<DateIn
|
|
|
144
190
|
|
|
145
191
|
export declare function dateTimeConstraint(value: string | undefined): string | undefined;
|
|
146
192
|
|
|
193
|
+
declare type DateTimeInputProperties = {
|
|
194
|
+
id: string;
|
|
195
|
+
path?: NodePath | undefined;
|
|
196
|
+
value: string;
|
|
197
|
+
onChange: (v: string) => void;
|
|
198
|
+
disabled?: boolean | undefined;
|
|
199
|
+
placeholder?: string | undefined;
|
|
200
|
+
ariaLabelledBy: string;
|
|
201
|
+
ariaDescribedBy?: string | undefined;
|
|
202
|
+
min?: string | undefined;
|
|
203
|
+
max?: string | undefined;
|
|
204
|
+
};
|
|
205
|
+
|
|
147
206
|
export declare type DateTimeInputTemplateProperties = FieldTemplateProperties<DateTimeInputProperties> & {
|
|
148
207
|
readonly baselineName?: string | undefined;
|
|
149
208
|
readonly baselineValue?: string | undefined;
|
|
@@ -156,10 +215,21 @@ export declare type DateTimeInputTemplateProperties = FieldTemplateProperties<Da
|
|
|
156
215
|
|
|
157
216
|
export declare function defaultAttributes(action: string | undefined): HtmlAttributes;
|
|
158
217
|
|
|
218
|
+
declare type DisplayRendererProperties = {
|
|
219
|
+
linkId: string;
|
|
220
|
+
children: ReactNode;
|
|
221
|
+
customExtensions?: CustomExtensionValues | undefined;
|
|
222
|
+
};
|
|
223
|
+
|
|
159
224
|
export declare type DisplayRendererTemplateProperties = Omit<TemplateBase<DisplayRendererProperties>, "children"> & {
|
|
160
225
|
readonly children: string;
|
|
161
226
|
};
|
|
162
227
|
|
|
228
|
+
declare type ErrorsProperties = {
|
|
229
|
+
id: string;
|
|
230
|
+
messages: string[];
|
|
231
|
+
};
|
|
232
|
+
|
|
163
233
|
export declare type ErrorsTemplateProperties = Omit<TemplateBase<ErrorsProperties>, "messages"> & {
|
|
164
234
|
readonly hasMessages: boolean;
|
|
165
235
|
readonly messages: readonly {
|
|
@@ -175,6 +245,17 @@ export declare function fieldAttributes(path: NodePath | undefined, field: Answe
|
|
|
175
245
|
|
|
176
246
|
declare type FieldTemplateProperties<TProperties> = TemplateBase<TProperties> & TemplateFieldAttributes;
|
|
177
247
|
|
|
248
|
+
declare type FileInputProperties = {
|
|
249
|
+
value: Attachment | undefined;
|
|
250
|
+
id: string;
|
|
251
|
+
path?: NodePath | undefined;
|
|
252
|
+
ariaLabelledBy: string;
|
|
253
|
+
ariaDescribedBy?: string | undefined;
|
|
254
|
+
disabled?: boolean | undefined;
|
|
255
|
+
accept?: string | undefined;
|
|
256
|
+
onChange?: ((file?: File) => void) | undefined;
|
|
257
|
+
};
|
|
258
|
+
|
|
178
259
|
export declare type FileInputTemplateProperties = FieldTemplateProperties<FileInputProperties> & {
|
|
179
260
|
readonly clearId?: string | undefined;
|
|
180
261
|
readonly clearLabel: string;
|
|
@@ -184,31 +265,92 @@ export declare type FileInputTemplateProperties = FieldTemplateProperties<FileIn
|
|
|
184
265
|
readonly hxInclude: "closest form";
|
|
185
266
|
};
|
|
186
267
|
|
|
268
|
+
declare type FlyoverProperties = {
|
|
269
|
+
id: string;
|
|
270
|
+
children: ReactNode;
|
|
271
|
+
};
|
|
272
|
+
|
|
187
273
|
export declare type FlyoverTemplateProperties = Omit<TemplateBase<FlyoverProperties>, "children"> & {
|
|
188
274
|
readonly ariaLabel: string;
|
|
189
275
|
readonly buttonId?: string | undefined;
|
|
190
276
|
readonly children: string;
|
|
191
277
|
};
|
|
192
278
|
|
|
279
|
+
declare type FooterProperties = {
|
|
280
|
+
linkId: string;
|
|
281
|
+
children: ReactNode;
|
|
282
|
+
};
|
|
283
|
+
|
|
193
284
|
export declare type FooterTemplateProperties = Omit<TemplateBase<FooterProperties>, "children"> & {
|
|
194
285
|
readonly children: string;
|
|
195
286
|
};
|
|
196
287
|
|
|
288
|
+
export declare type FormDescriptionTemplateProperties = {
|
|
289
|
+
readonly description: string;
|
|
290
|
+
};
|
|
291
|
+
|
|
197
292
|
declare type FormFieldsProperties = Omit<FormTemplateProperties, "attributes" | "fields">;
|
|
198
293
|
|
|
199
294
|
export declare function formFieldsTemplate(properties: FormFieldsProperties): string;
|
|
200
295
|
|
|
296
|
+
declare type FormPagination = {
|
|
297
|
+
current: number;
|
|
298
|
+
total: number;
|
|
299
|
+
onPrev: () => void;
|
|
300
|
+
onNext: () => void;
|
|
301
|
+
disabledPrev: boolean;
|
|
302
|
+
disabledNext: boolean;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
declare type FormProperties = {
|
|
306
|
+
id?: string | undefined;
|
|
307
|
+
onSubmit?: (() => void) | undefined;
|
|
308
|
+
onCancel?: (() => void) | undefined;
|
|
309
|
+
children: ReactNode;
|
|
310
|
+
pagination?: FormPagination | undefined;
|
|
311
|
+
title?: string | undefined;
|
|
312
|
+
description?: string | undefined;
|
|
313
|
+
languageSelector?: ReactNode;
|
|
314
|
+
errors?: ReactNode;
|
|
315
|
+
before?: ReactNode;
|
|
316
|
+
after?: ReactNode;
|
|
317
|
+
signature?: ReactNode;
|
|
318
|
+
customExtensions?: CustomExtensionValues | undefined;
|
|
319
|
+
};
|
|
320
|
+
|
|
201
321
|
export declare type FormTemplateProperties = Omit<TemplateBase<FormProperties>, "after" | "before" | "children" | "errors" | "languageSelector" | "pagination" | "signature"> & {
|
|
202
322
|
readonly after?: string | undefined;
|
|
203
323
|
readonly before?: string | undefined;
|
|
204
324
|
readonly children: string;
|
|
205
325
|
readonly errors?: string | undefined;
|
|
206
326
|
readonly fields: string;
|
|
327
|
+
readonly hiddenFields: string;
|
|
207
328
|
readonly attributes: HtmlAttributes;
|
|
329
|
+
readonly titleHtml?: string | undefined;
|
|
330
|
+
readonly descriptionHtml?: string | undefined;
|
|
208
331
|
readonly languageSelector?: string | undefined;
|
|
209
332
|
readonly pagination?: TemplateFormPagination | undefined;
|
|
333
|
+
readonly paginationHtml?: string | undefined;
|
|
334
|
+
readonly shortTextStyle: string;
|
|
210
335
|
readonly signature?: string | undefined;
|
|
211
336
|
readonly submitLabel: string;
|
|
337
|
+
readonly submitButton: string;
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
export declare type FormTitleTemplateProperties = {
|
|
341
|
+
readonly title: string;
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
declare type GroupListProperties = {
|
|
345
|
+
linkId: string;
|
|
346
|
+
header?: ReactNode;
|
|
347
|
+
errors?: ReactNode;
|
|
348
|
+
children: ReactNode;
|
|
349
|
+
onAdd?: (() => void) | undefined;
|
|
350
|
+
canAdd?: boolean | undefined;
|
|
351
|
+
path?: NodePath | undefined;
|
|
352
|
+
count?: number | undefined;
|
|
353
|
+
customExtensions?: CustomExtensionValues | undefined;
|
|
212
354
|
};
|
|
213
355
|
|
|
214
356
|
export declare type GroupListTemplateProperties = Omit<TemplateBase<GroupListProperties>, "children" | "errors" | "header"> & {
|
|
@@ -218,6 +360,20 @@ export declare type GroupListTemplateProperties = Omit<TemplateBase<GroupListPro
|
|
|
218
360
|
readonly hasCount: boolean;
|
|
219
361
|
} & AddActionProperties;
|
|
220
362
|
|
|
363
|
+
declare type GroupScaffoldProperties = {
|
|
364
|
+
linkId?: string | undefined;
|
|
365
|
+
path?: NodePath | undefined;
|
|
366
|
+
header?: ReactNode;
|
|
367
|
+
children?: ReactNode;
|
|
368
|
+
errors?: ReactNode;
|
|
369
|
+
signature?: ReactNode;
|
|
370
|
+
isExpandable?: boolean | undefined;
|
|
371
|
+
isExpanded: boolean;
|
|
372
|
+
onRemove?: (() => void) | undefined;
|
|
373
|
+
canRemove?: boolean | undefined;
|
|
374
|
+
customExtensions?: CustomExtensionValues | undefined;
|
|
375
|
+
};
|
|
376
|
+
|
|
221
377
|
export declare type GroupScaffoldTemplateProperties = Omit<TemplateBase<GroupScaffoldProperties>, "children" | "errors" | "header" | "signature"> & {
|
|
222
378
|
readonly header?: string | undefined;
|
|
223
379
|
readonly children?: string | undefined;
|
|
@@ -228,10 +384,20 @@ export declare type GroupScaffoldTemplateProperties = Omit<TemplateBase<GroupSca
|
|
|
228
384
|
readonly signature?: string | undefined;
|
|
229
385
|
} & RemoveActionProperties & CollapsibleActionProperties;
|
|
230
386
|
|
|
387
|
+
declare type HeaderProperties = {
|
|
388
|
+
linkId: string;
|
|
389
|
+
children: ReactNode;
|
|
390
|
+
};
|
|
391
|
+
|
|
231
392
|
export declare type HeaderTemplateProperties = Omit<TemplateBase<HeaderProperties>, "children"> & {
|
|
232
393
|
readonly children: string;
|
|
233
394
|
};
|
|
234
395
|
|
|
396
|
+
declare type HelpProperties = {
|
|
397
|
+
id: string;
|
|
398
|
+
children: ReactNode;
|
|
399
|
+
};
|
|
400
|
+
|
|
235
401
|
export declare type HelpTemplateProperties = Omit<TemplateBase<HelpProperties>, "children"> & {
|
|
236
402
|
readonly ariaLabel: string;
|
|
237
403
|
readonly buttonId?: string | undefined;
|
|
@@ -251,8 +417,18 @@ export declare function htmlAttributes(values: HtmlAttributes): string;
|
|
|
251
417
|
|
|
252
418
|
export declare type HtmlAttributeValue = string | number | boolean | null | undefined;
|
|
253
419
|
|
|
420
|
+
declare type Hyperlink = {
|
|
421
|
+
href: string;
|
|
422
|
+
label: string | undefined;
|
|
423
|
+
};
|
|
424
|
+
|
|
254
425
|
export declare function inferTextField(id: string, group: InputGroupState | undefined): AnswerField;
|
|
255
426
|
|
|
427
|
+
declare type InputGroupProperties = {
|
|
428
|
+
children: ReactNode;
|
|
429
|
+
spans: number[];
|
|
430
|
+
};
|
|
431
|
+
|
|
256
432
|
export declare type InputGroupState = {
|
|
257
433
|
readonly size: number;
|
|
258
434
|
readonly index: number;
|
|
@@ -268,6 +444,36 @@ export declare function isDefined<T>(value: T | undefined): value is T;
|
|
|
268
444
|
|
|
269
445
|
export declare function isPreservedOptionToken(token: string): boolean;
|
|
270
446
|
|
|
447
|
+
declare type LabelAs = "legend" | "label" | "text";
|
|
448
|
+
|
|
449
|
+
export declare type LabelContentTemplateProperties = {
|
|
450
|
+
readonly children: string;
|
|
451
|
+
readonly prefix?: string | undefined;
|
|
452
|
+
readonly shortText?: string | undefined;
|
|
453
|
+
readonly required?: boolean | undefined;
|
|
454
|
+
readonly help?: string | undefined;
|
|
455
|
+
readonly legal?: string | undefined;
|
|
456
|
+
readonly flyover?: string | undefined;
|
|
457
|
+
readonly hasShortText: boolean;
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
declare type LabelProperties = {
|
|
461
|
+
prefix?: ReactNode;
|
|
462
|
+
shortText?: string | undefined;
|
|
463
|
+
supportHyperlinks?: ReadonlyArray<Hyperlink> | undefined;
|
|
464
|
+
media?: Attachment | undefined;
|
|
465
|
+
isExpanded: boolean;
|
|
466
|
+
onToggleExpanded?: (() => void) | undefined;
|
|
467
|
+
children: ReactNode;
|
|
468
|
+
id: string;
|
|
469
|
+
htmlFor?: string | undefined;
|
|
470
|
+
required?: boolean | undefined;
|
|
471
|
+
help?: ReactNode;
|
|
472
|
+
legal?: ReactNode;
|
|
473
|
+
flyover?: ReactNode;
|
|
474
|
+
as?: LabelAs | undefined;
|
|
475
|
+
};
|
|
476
|
+
|
|
271
477
|
export declare type LabelTemplateProperties = Omit<TemplateBase<LabelProperties>, "children" | "flyover" | "help" | "legal" | "prefix"> & {
|
|
272
478
|
readonly attachmentLabel: string;
|
|
273
479
|
readonly prefix?: string | undefined;
|
|
@@ -287,6 +493,18 @@ export declare type LabelTemplateProperties = Omit<TemplateBase<LabelProperties>
|
|
|
287
493
|
|
|
288
494
|
export declare const LANGUAGE_FIELD = "fb[language]";
|
|
289
495
|
|
|
496
|
+
declare type LanguageOption = {
|
|
497
|
+
value: string;
|
|
498
|
+
label: string;
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
declare type LanguageSelectorProperties = {
|
|
502
|
+
id?: string | undefined;
|
|
503
|
+
options: readonly LanguageOption[];
|
|
504
|
+
value: string;
|
|
505
|
+
onChange: (value: string) => void;
|
|
506
|
+
};
|
|
507
|
+
|
|
290
508
|
export declare type LanguageSelectorTemplateProperties = Omit<TemplateBase<LanguageSelectorProperties>, "options"> & {
|
|
291
509
|
readonly id?: string | undefined;
|
|
292
510
|
readonly name: string;
|
|
@@ -299,12 +517,25 @@ export declare function lastLinkId(path: NodePath): string;
|
|
|
299
517
|
|
|
300
518
|
export declare type LaunchContext = Record<string, unknown>;
|
|
301
519
|
|
|
520
|
+
declare type LegalProperties = {
|
|
521
|
+
id: string;
|
|
522
|
+
children: ReactNode;
|
|
523
|
+
};
|
|
524
|
+
|
|
302
525
|
export declare type LegalTemplateProperties = Omit<TemplateBase<LegalProperties>, "children"> & {
|
|
303
526
|
readonly ariaLabel: string;
|
|
304
527
|
readonly buttonId?: string | undefined;
|
|
305
528
|
readonly children: string;
|
|
306
529
|
};
|
|
307
530
|
|
|
531
|
+
declare type LinkProperties = {
|
|
532
|
+
id?: string | undefined;
|
|
533
|
+
href: string;
|
|
534
|
+
children: ReactNode;
|
|
535
|
+
target?: string | undefined;
|
|
536
|
+
rel?: string | undefined;
|
|
537
|
+
};
|
|
538
|
+
|
|
308
539
|
export declare type LinkTemplateProperties = Omit<TemplateBase<LinkProperties>, "children"> & {
|
|
309
540
|
readonly children: string;
|
|
310
541
|
};
|
|
@@ -313,7 +544,41 @@ export declare function loadDefaultTemplates(): Promise<RequiredTemplates>;
|
|
|
313
544
|
|
|
314
545
|
export declare function loadTemplates(directory: string | URL): Promise<Templates>;
|
|
315
546
|
|
|
316
|
-
export declare function mediaHtml(attachment: Attachment | undefined, fallbackLabel: string, id?: string | undefined): string;
|
|
547
|
+
export declare function mediaHtml(templates: Pick<RequiredTemplates, "Media">, attachment: Attachment | undefined, fallbackLabel: string, id?: string | undefined): string;
|
|
548
|
+
|
|
549
|
+
export declare type MediaKind = "fallback" | "image" | "audio" | "video" | "link";
|
|
550
|
+
|
|
551
|
+
export declare type MediaTemplateProperties = {
|
|
552
|
+
readonly attachment: Attachment;
|
|
553
|
+
readonly id?: string | undefined;
|
|
554
|
+
readonly label: string;
|
|
555
|
+
readonly source?: string | undefined;
|
|
556
|
+
readonly contentType?: string | undefined;
|
|
557
|
+
readonly kind: MediaKind;
|
|
558
|
+
readonly isFallback: boolean;
|
|
559
|
+
readonly isImage: boolean;
|
|
560
|
+
readonly isAudio: boolean;
|
|
561
|
+
readonly isVideo: boolean;
|
|
562
|
+
readonly isLink: boolean;
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
declare type MultiSelectInputProperties = {
|
|
566
|
+
options: readonly OptionItem[];
|
|
567
|
+
selectedOptions: readonly SelectedOptionItem[];
|
|
568
|
+
searchQuery: string;
|
|
569
|
+
onSelect: (token: string) => void;
|
|
570
|
+
onDeselect: (token: string) => void;
|
|
571
|
+
onSearch?: (query: string) => void;
|
|
572
|
+
specifyOtherOption?: OptionItem | undefined;
|
|
573
|
+
customOptionForm?: ReactNode;
|
|
574
|
+
id: string;
|
|
575
|
+
path?: NodePath | undefined;
|
|
576
|
+
ariaLabelledBy: string;
|
|
577
|
+
ariaDescribedBy?: string | undefined;
|
|
578
|
+
disabled?: boolean | undefined;
|
|
579
|
+
isLoading?: boolean | undefined;
|
|
580
|
+
placeholder?: string | undefined;
|
|
581
|
+
};
|
|
317
582
|
|
|
318
583
|
export declare type MultiSelectInputTemplateProperties = Omit<FieldTemplateProperties<MultiSelectInputProperties>, "customOptionForm" | "options" | "selectedOptions" | "specifyOtherOption"> & {
|
|
319
584
|
readonly baselineName?: string | undefined;
|
|
@@ -328,6 +593,28 @@ export declare type MultiSelectInputTemplateProperties = Omit<FieldTemplatePrope
|
|
|
328
593
|
readonly customOptionForm?: string | undefined;
|
|
329
594
|
};
|
|
330
595
|
|
|
596
|
+
declare type NodePath = readonly NodePathSegment[];
|
|
597
|
+
|
|
598
|
+
declare interface NodePathSegment {
|
|
599
|
+
readonly linkId: string;
|
|
600
|
+
readonly index?: number | undefined;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
declare type NumberInputProperties = {
|
|
604
|
+
id: string;
|
|
605
|
+
path?: NodePath | undefined;
|
|
606
|
+
value: number | undefined;
|
|
607
|
+
onChange: (v?: number) => void;
|
|
608
|
+
disabled?: boolean | undefined;
|
|
609
|
+
placeholder?: string | undefined;
|
|
610
|
+
step?: number | "any";
|
|
611
|
+
min?: number | undefined;
|
|
612
|
+
max?: number | undefined;
|
|
613
|
+
ariaLabelledBy: string;
|
|
614
|
+
ariaDescribedBy?: string | undefined;
|
|
615
|
+
unitLabel?: string | undefined;
|
|
616
|
+
};
|
|
617
|
+
|
|
331
618
|
export declare type NumberInputTemplateProperties = FieldTemplateProperties<NumberInputProperties> & NumberInputViewProperties;
|
|
332
619
|
|
|
333
620
|
declare type NumberInputViewProperties = {
|
|
@@ -342,12 +629,29 @@ export declare function numberTemplateProperties(properties: SliderInputProperti
|
|
|
342
629
|
|
|
343
630
|
export declare function numberTemplateProperties(properties: SpinnerInputProperties): SpinnerInputTemplateProperties;
|
|
344
631
|
|
|
632
|
+
declare type OptionDisplayProperties = {
|
|
633
|
+
children: ReactNode;
|
|
634
|
+
prefix?: string | undefined;
|
|
635
|
+
media?: Attachment | undefined;
|
|
636
|
+
};
|
|
637
|
+
|
|
345
638
|
export declare type OptionDisplayTemplateProperties = Omit<TemplateBase<OptionDisplayProperties>, "children" | "media"> & {
|
|
346
639
|
readonly attachmentLabel: string;
|
|
347
640
|
readonly children: string;
|
|
348
641
|
readonly media: string;
|
|
349
642
|
};
|
|
350
643
|
|
|
644
|
+
declare type OptionItem = {
|
|
645
|
+
token: string;
|
|
646
|
+
label: ReactNode;
|
|
647
|
+
disabled: boolean;
|
|
648
|
+
exclusive: boolean;
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
declare type OptionsLoadingProperties = {
|
|
652
|
+
isLoading: boolean;
|
|
653
|
+
};
|
|
654
|
+
|
|
351
655
|
export declare type OptionsLoadingTemplateProperties = TemplateBase<OptionsLoadingProperties> & {
|
|
352
656
|
readonly loadingLabel: string;
|
|
353
657
|
};
|
|
@@ -356,8 +660,22 @@ export declare function optionValueName(path: NodePath, token: string): string;
|
|
|
356
660
|
|
|
357
661
|
export declare const PAGE_FIELD = "fb[page]";
|
|
358
662
|
|
|
663
|
+
export declare function pageHiddenField(currentPage: number | undefined): string;
|
|
664
|
+
|
|
665
|
+
export declare type PaginationTemplateProperties = TemplateFormPagination & {
|
|
666
|
+
readonly actionName: string;
|
|
667
|
+
readonly previousAction: "page-prev";
|
|
668
|
+
readonly nextAction: "page-next";
|
|
669
|
+
readonly navigationLabel: string;
|
|
670
|
+
readonly currentLabel: string;
|
|
671
|
+
readonly previousTargetLabel: string;
|
|
672
|
+
readonly nextTargetLabel: string;
|
|
673
|
+
};
|
|
674
|
+
|
|
359
675
|
export declare function pathControlId(token: string, path: NodePath | undefined, ...parts: Array<string | number | undefined>): string | undefined;
|
|
360
676
|
|
|
677
|
+
declare type PlaceholderString<Key extends string> = `${string}{${Key}}${string}`;
|
|
678
|
+
|
|
361
679
|
export declare type ProcessResult = {
|
|
362
680
|
readonly submitted: false;
|
|
363
681
|
} | {
|
|
@@ -392,6 +710,18 @@ export declare interface QuestionnaireRendererOptions<V extends FhirVersion = Fh
|
|
|
392
710
|
action?: string | undefined;
|
|
393
711
|
}
|
|
394
712
|
|
|
713
|
+
declare type QuestionScaffoldProperties = {
|
|
714
|
+
linkId: string;
|
|
715
|
+
path?: NodePath | undefined;
|
|
716
|
+
header?: ReactNode;
|
|
717
|
+
children: ReactNode;
|
|
718
|
+
errors?: ReactNode;
|
|
719
|
+
signature?: ReactNode;
|
|
720
|
+
isExpandable?: boolean | undefined;
|
|
721
|
+
isExpanded: boolean;
|
|
722
|
+
customExtensions?: CustomExtensionValues | undefined;
|
|
723
|
+
};
|
|
724
|
+
|
|
395
725
|
export declare type QuestionScaffoldTemplateProperties = Omit<TemplateBase<QuestionScaffoldProperties>, "children" | "errors" | "header" | "signature"> & {
|
|
396
726
|
readonly header?: string | undefined;
|
|
397
727
|
readonly children: string;
|
|
@@ -402,6 +732,21 @@ export declare type QuestionScaffoldTemplateProperties = Omit<TemplateBase<Quest
|
|
|
402
732
|
readonly signature?: string | undefined;
|
|
403
733
|
} & CollapsibleActionProperties;
|
|
404
734
|
|
|
735
|
+
declare type RadioButtonListProperties = {
|
|
736
|
+
options: readonly OptionItem[];
|
|
737
|
+
selectedOption: SelectedOptionItem | undefined;
|
|
738
|
+
orientation?: ChoiceOrientation | undefined;
|
|
739
|
+
onChange: (token?: string) => void;
|
|
740
|
+
specifyOtherOption?: OptionItem | undefined;
|
|
741
|
+
customOptionForm?: ReactNode;
|
|
742
|
+
id: string;
|
|
743
|
+
path?: NodePath | undefined;
|
|
744
|
+
ariaLabelledBy: string;
|
|
745
|
+
ariaDescribedBy?: string | undefined;
|
|
746
|
+
disabled?: boolean | undefined;
|
|
747
|
+
isLoading?: boolean | undefined;
|
|
748
|
+
};
|
|
749
|
+
|
|
405
750
|
export declare type RadioButtonListTemplateProperties = Omit<FieldTemplateProperties<RadioButtonListProperties>, "customOptionForm" | "options" | "selectedOption" | "specifyOtherOption"> & {
|
|
406
751
|
readonly baselineName?: string | undefined;
|
|
407
752
|
readonly baselineValue?: string | undefined;
|
|
@@ -412,6 +757,19 @@ export declare type RadioButtonListTemplateProperties = Omit<FieldTemplateProper
|
|
|
412
757
|
readonly customOptionForm?: string | undefined;
|
|
413
758
|
};
|
|
414
759
|
|
|
760
|
+
declare type RadioButtonProperties = {
|
|
761
|
+
id: string;
|
|
762
|
+
path?: NodePath | undefined;
|
|
763
|
+
groupName: string;
|
|
764
|
+
value: string;
|
|
765
|
+
checked: boolean;
|
|
766
|
+
onChange: () => void;
|
|
767
|
+
ariaLabelledBy: string;
|
|
768
|
+
ariaDescribedBy?: string | undefined;
|
|
769
|
+
disabled?: boolean;
|
|
770
|
+
label?: ReactNode;
|
|
771
|
+
};
|
|
772
|
+
|
|
415
773
|
export declare type RadioButtonTemplateProperties = Omit<FieldTemplateProperties<RadioButtonProperties>, "label"> & {
|
|
416
774
|
readonly hiddenValue?: string | undefined;
|
|
417
775
|
readonly label?: string | undefined;
|
|
@@ -455,6 +813,28 @@ export declare function searchName(path: NodePath): string;
|
|
|
455
813
|
|
|
456
814
|
export declare function selectedName(path: NodePath): string;
|
|
457
815
|
|
|
816
|
+
declare type SelectedOptionItem = OptionItem & {
|
|
817
|
+
ariaDescribedBy?: string | undefined;
|
|
818
|
+
errors?: ReactNode;
|
|
819
|
+
};
|
|
820
|
+
|
|
821
|
+
declare type SelectInputProperties = {
|
|
822
|
+
options: readonly OptionItem[];
|
|
823
|
+
selectedOption: SelectedOptionItem | undefined;
|
|
824
|
+
searchQuery: string;
|
|
825
|
+
onChange: (token?: string) => void;
|
|
826
|
+
onSearch?: (query: string) => void;
|
|
827
|
+
specifyOtherOption?: OptionItem | undefined;
|
|
828
|
+
customOptionForm?: ReactNode;
|
|
829
|
+
id: string;
|
|
830
|
+
path?: NodePath | undefined;
|
|
831
|
+
ariaLabelledBy: string;
|
|
832
|
+
ariaDescribedBy?: string | undefined;
|
|
833
|
+
disabled?: boolean | undefined;
|
|
834
|
+
isLoading?: boolean | undefined;
|
|
835
|
+
placeholder?: string | undefined;
|
|
836
|
+
};
|
|
837
|
+
|
|
458
838
|
export declare type SelectInputTemplateProperties = Omit<FieldTemplateProperties<SelectInputProperties>, "customOptionForm" | "options" | "selectedOption" | "specifyOtherOption"> & {
|
|
459
839
|
readonly baselineName?: string | undefined;
|
|
460
840
|
readonly baselineValue?: string | undefined;
|
|
@@ -473,24 +853,226 @@ export declare type SelectOptionTemplateItem = TemplateOptionItem & {
|
|
|
473
853
|
readonly selected: boolean;
|
|
474
854
|
};
|
|
475
855
|
|
|
856
|
+
export declare type ShortTextStyleTemplateProperties = Record<string, never>;
|
|
857
|
+
|
|
858
|
+
declare type SignatureInputProperties = {
|
|
859
|
+
value: string | undefined;
|
|
860
|
+
id: string;
|
|
861
|
+
path?: NodePath | undefined;
|
|
862
|
+
ariaLabelledBy?: string | undefined;
|
|
863
|
+
ariaDescribedBy?: string | undefined;
|
|
864
|
+
disabled?: boolean | undefined;
|
|
865
|
+
onChange?: ((value?: string) => void) | undefined;
|
|
866
|
+
};
|
|
867
|
+
|
|
476
868
|
export declare type SignatureInputTemplateProperties = FieldTemplateProperties<SignatureInputProperties> & {
|
|
477
869
|
readonly inputValue: string;
|
|
478
870
|
};
|
|
479
871
|
|
|
480
872
|
export declare function signatureName(path: NodePath): string;
|
|
481
873
|
|
|
874
|
+
declare type SliderInputProperties = {
|
|
875
|
+
id: string;
|
|
876
|
+
path?: NodePath | undefined;
|
|
877
|
+
value: number | undefined;
|
|
878
|
+
onChange: (v?: number) => void;
|
|
879
|
+
disabled?: boolean | undefined;
|
|
880
|
+
min?: number | undefined;
|
|
881
|
+
max?: number | undefined;
|
|
882
|
+
step?: number | undefined;
|
|
883
|
+
ariaLabelledBy: string;
|
|
884
|
+
ariaDescribedBy?: string | undefined;
|
|
885
|
+
lowerLabel?: string | undefined;
|
|
886
|
+
upperLabel?: string | undefined;
|
|
887
|
+
unitLabel?: string | undefined;
|
|
888
|
+
};
|
|
889
|
+
|
|
482
890
|
export declare type SliderInputTemplateProperties = FieldTemplateProperties<SliderInputProperties> & NumberInputViewProperties;
|
|
483
891
|
|
|
892
|
+
declare type SpinnerInputProperties = {
|
|
893
|
+
id: string;
|
|
894
|
+
path?: NodePath | undefined;
|
|
895
|
+
value: number | undefined;
|
|
896
|
+
onChange: (v?: number) => void;
|
|
897
|
+
disabled?: boolean | undefined;
|
|
898
|
+
min?: number | undefined;
|
|
899
|
+
max?: number | undefined;
|
|
900
|
+
step?: number | undefined;
|
|
901
|
+
ariaLabelledBy: string;
|
|
902
|
+
ariaDescribedBy?: string | undefined;
|
|
903
|
+
placeholder?: string | undefined;
|
|
904
|
+
unitLabel?: string | undefined;
|
|
905
|
+
};
|
|
906
|
+
|
|
484
907
|
export declare type SpinnerInputTemplateProperties = FieldTemplateProperties<SpinnerInputProperties> & NumberInputViewProperties;
|
|
485
908
|
|
|
486
909
|
export declare function stableId(base: string | undefined, ...parts: Array<string | number | undefined>): string | undefined;
|
|
487
910
|
|
|
911
|
+
declare type StackProperties = {
|
|
912
|
+
children: ReactNode;
|
|
913
|
+
};
|
|
914
|
+
|
|
488
915
|
export declare type StackTemplateProperties = Omit<TemplateBase<StackProperties>, "children"> & {
|
|
489
916
|
readonly children: string;
|
|
490
917
|
};
|
|
491
918
|
|
|
919
|
+
declare type Strings = {
|
|
920
|
+
readonly aria: {
|
|
921
|
+
readonly help: string;
|
|
922
|
+
readonly legal: string;
|
|
923
|
+
readonly flyover: string;
|
|
924
|
+
};
|
|
925
|
+
readonly value: {
|
|
926
|
+
readonly yes: string;
|
|
927
|
+
readonly no: string;
|
|
928
|
+
readonly unanswered: string;
|
|
929
|
+
};
|
|
930
|
+
readonly dialog: {
|
|
931
|
+
readonly cancel: string;
|
|
932
|
+
readonly submit: string;
|
|
933
|
+
};
|
|
934
|
+
readonly form: {
|
|
935
|
+
readonly submit: string;
|
|
936
|
+
readonly cancel: string;
|
|
937
|
+
};
|
|
938
|
+
readonly errors: {
|
|
939
|
+
readonly unknownMessage: string;
|
|
940
|
+
readonly issuesTitle: string;
|
|
941
|
+
readonly issueMessage: PlaceholderString<"message">;
|
|
942
|
+
};
|
|
943
|
+
readonly file: {
|
|
944
|
+
readonly sizeLabel: PlaceholderString<"sizeKb">;
|
|
945
|
+
readonly chooseAction: string;
|
|
946
|
+
readonly changeAction: string;
|
|
947
|
+
readonly replaceAction: string;
|
|
948
|
+
readonly clearAction: string;
|
|
949
|
+
readonly noFileChosen: string;
|
|
950
|
+
};
|
|
951
|
+
readonly group: {
|
|
952
|
+
readonly addSection: string;
|
|
953
|
+
readonly removeSection: string;
|
|
954
|
+
readonly noNodesYet: string;
|
|
955
|
+
};
|
|
956
|
+
readonly gridTable: {
|
|
957
|
+
readonly headerActions: string;
|
|
958
|
+
};
|
|
959
|
+
readonly inputs: {
|
|
960
|
+
readonly referencePlaceholder: string;
|
|
961
|
+
readonly referenceDisplayPlaceholder: string;
|
|
962
|
+
readonly codingSystemPlaceholder: string;
|
|
963
|
+
readonly codingCodePlaceholder: string;
|
|
964
|
+
readonly codingDisplayPlaceholder: string;
|
|
965
|
+
readonly quantityValuePlaceholder: string;
|
|
966
|
+
readonly quantityUnitPlaceholder: string;
|
|
967
|
+
readonly attachmentSelected: string;
|
|
968
|
+
readonly attachmentLabel: string;
|
|
969
|
+
};
|
|
970
|
+
readonly selection: {
|
|
971
|
+
readonly specifyOther: string;
|
|
972
|
+
readonly addAnother: string;
|
|
973
|
+
readonly selectPlaceholder: string;
|
|
974
|
+
readonly removeSelection: string;
|
|
975
|
+
readonly removeCustomValue: string;
|
|
976
|
+
readonly searchPlaceholder: string;
|
|
977
|
+
readonly noOptions: string;
|
|
978
|
+
readonly loadingOptions: string;
|
|
979
|
+
readonly dividerOr: string;
|
|
980
|
+
};
|
|
981
|
+
readonly pagination: {
|
|
982
|
+
readonly navigation: string;
|
|
983
|
+
readonly previous: string;
|
|
984
|
+
readonly next: string;
|
|
985
|
+
readonly pageLabel: PlaceholderString<"page">;
|
|
986
|
+
readonly previousTargetPage: PlaceholderString<"page">;
|
|
987
|
+
readonly nextTargetPage: PlaceholderString<"page">;
|
|
988
|
+
};
|
|
989
|
+
readonly language: {
|
|
990
|
+
readonly label: string;
|
|
991
|
+
readonly placeholder: string;
|
|
992
|
+
};
|
|
993
|
+
readonly table: {
|
|
994
|
+
readonly empty: string;
|
|
995
|
+
readonly noChoiceQuestionsHorizontal: string;
|
|
996
|
+
readonly noChoiceQuestions: string;
|
|
997
|
+
readonly noAnswerOptionsHorizontal: string;
|
|
998
|
+
readonly noAnswerOptions: string;
|
|
999
|
+
};
|
|
1000
|
+
readonly collapsible: {
|
|
1001
|
+
readonly expand: string;
|
|
1002
|
+
readonly collapse: string;
|
|
1003
|
+
};
|
|
1004
|
+
readonly tab: {
|
|
1005
|
+
readonly empty: string;
|
|
1006
|
+
readonly scrollLeft: string;
|
|
1007
|
+
readonly scrollRight: string;
|
|
1008
|
+
};
|
|
1009
|
+
readonly signature: {
|
|
1010
|
+
readonly sign: string;
|
|
1011
|
+
readonly signed: string;
|
|
1012
|
+
readonly clearAction: string;
|
|
1013
|
+
};
|
|
1014
|
+
readonly spinner: {
|
|
1015
|
+
readonly decrease: string;
|
|
1016
|
+
readonly increase: string;
|
|
1017
|
+
};
|
|
1018
|
+
readonly unsupported: {
|
|
1019
|
+
readonly itemType: PlaceholderString<"type">;
|
|
1020
|
+
};
|
|
1021
|
+
readonly validation: {
|
|
1022
|
+
readonly group: {
|
|
1023
|
+
readonly atLeastOneAnswer: string;
|
|
1024
|
+
};
|
|
1025
|
+
readonly groupList: {
|
|
1026
|
+
readonly minOccurs: PlaceholderString<"minOccurs">;
|
|
1027
|
+
readonly maxOccurs: PlaceholderString<"maxOccurs">;
|
|
1028
|
+
};
|
|
1029
|
+
readonly question: {
|
|
1030
|
+
readonly minOccursSingle: string;
|
|
1031
|
+
readonly minOccursMultiple: PlaceholderString<"minOccurs">;
|
|
1032
|
+
readonly maxOccurs: PlaceholderString<"maxOccurs">;
|
|
1033
|
+
};
|
|
1034
|
+
readonly signature: {
|
|
1035
|
+
readonly required: string;
|
|
1036
|
+
};
|
|
1037
|
+
readonly answer: {
|
|
1038
|
+
readonly minLength: PlaceholderString<"minLength">;
|
|
1039
|
+
readonly maxLength: PlaceholderString<"maxLength">;
|
|
1040
|
+
readonly minPrecision: PlaceholderString<"minLength">;
|
|
1041
|
+
readonly maxPrecision: PlaceholderString<"maxLength">;
|
|
1042
|
+
readonly blank: string;
|
|
1043
|
+
readonly valueNotEarlier: PlaceholderString<"formatted">;
|
|
1044
|
+
readonly valueNotLater: PlaceholderString<"formatted">;
|
|
1045
|
+
readonly valueMin: PlaceholderString<"formatted">;
|
|
1046
|
+
readonly valueMax: PlaceholderString<"formatted">;
|
|
1047
|
+
readonly valueDecimalPlaces: PlaceholderString<"maxPlaces">;
|
|
1048
|
+
readonly quantityMin: PlaceholderString<"formatted">;
|
|
1049
|
+
readonly quantityMax: PlaceholderString<"formatted">;
|
|
1050
|
+
readonly attachmentTypeMissing: PlaceholderString<"allowed">;
|
|
1051
|
+
readonly attachmentTypeNotAllowed: PlaceholderString<"allowed">;
|
|
1052
|
+
readonly attachmentSizeMax: PlaceholderString<"maxSize">;
|
|
1053
|
+
};
|
|
1054
|
+
};
|
|
1055
|
+
};
|
|
1056
|
+
|
|
492
1057
|
export declare const SUBMIT_ATTEMPTED_FIELD = "fb[submitAttempted]";
|
|
493
1058
|
|
|
1059
|
+
export declare type SubmitButtonTemplateProperties = {
|
|
1060
|
+
readonly id?: string | undefined;
|
|
1061
|
+
readonly actionName: string;
|
|
1062
|
+
readonly value: "submit";
|
|
1063
|
+
readonly label: string;
|
|
1064
|
+
};
|
|
1065
|
+
|
|
1066
|
+
declare type TabContainerProperties = {
|
|
1067
|
+
path?: NodePath | undefined;
|
|
1068
|
+
header?: ReactNode;
|
|
1069
|
+
items: TabItem[];
|
|
1070
|
+
value: number;
|
|
1071
|
+
onChange: (index: number) => void;
|
|
1072
|
+
errors?: ReactNode;
|
|
1073
|
+
linkId: string;
|
|
1074
|
+
};
|
|
1075
|
+
|
|
494
1076
|
export declare type TabContainerTemplateProperties = Omit<TemplateBase<TabContainerProperties>, "errors" | "header" | "items"> & {
|
|
495
1077
|
readonly header?: string | undefined;
|
|
496
1078
|
readonly errors?: string | undefined;
|
|
@@ -500,8 +1082,45 @@ export declare type TabContainerTemplateProperties = Omit<TemplateBase<TabContai
|
|
|
500
1082
|
readonly tabName?: string | undefined;
|
|
501
1083
|
};
|
|
502
1084
|
|
|
1085
|
+
declare type TabItem = {
|
|
1086
|
+
token: string;
|
|
1087
|
+
label: ReactNode;
|
|
1088
|
+
buttonId: string;
|
|
1089
|
+
panelId: string;
|
|
1090
|
+
content: ReactNode;
|
|
1091
|
+
};
|
|
1092
|
+
|
|
1093
|
+
declare type TableCell = {
|
|
1094
|
+
token: string;
|
|
1095
|
+
content?: ReactNode;
|
|
1096
|
+
};
|
|
1097
|
+
|
|
1098
|
+
declare type TableColumn = {
|
|
1099
|
+
token: string;
|
|
1100
|
+
content: ReactNode;
|
|
1101
|
+
width?: string | undefined;
|
|
1102
|
+
errors?: ReactNode | undefined;
|
|
1103
|
+
isLoading?: boolean | undefined;
|
|
1104
|
+
};
|
|
1105
|
+
|
|
503
1106
|
export declare function tableColumn(column: TableColumn, renderHtml: RenderHtml): TemplateTableColumn;
|
|
504
1107
|
|
|
1108
|
+
declare type TableProperties = {
|
|
1109
|
+
columns: TableColumn[];
|
|
1110
|
+
rows: TableRow[];
|
|
1111
|
+
};
|
|
1112
|
+
|
|
1113
|
+
declare type TableRow = {
|
|
1114
|
+
token: string;
|
|
1115
|
+
path?: NodePath | undefined;
|
|
1116
|
+
content?: ReactNode | undefined;
|
|
1117
|
+
errors?: ReactNode | undefined;
|
|
1118
|
+
isLoading?: boolean | undefined;
|
|
1119
|
+
cells: TableCell[];
|
|
1120
|
+
onRemove?: (() => void) | undefined;
|
|
1121
|
+
canRemove?: boolean | undefined;
|
|
1122
|
+
};
|
|
1123
|
+
|
|
505
1124
|
export declare function tableRow(row: TableRow, renderHtml: RenderHtml, strings: Strings, token: string): TemplateTableRow;
|
|
506
1125
|
|
|
507
1126
|
export declare type TableTemplateProperties = Omit<TemplateBase<TableProperties>, "columns" | "rows"> & {
|
|
@@ -533,13 +1152,13 @@ export declare type TemplateFormPagination = Omit<FormPagination, "onNext" | "on
|
|
|
533
1152
|
|
|
534
1153
|
export declare type TemplateName = keyof Templates;
|
|
535
1154
|
|
|
536
|
-
export declare const templateNames: readonly ["TextInput", "TextArea", "NumberInput", "DateInput", "DateTimeInput", "TimeInput", "SliderInput", "SpinnerInput", "OptionDisplay", "SelectInput", "RadioButton", "RadioButtonList", "Checkbox", "CheckboxList", "MultiSelectInput", "CustomOptionForm", "Errors", "Label", "QuestionScaffold", "OptionsLoading", "Help", "Legal", "Flyover", "Header", "Footer", "Form", "Stack", "AnswerList", "AnswerScaffold", "GroupList", "GroupScaffold", "Table", "InputGroup", "FileInput", "SignatureInput", "DisplayRenderer", "TabContainer", "Link", "LanguageSelector"];
|
|
1155
|
+
export declare const templateNames: readonly ["TextInput", "TextArea", "NumberInput", "DateInput", "DateTimeInput", "TimeInput", "SliderInput", "SpinnerInput", "OptionDisplay", "SelectInput", "RadioButton", "RadioButtonList", "Checkbox", "CheckboxList", "MultiSelectInput", "CustomOptionForm", "Media", "Errors", "Label", "LabelContent", "QuestionScaffold", "OptionsLoading", "Help", "Legal", "Flyover", "Header", "Footer", "FormTitle", "FormDescription", "Pagination", "SubmitButton", "ShortTextStyle", "Form", "Stack", "AnswerList", "AnswerScaffold", "GroupList", "GroupScaffold", "Table", "InputGroup", "FileInput", "SignatureInput", "DisplayRenderer", "TabContainer", "Link", "LanguageSelector"];
|
|
537
1156
|
|
|
538
1157
|
export declare type TemplateOptionItem = Omit<OptionItem, "label"> & {
|
|
539
1158
|
readonly label: string;
|
|
540
1159
|
};
|
|
541
1160
|
|
|
542
|
-
export declare type TemplateProperties = TextInputTemplateProperties | TextAreaTemplateProperties | NumberInputTemplateProperties | DateInputTemplateProperties | DateTimeInputTemplateProperties | TimeInputTemplateProperties | SliderInputTemplateProperties | SpinnerInputTemplateProperties | OptionDisplayTemplateProperties | SelectInputTemplateProperties | RadioButtonTemplateProperties | RadioButtonListTemplateProperties | CheckboxTemplateProperties | CheckboxListTemplateProperties | MultiSelectInputTemplateProperties | CustomOptionFormTemplateProperties | ErrorsTemplateProperties | LabelTemplateProperties | QuestionScaffoldTemplateProperties | OptionsLoadingTemplateProperties | HelpTemplateProperties | LegalTemplateProperties | FlyoverTemplateProperties | HeaderTemplateProperties | FooterTemplateProperties | FormTemplateProperties | StackTemplateProperties | AnswerListTemplateProperties | AnswerScaffoldTemplateProperties | GroupListTemplateProperties | GroupScaffoldTemplateProperties | TableTemplateProperties | InputGroupTemplateProperties | FileInputTemplateProperties | SignatureInputTemplateProperties | DisplayRendererTemplateProperties | TabContainerTemplateProperties | LinkTemplateProperties | LanguageSelectorTemplateProperties;
|
|
1161
|
+
export declare type TemplateProperties = TextInputTemplateProperties | TextAreaTemplateProperties | NumberInputTemplateProperties | DateInputTemplateProperties | DateTimeInputTemplateProperties | TimeInputTemplateProperties | SliderInputTemplateProperties | SpinnerInputTemplateProperties | OptionDisplayTemplateProperties | SelectInputTemplateProperties | RadioButtonTemplateProperties | RadioButtonListTemplateProperties | CheckboxTemplateProperties | CheckboxListTemplateProperties | MultiSelectInputTemplateProperties | CustomOptionFormTemplateProperties | MediaTemplateProperties | ErrorsTemplateProperties | LabelTemplateProperties | LabelContentTemplateProperties | QuestionScaffoldTemplateProperties | OptionsLoadingTemplateProperties | HelpTemplateProperties | LegalTemplateProperties | FlyoverTemplateProperties | HeaderTemplateProperties | FooterTemplateProperties | FormTitleTemplateProperties | FormDescriptionTemplateProperties | PaginationTemplateProperties | SubmitButtonTemplateProperties | ShortTextStyleTemplateProperties | FormTemplateProperties | StackTemplateProperties | AnswerListTemplateProperties | AnswerScaffoldTemplateProperties | GroupListTemplateProperties | GroupScaffoldTemplateProperties | TableTemplateProperties | InputGroupTemplateProperties | FileInputTemplateProperties | SignatureInputTemplateProperties | DisplayRendererTemplateProperties | TabContainerTemplateProperties | LinkTemplateProperties | LanguageSelectorTemplateProperties;
|
|
543
1162
|
|
|
544
1163
|
export declare interface Templates {
|
|
545
1164
|
readonly TextInput?: Template<TextInputTemplateProperties> | undefined;
|
|
@@ -558,8 +1177,10 @@ export declare interface Templates {
|
|
|
558
1177
|
readonly CheckboxList?: Template<CheckboxListTemplateProperties> | undefined;
|
|
559
1178
|
readonly MultiSelectInput?: Template<MultiSelectInputTemplateProperties> | undefined;
|
|
560
1179
|
readonly CustomOptionForm?: Template<CustomOptionFormTemplateProperties> | undefined;
|
|
1180
|
+
readonly Media?: Template<MediaTemplateProperties> | undefined;
|
|
561
1181
|
readonly Errors?: Template<ErrorsTemplateProperties> | undefined;
|
|
562
1182
|
readonly Label?: Template<LabelTemplateProperties> | undefined;
|
|
1183
|
+
readonly LabelContent?: Template<LabelContentTemplateProperties> | undefined;
|
|
563
1184
|
readonly QuestionScaffold?: Template<QuestionScaffoldTemplateProperties> | undefined;
|
|
564
1185
|
readonly OptionsLoading?: Template<OptionsLoadingTemplateProperties> | undefined;
|
|
565
1186
|
readonly Help?: Template<HelpTemplateProperties> | undefined;
|
|
@@ -567,6 +1188,11 @@ export declare interface Templates {
|
|
|
567
1188
|
readonly Flyover?: Template<FlyoverTemplateProperties> | undefined;
|
|
568
1189
|
readonly Header?: Template<HeaderTemplateProperties> | undefined;
|
|
569
1190
|
readonly Footer?: Template<FooterTemplateProperties> | undefined;
|
|
1191
|
+
readonly FormTitle?: Template<FormTitleTemplateProperties> | undefined;
|
|
1192
|
+
readonly FormDescription?: Template<FormDescriptionTemplateProperties> | undefined;
|
|
1193
|
+
readonly Pagination?: Template<PaginationTemplateProperties> | undefined;
|
|
1194
|
+
readonly SubmitButton?: Template<SubmitButtonTemplateProperties> | undefined;
|
|
1195
|
+
readonly ShortTextStyle?: Template<ShortTextStyleTemplateProperties> | undefined;
|
|
570
1196
|
readonly Form?: Template<FormTemplateProperties> | undefined;
|
|
571
1197
|
readonly Stack?: Template<StackTemplateProperties> | undefined;
|
|
572
1198
|
readonly AnswerList?: Template<AnswerListTemplateProperties> | undefined;
|
|
@@ -619,12 +1245,54 @@ export declare type TemplateTableRow = Omit<TableRow, "cells" | "content" | "err
|
|
|
619
1245
|
readonly removeLabelHtml: string;
|
|
620
1246
|
} & RemoveActionProperties;
|
|
621
1247
|
|
|
1248
|
+
declare type TextAreaProperties = {
|
|
1249
|
+
id: string;
|
|
1250
|
+
path?: NodePath | undefined;
|
|
1251
|
+
value: string;
|
|
1252
|
+
onChange: (v: string) => void;
|
|
1253
|
+
disabled?: boolean | undefined;
|
|
1254
|
+
placeholder?: string | undefined;
|
|
1255
|
+
ariaLabelledBy: string;
|
|
1256
|
+
ariaDescribedBy?: string | undefined;
|
|
1257
|
+
inputMode?: HTMLAttributes<Element>["inputMode"] | undefined;
|
|
1258
|
+
minLength?: number | undefined;
|
|
1259
|
+
maxLength?: number | undefined;
|
|
1260
|
+
};
|
|
1261
|
+
|
|
622
1262
|
export declare type TextAreaTemplateProperties = FieldTemplateProperties<TextAreaProperties>;
|
|
623
1263
|
|
|
1264
|
+
declare type TextInputProperties = {
|
|
1265
|
+
id: string;
|
|
1266
|
+
path?: NodePath | undefined;
|
|
1267
|
+
type?: string | undefined;
|
|
1268
|
+
value: string;
|
|
1269
|
+
onChange: (v: string) => void;
|
|
1270
|
+
disabled?: boolean | undefined;
|
|
1271
|
+
placeholder?: string | undefined;
|
|
1272
|
+
ariaLabelledBy: string;
|
|
1273
|
+
ariaDescribedBy?: string | undefined;
|
|
1274
|
+
inputMode?: HTMLAttributes<Element>["inputMode"] | undefined;
|
|
1275
|
+
minLength?: number | undefined;
|
|
1276
|
+
maxLength?: number | undefined;
|
|
1277
|
+
};
|
|
1278
|
+
|
|
624
1279
|
export declare type TextInputTemplateProperties = FieldTemplateProperties<TextInputProperties> & {
|
|
625
1280
|
readonly inputType: string;
|
|
626
1281
|
};
|
|
627
1282
|
|
|
1283
|
+
declare type TimeInputProperties = {
|
|
1284
|
+
id: string;
|
|
1285
|
+
path?: NodePath | undefined;
|
|
1286
|
+
value: string;
|
|
1287
|
+
onChange: (v: string) => void;
|
|
1288
|
+
disabled?: boolean | undefined;
|
|
1289
|
+
placeholder?: string | undefined;
|
|
1290
|
+
ariaLabelledBy: string;
|
|
1291
|
+
ariaDescribedBy?: string | undefined;
|
|
1292
|
+
min?: string | undefined;
|
|
1293
|
+
max?: string | undefined;
|
|
1294
|
+
};
|
|
1295
|
+
|
|
628
1296
|
export declare type TimeInputTemplateProperties = FieldTemplateProperties<TimeInputProperties>;
|
|
629
1297
|
|
|
630
1298
|
export declare function unitValueName(path: NodePath, token: string): string;
|