@clxmedia/types 1.12.0 → 1.12.2
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.
|
@@ -2,6 +2,7 @@ import type { XperienceAbility } from "../auth";
|
|
|
2
2
|
export type CLXFormSelectOption = {
|
|
3
3
|
value: string;
|
|
4
4
|
label: string;
|
|
5
|
+
conditions?: CLXFormRuleSet;
|
|
5
6
|
};
|
|
6
7
|
export type CLXFormSelectOptions = CLXFormSelectOption[];
|
|
7
8
|
export type CLXFormMode = "edit" | "preview" | "live";
|
|
@@ -41,6 +42,7 @@ export type CLXFormSettings = {
|
|
|
41
42
|
allow: CLXFormAllowable[];
|
|
42
43
|
submit: CLXFormSubmitConfig;
|
|
43
44
|
display: CLXFormSettingsDisplay;
|
|
45
|
+
gateSatisfiedResponseSlug?: string;
|
|
44
46
|
};
|
|
45
47
|
export type CLXForm = {
|
|
46
48
|
id: number;
|
|
@@ -396,6 +398,11 @@ export type CLXFormRuleNumberComparisonInstance = CLXFormRuleInstanceBase & {
|
|
|
396
398
|
comparisonType: "numberEquals" | "numberGreaterThan" | "numberLessThan";
|
|
397
399
|
};
|
|
398
400
|
export type CLXFormRuleInstance = CLXFormRuleStringComparisonInstance | CLXFormRuleStringExistsComparisonInstance | CLXFormRuleStringInListInstance | CLXFormRuleFileExistsInstance | CLXFormRuleDateComparisonInstance | CLXFormRuleStringListToStringListInstance | CLXFormRuleStringListComparisonInstance | CLXFormRuleBooleanEqualsInstance | CLXFormRuleNumberComparisonInstance;
|
|
401
|
+
/**
|
|
402
|
+
* A form rule set is a collection of rules/conditions to evaluate.
|
|
403
|
+
*
|
|
404
|
+
* The rule set can contain a single rule, a combination of multiple rules, or nested rule sets.
|
|
405
|
+
*/
|
|
399
406
|
export type CLXFormRuleSet = {
|
|
400
407
|
rules: (CLXFormRuleDefinition | CLXFormRuleSet)[];
|
|
401
408
|
combinator?: "and" | "or";
|
|
@@ -409,6 +416,10 @@ export type CLXConditionalOverrides = {
|
|
|
409
416
|
override: number;
|
|
410
417
|
})[];
|
|
411
418
|
};
|
|
419
|
+
/**
|
|
420
|
+
* Defines the behavior of a question (identified by a question slug) within a form.
|
|
421
|
+
* E.g. Indicates whether the question is required or if any conditions must be met to enable the question.
|
|
422
|
+
*/
|
|
412
423
|
export type CLXFormQuestionLayout = {
|
|
413
424
|
id: number;
|
|
414
425
|
form_question_slug: string;
|
|
@@ -419,6 +430,11 @@ export type CLXFormQuestionLayout = {
|
|
|
419
430
|
is_complete?: boolean;
|
|
420
431
|
scope?: CLXResponseStoreTarget;
|
|
421
432
|
};
|
|
433
|
+
/**
|
|
434
|
+
* A form section is a grouping of form questions.
|
|
435
|
+
*
|
|
436
|
+
* Conditions can determine whether or not a section is enabled.
|
|
437
|
+
*/
|
|
422
438
|
export type CLXFormSection = {
|
|
423
439
|
id: number;
|
|
424
440
|
name: string;
|
|
@@ -430,6 +446,12 @@ export type CLXFormQuestionBundle = {
|
|
|
430
446
|
question: CLXFormQuestion;
|
|
431
447
|
layout: CLXFormQuestionLayout;
|
|
432
448
|
};
|
|
449
|
+
/**
|
|
450
|
+
* A form step is composed of one or more form sections.
|
|
451
|
+
*
|
|
452
|
+
* Steps are in a defined order, but one form step does not necessarily block the next.
|
|
453
|
+
* Conditions can determine whether or not a form step is enabled.
|
|
454
|
+
*/
|
|
433
455
|
export type CLXFormStep = {
|
|
434
456
|
id: number;
|
|
435
457
|
name: string;
|
|
@@ -446,6 +468,9 @@ export type FormStats = {
|
|
|
446
468
|
optional: FormStatCount;
|
|
447
469
|
required: FormStatCount;
|
|
448
470
|
};
|
|
471
|
+
/**
|
|
472
|
+
* Defines the top-level layout of a form, with questions grouped into one or more steps.
|
|
473
|
+
*/
|
|
449
474
|
export type CLXFormLayout = {
|
|
450
475
|
form: CLXForm;
|
|
451
476
|
steps: CLXFormStep[];
|