@habit.analytics/habit-claims-journey-components 2.1.9 → 2.3.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/README.md +1 -0
- package/dist/components/journey-builder/preview-widgets/SelectWidget.d.ts +1 -1
- package/dist/components/journey-builder/preview-widgets/TimeWidget.d.ts +4 -3
- package/dist/components/runner/FormRunnerWidget.d.ts +20 -2
- package/dist/i18n/locales/en.d.ts +34 -0
- package/dist/index.cjs +71 -71
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +7855 -7146
- package/dist/lib/computed-field.d.ts +12 -0
- package/dist/schemas/form-config.schema.json.d.ts +7 -4
- package/dist/types/journey.d.ts +56 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClaimPropertySpecOption } from '../../../types/journey';
|
|
2
|
-
export type SelectVariant = 'auto' | 'radio' | 'dropdown' | 'segmented';
|
|
2
|
+
export type SelectVariant = 'auto' | 'radio' | 'radio-horizontal' | 'dropdown' | 'segmented';
|
|
3
3
|
interface SelectWidgetProps {
|
|
4
4
|
label: string;
|
|
5
5
|
value: string;
|
|
@@ -5,10 +5,11 @@ interface TimeWidgetProps {
|
|
|
5
5
|
onChange: (value: string) => void;
|
|
6
6
|
helpText?: string;
|
|
7
7
|
}
|
|
8
|
+
export declare function maskTimeInput(raw: string): string;
|
|
9
|
+
export declare function isValidTime24h(value: string): boolean;
|
|
8
10
|
/**
|
|
9
|
-
*
|
|
10
|
-
* Stores values as `HH:mm`
|
|
11
|
-
* automatically renders 12h/24h based on the user's OS/browser locale.
|
|
11
|
+
* 24-hour time picker.
|
|
12
|
+
* Stores values as `HH:mm` and always renders a locale-independent 24h input.
|
|
12
13
|
*/
|
|
13
14
|
export declare function TimeWidget({ label, value, onChange, helpText }: TimeWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JourneySpec, UploadResult } from '../../types/journey';
|
|
1
|
+
import { JourneySpec, FormStep, UploadResult } from '../../types/journey';
|
|
2
2
|
export type StepApiRequest = {
|
|
3
3
|
step_id: string;
|
|
4
4
|
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
@@ -12,10 +12,28 @@ export type InitApiRequest = {
|
|
|
12
12
|
url: string;
|
|
13
13
|
headers?: Record<string, string>;
|
|
14
14
|
};
|
|
15
|
+
export interface FormRunnerSaveContext {
|
|
16
|
+
reason: 'step_change' | 'manual' | 'progress';
|
|
17
|
+
currentStep: FormStep;
|
|
18
|
+
currentStepIndex: number;
|
|
19
|
+
nextStepId?: string;
|
|
20
|
+
stage?: 'welcome' | 'form' | 'summary';
|
|
21
|
+
}
|
|
15
22
|
export interface FormRunnerWidgetProps {
|
|
16
23
|
journey: JourneySpec;
|
|
17
24
|
onSubmit?: (answers: Record<string, unknown>) => void;
|
|
18
|
-
onSave?: (partialAnswers: Record<string, unknown
|
|
25
|
+
onSave?: (partialAnswers: Record<string, unknown>, context?: FormRunnerSaveContext) => void | Promise<void>;
|
|
26
|
+
onProgressChange?: (partialAnswers: Record<string, unknown>, context: FormRunnerSaveContext) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Automatically calls `onSave` when the user advances from one step to another.
|
|
29
|
+
* Defaults to `true`; set to `false` to keep saving only under host control.
|
|
30
|
+
*/
|
|
31
|
+
autoSaveOnStepChange?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether to show the live summary panel while the user fills the form.
|
|
34
|
+
* Defaults to `true`. The final summary screen remains available.
|
|
35
|
+
*/
|
|
36
|
+
showSummaryPanel?: boolean;
|
|
19
37
|
onFileSelect?: (file: File, questionKey: string) => Promise<string | UploadResult | void> | void;
|
|
20
38
|
/**
|
|
21
39
|
* Optional handler to delegate per-step API calls to the host app.
|
|
@@ -197,6 +197,8 @@ declare const en: {
|
|
|
197
197
|
readonly fc_no_fields: "No fields.";
|
|
198
198
|
readonly fc_edit: "Edit";
|
|
199
199
|
readonly fc_remove_from_row: "Remove from row";
|
|
200
|
+
readonly fc_row_title_placeholder: "Section title (optional)";
|
|
201
|
+
readonly fc_row_show_divider: "Divider";
|
|
200
202
|
readonly fc_nav_title: "Step Navigation";
|
|
201
203
|
readonly fc_nav_api_call: "API call on continue";
|
|
202
204
|
readonly fc_nav_api_call_hint: "Executed before evaluating the rules.";
|
|
@@ -221,6 +223,8 @@ declare const en: {
|
|
|
221
223
|
readonly fc_nav_field_requires_value: "Field \"{{label}}\" requires a value.";
|
|
222
224
|
readonly fc_summary_panel: "Summary Panel";
|
|
223
225
|
readonly fc_summary_title_label: "Summary Title";
|
|
226
|
+
readonly fc_summary_show_sidebar: "Show live summary";
|
|
227
|
+
readonly fc_summary_show_sidebar_hint: "Display the summary sidebar while the user moves through the journey.";
|
|
224
228
|
readonly fc_summary_sections: "Sections";
|
|
225
229
|
readonly fc_summary_add_section: "Add Section";
|
|
226
230
|
readonly fc_summary_section_title_placeholder: "Section title";
|
|
@@ -330,6 +334,7 @@ declare const en: {
|
|
|
330
334
|
readonly fc_field_display_style: "Display style";
|
|
331
335
|
readonly fc_field_display_auto: "Auto (radio ≤5, dropdown >5)";
|
|
332
336
|
readonly fc_field_display_radio: "Radio list";
|
|
337
|
+
readonly fc_field_display_radio_horizontal: "Radio list horizontal";
|
|
333
338
|
readonly fc_field_display_dropdown: "Dropdown";
|
|
334
339
|
readonly fc_field_display_segmented: "Segmented buttons";
|
|
335
340
|
readonly fc_field_display_hint: "Controls how options render at runtime.";
|
|
@@ -341,6 +346,35 @@ declare const en: {
|
|
|
341
346
|
readonly fc_field_upload_validation: "Upload validation";
|
|
342
347
|
readonly fc_field_upload_accept: "Accepted MIME types/extensions";
|
|
343
348
|
readonly fc_field_upload_max: "Max size (MB)";
|
|
349
|
+
readonly fc_field_dynamic_rules: "Dynamic rules";
|
|
350
|
+
readonly fc_field_dynamic_rules_hint: "Show, enable or require this field based on other answers.";
|
|
351
|
+
readonly fc_field_visible_when: "Show when";
|
|
352
|
+
readonly fc_field_visible_when_hint: "When the condition is false, the field is hidden and its value is cleared.";
|
|
353
|
+
readonly fc_field_enabled_when: "Enable when";
|
|
354
|
+
readonly fc_field_enabled_when_hint: "When the condition is false, the field is shown as read-only.";
|
|
355
|
+
readonly fc_field_required_when: "Required when";
|
|
356
|
+
readonly fc_field_required_when_hint: "Overrides the static \"required\" flag while the field is visible.";
|
|
357
|
+
readonly fc_field_always_visible: "Always visible";
|
|
358
|
+
readonly fc_field_always_enabled: "Always enabled";
|
|
359
|
+
readonly fc_field_required_static: "Use static \"Required\" setting";
|
|
360
|
+
readonly fc_field_rule_active: "Rule active";
|
|
361
|
+
readonly fc_field_computed: "Computed value";
|
|
362
|
+
readonly fc_field_computed_hint: "Auto-calculate this field from other fields. The result is read-only.";
|
|
363
|
+
readonly fc_field_width: "Field width";
|
|
364
|
+
readonly fc_field_width_hint: "Width within a horizontal row (mobile is always full width).";
|
|
365
|
+
readonly fc_field_width_auto: "Auto (share row evenly)";
|
|
366
|
+
readonly fc_field_width_full: "Full (3/3)";
|
|
367
|
+
readonly fc_field_computed_operation: "Operation";
|
|
368
|
+
readonly fc_field_computed_op_sum: "Sum (+)";
|
|
369
|
+
readonly fc_field_computed_op_subtract: "Subtract (−)";
|
|
370
|
+
readonly fc_field_computed_op_multiply: "Multiply (×)";
|
|
371
|
+
readonly fc_field_computed_op_divide: "Divide (÷)";
|
|
372
|
+
readonly fc_field_computed_precision: "Decimal places";
|
|
373
|
+
readonly fc_field_computed_operands: "Operand fields";
|
|
374
|
+
readonly fc_field_computed_add_operand: "Add a field…";
|
|
375
|
+
readonly fc_field_computed_missing_operand: "(field not found)";
|
|
376
|
+
readonly fc_field_computed_no_fields: "No other fields available to use as operands.";
|
|
377
|
+
readonly fc_field_computed_all_added: "All available fields are already added.";
|
|
344
378
|
readonly fc_field_delete: "Delete field";
|
|
345
379
|
readonly fc_field_done: "Done";
|
|
346
380
|
readonly fc_field_confirm_delete: "Delete this field from the catalog (and all rows that use it)?";
|