@lancom/shared 0.0.185 → 0.0.187

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,5 @@
1
1
  <template>
2
- <div class="FAQ__wrapper view-transition">
2
+ <div class="FAQ__wrapper">
3
3
  <slot name="header">
4
4
  <div class="FAQ__header">
5
5
  <h1 class="lc_h1--white">
@@ -29,11 +29,11 @@
29
29
  <i
30
30
  v-if="togable"
31
31
  class="icon-cancel FAQ__group-caret"
32
- :class="{ active: openedGroup === group.type }"></i>
32
+ :class="{ active: openedGroups.includes(group.type) }"></i>
33
33
  </div>
34
34
  <div
35
- v-show="openedGroup === group.type"
36
- class="FAQ__group-content view-transition">
35
+ v-show="openedGroups.includes(group.type)"
36
+ class="FAQ__group-content">
37
37
  <div
38
38
  v-for="entity in group.entities"
39
39
  :key="entity._id"
@@ -51,7 +51,7 @@
51
51
  </div>
52
52
  <div
53
53
  v-show="openedEntities.includes(entity._id)"
54
- class="FAQ__entity-body view-transition"
54
+ class="FAQ__entity-body"
55
55
  v-html="entity.answer">
56
56
  </div>
57
57
  </div>
@@ -83,22 +83,20 @@ export default {
83
83
  }
84
84
  },
85
85
  data() {
86
+ const groups = this.groups || [];
86
87
  return {
87
- openedGroup: null,
88
- openedEntities: []
88
+ openedGroups: groups.map(({ type }) => type),
89
+ openedEntities: groups.reduce((items, { entities }) => [...items, ...entities.map(({ _id }) => _id)], [])
89
90
  };
90
91
  },
91
- mounted() {
92
- if (this.preopenedGroup) {
93
- this.toggleGroup({ type: this.preopenedGroup });
94
- }
95
- if (this.preopenedEntity) {
96
- this.toggleEntity({ _id: this.preopenedEntity });
97
- }
98
- },
99
92
  methods: {
100
93
  toggleGroup({ type }) {
101
- this.openedGroup = this.openedGroup === type ? null : type;
94
+ const index = this.openedGroups.indexOf(type);
95
+ if (~index) {
96
+ this.$delete(this.openedGroups, index);
97
+ } else {
98
+ this.openedGroups.push(type);
99
+ }
102
100
  },
103
101
  toggleEntity({ _id }) {
104
102
  const index = this.openedEntities.indexOf(_id);
@@ -2,9 +2,9 @@
2
2
  <article
3
3
  class="NewsListItem__wrapper"
4
4
  :style="{ backgroundImage }">
5
- <div
5
+ <nuxt-link
6
6
  class="NewsListItem__overlay"
7
- @click="goToNews"></div>
7
+ :to="{ path: linkToNews }"></nuxt-link>
8
8
  <div class="NewsListItem__info">
9
9
  <template v-if="!item.isHiddenThumbLink">
10
10
  <h1>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.185",
3
+ "version": "0.0.187",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {