@policystudio/policy-studio-ui-vue 1.1.17 → 1.1.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@policystudio/policy-studio-ui-vue",
3
- "version": "1.1.17",
3
+ "version": "1.1.18",
4
4
  "description": "Policy Studio UI",
5
5
  "main": "src/index.js",
6
6
  "author": "Policy Studio Team",
@@ -171,38 +171,40 @@
171
171
  v-if="layout != 'comparison'"
172
172
  class="psui-space-x-2 psui-show-childrens-on-hover"
173
173
  >
174
- <PsTooltip v-if="column.hasProjections && !item.is_disabled && selectedRow != item.id">
174
+ <PsTooltip v-if="column.hasProjections && !item.is_disabled && selectedRow == item.id && columnSelectedKey == column.key">
175
175
  <template v-slot:trigger>
176
176
  <PsIcon
177
- icon="bar_chart"
177
+ icon="close"
178
178
  size="16"
179
179
  class="psui-cursor-pointer"
180
- icon-classes="psui-text-blue-60 psui-opacity-0 psui-leading-none psui-transition"
180
+ icon-classes="psui-text-blue-60 psui-leading-none psui-transition"
181
181
  :style="{ display: 'flex' }"
182
- @click.native="onSelectRow(item, column)"
182
+ @click.native="onCloseSelectRow(item)"
183
183
  />
184
184
  </template>
185
185
  <template v-slot:content>
186
- Show projections in the chart
186
+ Close projections
187
187
  </template>
188
188
  </PsTooltip>
189
189
 
190
- <PsTooltip v-if="column.hasProjections && !item.is_disabled && selectedRow == item.id && columnSelectedKey == column.key">
190
+ <PsTooltip v-else>
191
191
  <template v-slot:trigger>
192
192
  <PsIcon
193
- icon="close"
193
+ icon="bar_chart"
194
194
  size="16"
195
195
  class="psui-cursor-pointer"
196
- icon-classes="psui-text-blue-60 psui-leading-none psui-transition"
196
+ icon-classes="psui-text-blue-60 psui-opacity-0 psui-leading-none psui-transition"
197
197
  :style="{ display: 'flex' }"
198
- @click.native="onCloseSelectRow(item)"
198
+ @click.native="onSelectRow(item, column)"
199
199
  />
200
200
  </template>
201
201
  <template v-slot:content>
202
- Close projections
202
+ Show projections in the chart
203
203
  </template>
204
204
  </PsTooltip>
205
205
 
206
+
207
+
206
208
  <p v-if="formatFunction && !item.is_disabled">
207
209
  {{ formatFunction(column.key, item.data[column.key], item.data) }}
208
210
  </p>
@@ -425,6 +427,13 @@ export default {
425
427
  },
426
428
  mounted () {
427
429
  this.setCollapsedRows()
430
+ this.$eventBus.$on('resetPolicyImpactItemSelected', (item) => {
431
+ this.$eventBus.$emit('setPolicyItemSelected', { item, columnSelectedKey: 'forecast_emissions_savings' })
432
+ this.selectedRow = null
433
+ })
434
+ },
435
+ beforeDestroy() {
436
+ this.$eventBus.$off('resetPolicyImpactItemSelected')
428
437
  },
429
438
  methods: {
430
439
  setCollapsedRows() {
@@ -516,8 +525,7 @@ export default {
516
525
  this.$emit('policy-selected', { item: item, column: column })
517
526
  },
518
527
  onCloseSelectRow(item) {
519
- this.$eventBus.$emit('setPolicyItemSelected', { item, columnSelectedKey: 'forecast_emissions_savings' })
520
- this.selectedRow = null
528
+ this.$eventBus.$emit('resetPolicyImpactItemSelected', item)
521
529
  }
522
530
  },
523
531
  }