@scayle/storefront-core 7.49.0 → 7.49.1
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/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getFlattenedMaterialComposition = exports.
|
|
6
|
+
exports.getFlattenedVariantCrosssellings = exports.getFlattenedMaterialComposition = exports.getFlattenedAdvancedAttribute = exports.flattenFieldSet = void 0;
|
|
7
7
|
var _arrayHelpers = require("./arrayHelpers.cjs");
|
|
8
8
|
var _objectHelpers = require("./objectHelpers.cjs");
|
|
9
9
|
const flattenFieldSet = fieldSet => {
|
|
@@ -17,10 +17,14 @@ const getFlattenedMaterialComposition = materialCompositions => {
|
|
|
17
17
|
}));
|
|
18
18
|
};
|
|
19
19
|
exports.getFlattenedMaterialComposition = getFlattenedMaterialComposition;
|
|
20
|
-
const
|
|
21
|
-
return
|
|
22
|
-
...(0, _arrayHelpers.flattenDeep)(flattenFieldSet(
|
|
23
|
-
values: (0, _arrayHelpers.flattenDeep)(
|
|
20
|
+
const getFlattenedAdvancedAttribute = attributeGroup => {
|
|
21
|
+
return attributeGroup.map(groupItem => ({
|
|
22
|
+
...(0, _arrayHelpers.flattenDeep)(flattenFieldSet(groupItem.fieldSet))[0],
|
|
23
|
+
values: (0, _arrayHelpers.flattenDeep)(groupItem.groupSet.map(g => flattenFieldSet(g.fieldSet)))
|
|
24
24
|
}));
|
|
25
25
|
};
|
|
26
|
-
exports.
|
|
26
|
+
exports.getFlattenedAdvancedAttribute = getFlattenedAdvancedAttribute;
|
|
27
|
+
const getFlattenedVariantCrosssellings = variantCrosssellings => {
|
|
28
|
+
return getFlattenedAdvancedAttribute(variantCrosssellings);
|
|
29
|
+
};
|
|
30
|
+
exports.getFlattenedVariantCrosssellings = getFlattenedVariantCrosssellings;
|
|
@@ -6,7 +6,11 @@ export declare const getFlattenedMaterialComposition: (materialCompositions: Arr
|
|
|
6
6
|
fieldSet: FieldSet;
|
|
7
7
|
groupSet: GroupSet;
|
|
8
8
|
}>) => object[];
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const getFlattenedAdvancedAttribute: <T>(attributeGroup: Array<{
|
|
10
|
+
fieldSet: FieldSet;
|
|
11
|
+
groupSet: GroupSet;
|
|
12
|
+
}>) => T[];
|
|
13
|
+
export declare const getFlattenedVariantCrosssellings: <T>(variantCrosssellings: Array<{
|
|
10
14
|
fieldSet: FieldSet;
|
|
11
15
|
groupSet: GroupSet;
|
|
12
16
|
}>) => T[];
|
|
@@ -11,11 +11,14 @@ export const getFlattenedMaterialComposition = (materialCompositions) => {
|
|
|
11
11
|
)
|
|
12
12
|
}));
|
|
13
13
|
};
|
|
14
|
-
export const
|
|
15
|
-
return
|
|
16
|
-
...flattenDeep(flattenFieldSet(
|
|
14
|
+
export const getFlattenedAdvancedAttribute = (attributeGroup) => {
|
|
15
|
+
return attributeGroup.map((groupItem) => ({
|
|
16
|
+
...flattenDeep(flattenFieldSet(groupItem.fieldSet))[0],
|
|
17
17
|
values: flattenDeep(
|
|
18
|
-
|
|
18
|
+
groupItem.groupSet.map((g) => flattenFieldSet(g.fieldSet))
|
|
19
19
|
)
|
|
20
20
|
}));
|
|
21
21
|
};
|
|
22
|
+
export const getFlattenedVariantCrosssellings = (variantCrosssellings) => {
|
|
23
|
+
return getFlattenedAdvancedAttribute(variantCrosssellings);
|
|
24
|
+
};
|