@beabee/beabee-common 1.13.4 → 1.13.6
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.
|
@@ -4,7 +4,9 @@ exports.stringifyAnswer = exports.isFileUploadAnswer = exports.isAddressAnswer =
|
|
|
4
4
|
function flattenComponents(components) {
|
|
5
5
|
return components.flatMap((component) => [
|
|
6
6
|
component,
|
|
7
|
-
...flattenComponents(
|
|
7
|
+
...flattenComponents(
|
|
8
|
+
// Addresses have embedded components we don't want in our component list
|
|
9
|
+
(component.type !== "address" && component.components) || []),
|
|
8
10
|
]);
|
|
9
11
|
}
|
|
10
12
|
exports.flattenComponents = flattenComponents;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export function flattenComponents(components) {
|
|
2
2
|
return components.flatMap((component) => [
|
|
3
3
|
component,
|
|
4
|
-
...flattenComponents(
|
|
4
|
+
...flattenComponents(
|
|
5
|
+
// Addresses have embedded components we don't want in our component list
|
|
6
|
+
(component.type !== "address" && component.components) || []),
|
|
5
7
|
]);
|
|
6
8
|
}
|
|
7
9
|
function convertValuesToOptions(values) {
|
|
@@ -2,11 +2,12 @@ export interface BaseCalloutComponentSchema {
|
|
|
2
2
|
key: string;
|
|
3
3
|
label?: string;
|
|
4
4
|
input?: boolean;
|
|
5
|
+
adminOnly?: boolean;
|
|
5
6
|
components?: CalloutComponentSchema[];
|
|
6
7
|
[key: string]: unknown;
|
|
7
8
|
}
|
|
8
9
|
export interface OtherCalloutComponentSchema extends BaseCalloutComponentSchema {
|
|
9
|
-
type: "address" | "button" | "checkbox" | "email" | "number" | "password" | "textfield" | "textarea";
|
|
10
|
+
type: "address" | "button" | "checkbox" | "email" | "file" | "number" | "password" | "textfield" | "textarea";
|
|
10
11
|
}
|
|
11
12
|
export interface SelectCalloutComponentSchema extends BaseCalloutComponentSchema {
|
|
12
13
|
type: "select";
|