@lancom/shared 0.0.458 → 0.0.459

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.
@@ -1,5 +1,7 @@
1
1
  <template>
2
- <div class="ProductsColors__wrapper">
2
+ <div
3
+ v-if="visibleColors.length > 0"
4
+ class="ProductsColors__wrapper">
3
5
  <toggle-content label="Colours">
4
6
  <div class="ProductsColors__selected">
5
7
  <div
@@ -68,7 +70,7 @@ export default {
68
70
  };
69
71
  },
70
72
  computed: {
71
- ...mapGetters('products', ['colors']),
73
+ ...mapGetters('products', ['colors', 'colorGroups']),
72
74
  colorsCount() {
73
75
  return this.colors.length;
74
76
  },
@@ -76,8 +78,13 @@ export default {
76
78
  const colors = (this.$route.query.colors || '').split(',');
77
79
  return this.colors.filter(color => colors.includes(color.alias));
78
80
  },
81
+ slectedGroupsColors() {
82
+ const colorGroupsAliases = (this.$route.query.colorGroups || '').split(',');
83
+ const colorGroups = this.colorGroups.filter(colorGroup => colorGroupsAliases.includes(colorGroup.alias));
84
+ return this.colors.filter(color => colorGroups.some(g => color.colorGroups?.includes(g._id)));
85
+ },
79
86
  visibleColors() {
80
- return this.displayAllColors ? this.colors : this.colors.slice(0, this.shortListColorsLimit);
87
+ return this.displayAllColors ? this.slectedGroupsColors : this.slectedGroupsColors.slice(0, this.shortListColorsLimit);
81
88
  }
82
89
  },
83
90
  mounted() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.458",
3
+ "version": "0.0.459",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {