@clxmedia/types 1.0.172 → 1.0.174
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/core/clxforms/index.d.ts +93 -91
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ export type CLXFormSelectOption = {
|
|
|
4
4
|
label: string;
|
|
5
5
|
};
|
|
6
6
|
export type CLXFormSelectOptions = CLXFormSelectOption[];
|
|
7
|
-
export type CLXFormMode =
|
|
7
|
+
export type CLXFormMode = "edit" | "preview" | "live";
|
|
8
8
|
export type CLXFormErrorMsg = string | null;
|
|
9
9
|
export type CLXFormFormattingResponse = {
|
|
10
10
|
errorMsg: CLXFormErrorMsg[];
|
|
@@ -20,9 +20,9 @@ export type CLXFormState = {
|
|
|
20
20
|
mode: CLXFormMode;
|
|
21
21
|
locked: boolean;
|
|
22
22
|
};
|
|
23
|
-
export type CLXFormSubmitAction =
|
|
24
|
-
export type CLXFormAllowable =
|
|
25
|
-
export type CLXFormSectionFormat =
|
|
23
|
+
export type CLXFormSubmitAction = "lock" | "reset" | "snapshot" | "notify";
|
|
24
|
+
export type CLXFormAllowable = "share" | "reset";
|
|
25
|
+
export type CLXFormSectionFormat = "tabs" | "accordion";
|
|
26
26
|
export type CLXFormSettingsDisplay = {
|
|
27
27
|
sectionFormat: CLXFormSectionFormat;
|
|
28
28
|
hideNavButtons?: boolean;
|
|
@@ -48,9 +48,9 @@ export type CLXForm = {
|
|
|
48
48
|
description?: string;
|
|
49
49
|
settings?: CLXFormSettings;
|
|
50
50
|
};
|
|
51
|
-
export type CLXFormResponseType =
|
|
52
|
-
export type CLXFormFieldType =
|
|
53
|
-
export type CLXFormSelectType =
|
|
51
|
+
export type CLXFormResponseType = "STRING" | "NUMBER" | "STRING_ARRAY" | "CONTACT" | "CONTACT_ARRAY" | "BOOLEAN" | "FILE" | "DATE" | "SCHEDULE" | "COMPOUND" | "MULTI_COMPOUND" | "ANY";
|
|
52
|
+
export type CLXFormFieldType = "text" | "textarea" | "credential" | "boolean" | "select" | "multiselect" | "file" | "contact" | "date" | "schedule" | "compound";
|
|
53
|
+
export type CLXFormSelectType = "select" | "radio" | "checkbox" | "freeform";
|
|
54
54
|
export type CLXFormConditionSubjectEntry = {
|
|
55
55
|
value: string;
|
|
56
56
|
label: string;
|
|
@@ -85,15 +85,15 @@ export type CLXContactCard = {
|
|
|
85
85
|
phone: string | null;
|
|
86
86
|
};
|
|
87
87
|
export type CLXFormResponseStringValue = CLXFormResponseValueBase & {
|
|
88
|
-
type:
|
|
88
|
+
type: "STRING";
|
|
89
89
|
value: string;
|
|
90
90
|
};
|
|
91
91
|
export type CLXFormResponseDateValue = CLXFormResponseValueBase & {
|
|
92
|
-
type:
|
|
92
|
+
type: "DATE";
|
|
93
93
|
value: CLXFormDateTime;
|
|
94
94
|
};
|
|
95
95
|
export type CLXFormResponseScheduleValue = CLXFormResponseValueBase & {
|
|
96
|
-
type:
|
|
96
|
+
type: "SCHEDULE";
|
|
97
97
|
value: {
|
|
98
98
|
sunday: CLXFormTimeRange;
|
|
99
99
|
monday: CLXFormTimeRange;
|
|
@@ -105,29 +105,29 @@ export type CLXFormResponseScheduleValue = CLXFormResponseValueBase & {
|
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
107
|
export type CLXFormResponseNumberValue = CLXFormResponseValueBase & {
|
|
108
|
-
type:
|
|
108
|
+
type: "NUMBER";
|
|
109
109
|
value: number;
|
|
110
110
|
};
|
|
111
111
|
export type CLXFormResponseFileValue = CLXFormResponseValueBase & {
|
|
112
|
-
type:
|
|
112
|
+
type: "FILE";
|
|
113
113
|
value: CLXFormsFileDescriptors;
|
|
114
114
|
};
|
|
115
115
|
export type CLXFormResponseBooleanValue = CLXFormResponseValueBase & {
|
|
116
|
-
type:
|
|
116
|
+
type: "BOOLEAN";
|
|
117
117
|
value: boolean;
|
|
118
118
|
};
|
|
119
119
|
export type CLXFormResponseStringArrayValue = CLXFormResponseValueBase & {
|
|
120
|
-
type:
|
|
120
|
+
type: "STRING_ARRAY";
|
|
121
121
|
value: string[];
|
|
122
122
|
};
|
|
123
123
|
export type CLXFormResponseSingleCompoundValue = CLXFormResponseValueBase & {
|
|
124
|
-
type:
|
|
124
|
+
type: "COMPOUND";
|
|
125
125
|
value: {
|
|
126
126
|
[innerKey: string]: CLXFormResponseStringValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseBooleanValue;
|
|
127
127
|
};
|
|
128
128
|
};
|
|
129
129
|
export type CLXFormResponseCompoundValue = CLXFormResponseValueBase & {
|
|
130
|
-
type:
|
|
130
|
+
type: "MULTI_COMPOUND";
|
|
131
131
|
value: {
|
|
132
132
|
[outerKey: string]: {
|
|
133
133
|
[innerKey: string]: CLXFormResponseStringValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseBooleanValue;
|
|
@@ -135,15 +135,15 @@ export type CLXFormResponseCompoundValue = CLXFormResponseValueBase & {
|
|
|
135
135
|
};
|
|
136
136
|
};
|
|
137
137
|
export type CLXFormResponseAnyValue = CLXFormResponseValueBase & {
|
|
138
|
-
type:
|
|
138
|
+
type: "ANY";
|
|
139
139
|
value: any;
|
|
140
140
|
};
|
|
141
141
|
export type CLXFormResponseContactValue = CLXFormResponseValueBase & {
|
|
142
|
-
type:
|
|
142
|
+
type: "CONTACT";
|
|
143
143
|
value: CLXContactCard;
|
|
144
144
|
};
|
|
145
145
|
export type CLXFormResponseContactArrayValue = CLXFormResponseValueBase & {
|
|
146
|
-
type:
|
|
146
|
+
type: "CONTACT_ARRAY";
|
|
147
147
|
value: CLXContactCard[];
|
|
148
148
|
};
|
|
149
149
|
export type CLXFormResponseValue = CLXFormResponseStringValue | CLXFormResponseStringArrayValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseContactValue | CLXFormResponseContactArrayValue | CLXFormResponseCompoundValue | CLXFormResponseSingleCompoundValue | CLXFormResponseScheduleValue | CLXFormResponseFileValue | CLXFormResponseBooleanValue | CLXFormResponseAnyValue;
|
|
@@ -154,113 +154,115 @@ export type CLXFormField = {
|
|
|
154
154
|
type: CLXFormFieldType;
|
|
155
155
|
response_type: CLXFormResponseType;
|
|
156
156
|
};
|
|
157
|
-
export type CLXFieldMasks =
|
|
157
|
+
export type CLXFieldMasks = "phone" | "email" | "name" | "number" | "none" | "url";
|
|
158
158
|
export type CLXPlainFormFieldBase = CLXFormField & {
|
|
159
|
-
type:
|
|
159
|
+
type: "text";
|
|
160
160
|
mask: CLXFieldMasks;
|
|
161
|
+
character_limit?: number;
|
|
161
162
|
};
|
|
162
163
|
export declare enum CLXFormFieldFileTypes {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
164
|
+
"bmp" = "bmp",
|
|
165
|
+
"csv" = "csv",
|
|
166
|
+
"doc" = "doc",
|
|
167
|
+
"docx" = "docx",
|
|
168
|
+
"gif" = "gif",
|
|
169
|
+
"jpeg" = "jpeg",
|
|
170
|
+
"jpg" = "jpg",
|
|
171
|
+
"json" = "json",
|
|
172
|
+
"mp4" = "mp4",
|
|
173
|
+
"pdf" = "pdf",
|
|
174
|
+
"png" = "png",
|
|
175
|
+
"ppt" = "ppt",
|
|
176
|
+
"pptx" = "pptx",
|
|
177
|
+
"rtf" = "rtf",
|
|
178
|
+
"svg" = "svg",
|
|
179
|
+
"tif" = "tif",
|
|
180
|
+
"tiff" = "tiff",
|
|
181
|
+
"txt" = "txt",
|
|
182
|
+
"webm" = "webm",
|
|
183
|
+
"webp" = "webp",
|
|
184
|
+
"xls" = "xls",
|
|
185
|
+
"xlsx" = "xlsx",
|
|
186
|
+
"xml" = "xml",
|
|
187
|
+
"zip" = "zip"
|
|
187
188
|
}
|
|
188
189
|
export type CLXFileFormField = CLXFormField & {
|
|
189
|
-
type:
|
|
190
|
-
response_type:
|
|
190
|
+
type: "file";
|
|
191
|
+
response_type: "FILE";
|
|
191
192
|
max_files?: number;
|
|
192
193
|
allowed_file_types?: CLXFormFieldFileTypes[];
|
|
193
194
|
};
|
|
194
195
|
export type CLXCredentialFormField = CLXFormField & {
|
|
195
|
-
type:
|
|
196
|
-
response_type:
|
|
196
|
+
type: "credential";
|
|
197
|
+
response_type: "STRING";
|
|
197
198
|
};
|
|
198
199
|
export type CLXContactFormFieldBase = CLXFormField & {
|
|
199
|
-
type:
|
|
200
|
-
response_type:
|
|
200
|
+
type: "contact";
|
|
201
|
+
response_type: "CONTACT" | "CONTACT_ARRAY";
|
|
201
202
|
email_required?: boolean;
|
|
202
203
|
phone_required?: boolean;
|
|
203
204
|
allow_multiple: boolean;
|
|
204
205
|
};
|
|
205
206
|
export type CLXContactFormField = CLXContactFormFieldBase & {
|
|
206
|
-
response_type:
|
|
207
|
+
response_type: "CONTACT";
|
|
207
208
|
allow_multiple: false;
|
|
208
209
|
};
|
|
209
210
|
export type CLXMultipleContactFormField = CLXContactFormFieldBase & {
|
|
210
|
-
response_type:
|
|
211
|
+
response_type: "CONTACT_ARRAY";
|
|
211
212
|
allow_multiple: true;
|
|
212
213
|
};
|
|
213
214
|
export type CLXDateFormField = CLXFormField & {
|
|
214
|
-
type:
|
|
215
|
-
response_type:
|
|
215
|
+
type: "date";
|
|
216
|
+
response_type: "DATE";
|
|
216
217
|
include_time: boolean;
|
|
217
218
|
};
|
|
218
219
|
export type CLXScheduleFormField = CLXFormField & {
|
|
219
|
-
type:
|
|
220
|
-
response_type:
|
|
220
|
+
type: "schedule";
|
|
221
|
+
response_type: "SCHEDULE";
|
|
221
222
|
};
|
|
222
223
|
export type CLXTextFormFieldBase = CLXPlainFormFieldBase & {
|
|
223
|
-
type:
|
|
224
|
-
mask:
|
|
225
|
-
response_type:
|
|
224
|
+
type: "text";
|
|
225
|
+
mask: "phone" | "email" | "name" | "url" | "none";
|
|
226
|
+
response_type: "STRING" | "STRING_ARRAY";
|
|
226
227
|
multiple: boolean;
|
|
228
|
+
character_limit?: number;
|
|
227
229
|
};
|
|
228
230
|
export type CLXTextFormField = CLXTextFormFieldBase & {
|
|
229
|
-
response_type:
|
|
231
|
+
response_type: "STRING";
|
|
230
232
|
multiple: false;
|
|
231
233
|
};
|
|
232
234
|
export type CLXMultipleTextFormField = CLXTextFormFieldBase & {
|
|
233
|
-
response_type:
|
|
235
|
+
response_type: "STRING_ARRAY";
|
|
234
236
|
multiple: true;
|
|
235
237
|
};
|
|
236
238
|
export type CLXNumberFormField = CLXPlainFormFieldBase & {
|
|
237
|
-
type:
|
|
238
|
-
mask:
|
|
239
|
-
response_type:
|
|
239
|
+
type: "text";
|
|
240
|
+
mask: "number";
|
|
241
|
+
response_type: "NUMBER";
|
|
240
242
|
rounding?: number;
|
|
241
243
|
};
|
|
242
244
|
export type CLXTextAreaFormField = CLXFormField & {
|
|
243
|
-
type:
|
|
244
|
-
response_type:
|
|
245
|
+
type: "textarea";
|
|
246
|
+
response_type: "STRING";
|
|
245
247
|
};
|
|
246
248
|
export type CLXSelectableFormField = CLXFormField & {
|
|
247
249
|
select_type: CLXFormSelectType;
|
|
248
250
|
};
|
|
249
251
|
export type CLXBooleanFormField = CLXSelectableFormField & {
|
|
250
|
-
type:
|
|
251
|
-
select_type:
|
|
252
|
-
response_type:
|
|
252
|
+
type: "boolean";
|
|
253
|
+
select_type: "select" | "radio";
|
|
254
|
+
response_type: "BOOLEAN";
|
|
253
255
|
};
|
|
254
256
|
export type CLXSelectFormField = CLXSelectableFormField & {
|
|
255
|
-
type:
|
|
256
|
-
response_type:
|
|
257
|
-
select_type:
|
|
257
|
+
type: "select";
|
|
258
|
+
response_type: "STRING";
|
|
259
|
+
select_type: "select" | "radio";
|
|
258
260
|
options: CLXFormSelectOptions;
|
|
259
261
|
};
|
|
260
262
|
export type CLXMultiSelectFormField = CLXSelectableFormField & {
|
|
261
|
-
type:
|
|
262
|
-
response_type:
|
|
263
|
-
select_type:
|
|
263
|
+
type: "multiselect";
|
|
264
|
+
response_type: "STRING_ARRAY";
|
|
265
|
+
select_type: "checkbox" | "freeform";
|
|
264
266
|
options: CLXFormSelectOptions;
|
|
265
267
|
max_select?: number;
|
|
266
268
|
};
|
|
@@ -270,15 +272,15 @@ export type CLXCompoundableFormField = (CLXTextFormField | CLXNumberFormField |
|
|
|
270
272
|
is_required?: boolean;
|
|
271
273
|
};
|
|
272
274
|
export type CLXCompoundFormField = CLXSelectableFormField & {
|
|
273
|
-
type:
|
|
274
|
-
response_type:
|
|
275
|
+
type: "multiselect";
|
|
276
|
+
response_type: "MULTI_COMPOUND";
|
|
275
277
|
options: CLXFormSelectOptions;
|
|
276
278
|
compound_fields: CLXCompoundableFormField[];
|
|
277
279
|
max_select?: number;
|
|
278
280
|
};
|
|
279
281
|
export type CLXSingleCompoundFormField = CLXFormField & {
|
|
280
|
-
type:
|
|
281
|
-
response_type:
|
|
282
|
+
type: "compound";
|
|
283
|
+
response_type: "COMPOUND";
|
|
282
284
|
compound_fields: CLXCompoundableFormField[];
|
|
283
285
|
};
|
|
284
286
|
export type CLXFormQuestionResponseOptions = {
|
|
@@ -304,7 +306,7 @@ export type CLXFormPortableResponse = {
|
|
|
304
306
|
export type CLXFormPortableResponses = {
|
|
305
307
|
[questionSlug: string]: CLXFormPortableResponse;
|
|
306
308
|
};
|
|
307
|
-
export type CLXRuleComparison =
|
|
309
|
+
export type CLXRuleComparison = "stringEquals" | "stringExists" | "stringContains" | "stringStartsWith" | "stringEndsWith" | "stringInList" | "stringNotInList" | "stringListContainsAll" | "stringListContainsAny" | "stringListContainsNone" | "stringListEntryEquals" | "stringListEntryContains" | "stringListEntryStartsWith" | "stringListEntryEndsWith" | "dateEquals" | "dateBefore" | "dateAfter" | "booleanEquals" | "fileExists" | "numberEquals" | "numberGreaterThan" | "numberLessThan";
|
|
308
310
|
export type CLXFormRuleDefinition = {
|
|
309
311
|
subject: string;
|
|
310
312
|
target: CLXFormResponseValue;
|
|
@@ -318,52 +320,52 @@ export type CLXFormRuleInstanceBase = {
|
|
|
318
320
|
export type CLXFormRuleStringComparisonInstance = CLXFormRuleInstanceBase & {
|
|
319
321
|
subject: CLXFormResponseStringValue;
|
|
320
322
|
target: CLXFormResponseStringValue;
|
|
321
|
-
comparisonType:
|
|
323
|
+
comparisonType: "stringEquals" | "stringContains" | "stringStartsWith" | "stringEndsWith";
|
|
322
324
|
};
|
|
323
325
|
export type CLXFormRuleStringExistsComparisonInstance = CLXFormRuleInstanceBase & {
|
|
324
326
|
subject: CLXFormResponseStringValue;
|
|
325
327
|
target: CLXFormResponseBooleanValue;
|
|
326
|
-
comparisonType:
|
|
328
|
+
comparisonType: "stringExists";
|
|
327
329
|
};
|
|
328
330
|
export type CLXFormRuleStringListToStringListInstance = CLXFormRuleInstanceBase & {
|
|
329
331
|
subject: CLXFormResponseStringArrayValue;
|
|
330
332
|
target: CLXFormResponseStringArrayValue;
|
|
331
|
-
comparisonType:
|
|
333
|
+
comparisonType: "stringListContainsAll" | "stringListContainsAny" | "stringListContainsNone";
|
|
332
334
|
};
|
|
333
335
|
export type CLXFormRuleStringInListInstance = CLXFormRuleInstanceBase & {
|
|
334
336
|
subject: CLXFormResponseStringValue;
|
|
335
337
|
target: CLXFormResponseStringArrayValue;
|
|
336
|
-
comparisonType:
|
|
338
|
+
comparisonType: "stringInList" | "stringNotInList";
|
|
337
339
|
};
|
|
338
340
|
export type CLXFormRuleFileExistsInstance = CLXFormRuleInstanceBase & {
|
|
339
341
|
subject: CLXFormResponseFileValue;
|
|
340
342
|
target: CLXFormResponseBooleanValue;
|
|
341
|
-
comparisonType:
|
|
343
|
+
comparisonType: "fileExists";
|
|
342
344
|
};
|
|
343
345
|
export type CLXFormRuleDateComparisonInstance = CLXFormRuleInstanceBase & {
|
|
344
346
|
subject: CLXFormResponseDateValue;
|
|
345
347
|
target: CLXFormResponseDateValue;
|
|
346
|
-
comparisonType:
|
|
348
|
+
comparisonType: "dateEquals" | "dateBefore" | "dateAfter";
|
|
347
349
|
};
|
|
348
350
|
export type CLXFormRuleStringListComparisonInstance = CLXFormRuleInstanceBase & {
|
|
349
351
|
subject: CLXFormResponseStringArrayValue;
|
|
350
352
|
target: CLXFormResponseStringValue;
|
|
351
|
-
comparisonType:
|
|
353
|
+
comparisonType: "stringListEntryEquals" | "stringListEntryContains" | "stringListEntryStartsWith" | "stringListEntryEndsWith";
|
|
352
354
|
};
|
|
353
355
|
export type CLXFormRuleBooleanEqualsInstance = CLXFormRuleInstanceBase & {
|
|
354
356
|
subject: CLXFormResponseBooleanValue;
|
|
355
357
|
target: CLXFormResponseBooleanValue;
|
|
356
|
-
comparisonType:
|
|
358
|
+
comparisonType: "booleanEquals";
|
|
357
359
|
};
|
|
358
360
|
export type CLXFormRuleNumberComparisonInstance = CLXFormRuleInstanceBase & {
|
|
359
361
|
subject: CLXFormResponseNumberValue;
|
|
360
362
|
target: CLXFormResponseNumberValue;
|
|
361
|
-
comparisonType:
|
|
363
|
+
comparisonType: "numberEquals" | "numberGreaterThan" | "numberLessThan";
|
|
362
364
|
};
|
|
363
365
|
export type CLXFormRuleInstance = CLXFormRuleStringComparisonInstance | CLXFormRuleStringExistsComparisonInstance | CLXFormRuleStringInListInstance | CLXFormRuleFileExistsInstance | CLXFormRuleDateComparisonInstance | CLXFormRuleStringListToStringListInstance | CLXFormRuleStringListComparisonInstance | CLXFormRuleBooleanEqualsInstance | CLXFormRuleNumberComparisonInstance;
|
|
364
366
|
export type CLXFormRuleSet = {
|
|
365
367
|
rules: (CLXFormRuleDefinition | CLXFormRuleSet)[];
|
|
366
|
-
combinator?:
|
|
368
|
+
combinator?: "and" | "or";
|
|
367
369
|
};
|
|
368
370
|
export type CLXConditionalOverride = {
|
|
369
371
|
ruleset: CLXFormRuleSet;
|