@clxmedia/types 1.0.34 → 1.0.36
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.
|
@@ -20,7 +20,7 @@ export type CLXForm = {
|
|
|
20
20
|
name: string;
|
|
21
21
|
description?: string;
|
|
22
22
|
};
|
|
23
|
-
export type CLXFormResponseType = 'STRING' | 'NUMBER' | 'STRING_ARRAY' | 'CONTACT' | 'CONTACT_ARRAY' | 'BOOLEAN' | 'FILE' | 'DATE' | 'SCHEDULE' | 'ANY';
|
|
23
|
+
export type CLXFormResponseType = 'STRING' | 'NUMBER' | 'STRING_ARRAY' | 'CONTACT' | 'CONTACT_ARRAY' | 'BOOLEAN' | 'FILE' | 'DATE' | 'SCHEDULE' | 'COMPOUND' | 'ANY';
|
|
24
24
|
export type CLXFormFieldType = 'text' | 'textarea' | 'boolean' | 'select' | 'multiselect' | 'file' | 'contact' | 'date' | 'schedule';
|
|
25
25
|
export type CLXFormSelectType = 'select' | 'radio' | 'checkbox' | 'freeform';
|
|
26
26
|
export type CLXFormConditionSubjectEntry = {
|
|
@@ -90,6 +90,14 @@ export type CLXFormResponseStringArrayValue = CLXFormResponseValueBase & {
|
|
|
90
90
|
type: 'STRING_ARRAY';
|
|
91
91
|
value: string[];
|
|
92
92
|
};
|
|
93
|
+
export type CLXFormResponseCompoundValue = CLXFormResponseValueBase & {
|
|
94
|
+
type: 'COMPOUND';
|
|
95
|
+
value: {
|
|
96
|
+
[key: string]: {
|
|
97
|
+
[innerKey: string]: CLXFormResponseStringValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseBooleanValue;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
93
101
|
export type CLXFormResponseAnyValue = CLXFormResponseValueBase & {
|
|
94
102
|
type: 'ANY';
|
|
95
103
|
value: any;
|
|
@@ -102,7 +110,7 @@ export type CLXFormResponseContactArrayValue = CLXFormResponseValueBase & {
|
|
|
102
110
|
type: 'CONTACT_ARRAY';
|
|
103
111
|
value: CLXContactCard[];
|
|
104
112
|
};
|
|
105
|
-
export type CLXFormResponseValue = CLXFormResponseStringValue | CLXFormResponseStringArrayValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseContactValue | CLXFormResponseContactArrayValue | CLXFormResponseScheduleValue | CLXFormResponseFileValue | CLXFormResponseBooleanValue | CLXFormResponseAnyValue;
|
|
113
|
+
export type CLXFormResponseValue = CLXFormResponseStringValue | CLXFormResponseStringArrayValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseContactValue | CLXFormResponseContactArrayValue | CLXFormResponseCompoundValue | CLXFormResponseScheduleValue | CLXFormResponseFileValue | CLXFormResponseBooleanValue | CLXFormResponseAnyValue;
|
|
106
114
|
export type CLXFormResponses = {
|
|
107
115
|
[questionSlug: string]: CLXFormResponseValue;
|
|
108
116
|
};
|
|
@@ -216,8 +224,21 @@ export type CLXMultiSelectFormField = CLXSelectableFormField & {
|
|
|
216
224
|
options: CLXFormSelectOptions;
|
|
217
225
|
max_select?: number;
|
|
218
226
|
};
|
|
227
|
+
export type CLXCompoundableFormField = CLXTextFormField | CLXNumberFormField | CLXDateFormField | CLXFileFormField | CLXTextAreaFormField | CLXBooleanFormField | CLXSelectFormField | CLXMultiSelectFormField;
|
|
228
|
+
export type CLXCompoundFormField = CLXSelectableFormField & {
|
|
229
|
+
type: 'multiselect';
|
|
230
|
+
response_type: 'COMPOUND';
|
|
231
|
+
options: CLXFormSelectOptions;
|
|
232
|
+
compound_fields: {
|
|
233
|
+
[key: string]: CLXCompoundableFormField & {
|
|
234
|
+
is_required?: boolean;
|
|
235
|
+
label: string;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
max_select?: number;
|
|
239
|
+
};
|
|
219
240
|
export type CLXFormQuestionResponseOptions = {
|
|
220
|
-
field: CLXTextFormField | CLXNumberFormField | CLXDateFormField | CLXScheduleFormField | CLXContactFormField | CLXMultipleContactFormField | CLXFileFormField | CLXTextAreaFormField | CLXBooleanFormField | CLXSelectFormField | CLXMultiSelectFormField | CLXMultipleTextFormField;
|
|
241
|
+
field: CLXTextFormField | CLXNumberFormField | CLXDateFormField | CLXScheduleFormField | CLXContactFormField | CLXMultipleContactFormField | CLXFileFormField | CLXCompoundFormField | CLXTextAreaFormField | CLXBooleanFormField | CLXSelectFormField | CLXMultiSelectFormField | CLXMultipleTextFormField;
|
|
221
242
|
has_parent?: boolean;
|
|
222
243
|
};
|
|
223
244
|
export type CLXFormQuestion = {
|
|
@@ -235,10 +256,6 @@ export type CLXFormRuleDefinition = {
|
|
|
235
256
|
target: CLXFormResponseValue;
|
|
236
257
|
comparison: CLXRuleComparison;
|
|
237
258
|
};
|
|
238
|
-
export type CLXConditionalOverride = {
|
|
239
|
-
rule: CLXFormRuleDefinition;
|
|
240
|
-
override: any;
|
|
241
|
-
};
|
|
242
259
|
export type CLXFormRuleInstanceBase = {
|
|
243
260
|
subject: CLXFormResponseValue;
|
|
244
261
|
target: CLXFormResponseValue;
|
|
@@ -289,8 +306,14 @@ export type CLXFormRuleSet = {
|
|
|
289
306
|
rules: (CLXFormRuleDefinition | CLXFormRuleSet)[];
|
|
290
307
|
combinator?: 'and' | 'or';
|
|
291
308
|
};
|
|
309
|
+
export type CLXConditionalOverride = {
|
|
310
|
+
ruleset: CLXFormRuleSet;
|
|
311
|
+
override: any;
|
|
312
|
+
};
|
|
292
313
|
export type CLXConditionalOverrides = {
|
|
293
|
-
max_select_override?: CLXConditionalOverride
|
|
314
|
+
max_select_override?: (CLXConditionalOverride & {
|
|
315
|
+
override: number;
|
|
316
|
+
})[];
|
|
294
317
|
};
|
|
295
318
|
export type CLXFormQuestionLayout = {
|
|
296
319
|
id: number;
|
|
@@ -306,6 +329,7 @@ export type CLXFormSection = {
|
|
|
306
329
|
name: string;
|
|
307
330
|
question_layouts: CLXFormQuestionLayout[];
|
|
308
331
|
has_alert?: boolean;
|
|
332
|
+
conditions?: CLXFormRuleSet;
|
|
309
333
|
};
|
|
310
334
|
export type CLXFormQuestionBundle = {
|
|
311
335
|
question: CLXFormQuestion;
|
|
@@ -316,6 +340,7 @@ export type CLXFormStep = {
|
|
|
316
340
|
name: string;
|
|
317
341
|
description: string;
|
|
318
342
|
sections: CLXFormSection[];
|
|
343
|
+
conditions?: CLXFormRuleSet;
|
|
319
344
|
};
|
|
320
345
|
export type CLXFormLayout = {
|
|
321
346
|
form: {
|