@policystudio/policy-studio-ui-vue 1.1.19 → 1.1.22

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.
@@ -18194,6 +18194,13 @@ video {
18194
18194
  left: auto;
18195
18195
  }
18196
18196
 
18197
+ .psui--inset-1{
18198
+ top: -1rem;
18199
+ right: -1rem;
18200
+ bottom: -1rem;
18201
+ left: -1rem;
18202
+ }
18203
+
18197
18204
  .psui-inset-y-0{
18198
18205
  top: 0;
18199
18206
  bottom: 0;
@@ -18214,6 +18221,16 @@ video {
18214
18221
  left: auto;
18215
18222
  }
18216
18223
 
18224
+ .psui--inset-y-1{
18225
+ top: -1rem;
18226
+ bottom: -1rem;
18227
+ }
18228
+
18229
+ .psui--inset-x-1{
18230
+ right: -1rem;
18231
+ left: -1rem;
18232
+ }
18233
+
18217
18234
  .psui-top-0{
18218
18235
  top: 0;
18219
18236
  }
@@ -18246,6 +18263,22 @@ video {
18246
18263
  left: auto;
18247
18264
  }
18248
18265
 
18266
+ .psui--top-1{
18267
+ top: -1rem;
18268
+ }
18269
+
18270
+ .psui--right-1{
18271
+ right: -1rem;
18272
+ }
18273
+
18274
+ .psui--bottom-1{
18275
+ bottom: -1rem;
18276
+ }
18277
+
18278
+ .psui--left-1{
18279
+ left: -1rem;
18280
+ }
18281
+
18249
18282
  .psui-resize-none{
18250
18283
  resize: none;
18251
18284
  }
@@ -35599,6 +35632,13 @@ html {
35599
35632
  left: auto;
35600
35633
  }
35601
35634
 
35635
+ .sm\:psui--inset-1{
35636
+ top: -1rem;
35637
+ right: -1rem;
35638
+ bottom: -1rem;
35639
+ left: -1rem;
35640
+ }
35641
+
35602
35642
  .sm\:psui-inset-y-0{
35603
35643
  top: 0;
35604
35644
  bottom: 0;
@@ -35619,6 +35659,16 @@ html {
35619
35659
  left: auto;
35620
35660
  }
35621
35661
 
35662
+ .sm\:psui--inset-y-1{
35663
+ top: -1rem;
35664
+ bottom: -1rem;
35665
+ }
35666
+
35667
+ .sm\:psui--inset-x-1{
35668
+ right: -1rem;
35669
+ left: -1rem;
35670
+ }
35671
+
35622
35672
  .sm\:psui-top-0{
35623
35673
  top: 0;
35624
35674
  }
@@ -35651,6 +35701,22 @@ html {
35651
35701
  left: auto;
35652
35702
  }
35653
35703
 
35704
+ .sm\:psui--top-1{
35705
+ top: -1rem;
35706
+ }
35707
+
35708
+ .sm\:psui--right-1{
35709
+ right: -1rem;
35710
+ }
35711
+
35712
+ .sm\:psui--bottom-1{
35713
+ bottom: -1rem;
35714
+ }
35715
+
35716
+ .sm\:psui--left-1{
35717
+ left: -1rem;
35718
+ }
35719
+
35654
35720
  .sm\:psui-resize-none{
35655
35721
  resize: none;
35656
35722
  }
@@ -52794,6 +52860,13 @@ html {
52794
52860
  left: auto;
52795
52861
  }
52796
52862
 
52863
+ .md\:psui--inset-1{
52864
+ top: -1rem;
52865
+ right: -1rem;
52866
+ bottom: -1rem;
52867
+ left: -1rem;
52868
+ }
52869
+
52797
52870
  .md\:psui-inset-y-0{
52798
52871
  top: 0;
52799
52872
  bottom: 0;
@@ -52814,6 +52887,16 @@ html {
52814
52887
  left: auto;
52815
52888
  }
52816
52889
 
52890
+ .md\:psui--inset-y-1{
52891
+ top: -1rem;
52892
+ bottom: -1rem;
52893
+ }
52894
+
52895
+ .md\:psui--inset-x-1{
52896
+ right: -1rem;
52897
+ left: -1rem;
52898
+ }
52899
+
52817
52900
  .md\:psui-top-0{
52818
52901
  top: 0;
52819
52902
  }
@@ -52846,6 +52929,22 @@ html {
52846
52929
  left: auto;
52847
52930
  }
52848
52931
 
52932
+ .md\:psui--top-1{
52933
+ top: -1rem;
52934
+ }
52935
+
52936
+ .md\:psui--right-1{
52937
+ right: -1rem;
52938
+ }
52939
+
52940
+ .md\:psui--bottom-1{
52941
+ bottom: -1rem;
52942
+ }
52943
+
52944
+ .md\:psui--left-1{
52945
+ left: -1rem;
52946
+ }
52947
+
52849
52948
  .md\:psui-resize-none{
52850
52949
  resize: none;
52851
52950
  }
@@ -69989,6 +70088,13 @@ html {
69989
70088
  left: auto;
69990
70089
  }
69991
70090
 
70091
+ .lg\:psui--inset-1{
70092
+ top: -1rem;
70093
+ right: -1rem;
70094
+ bottom: -1rem;
70095
+ left: -1rem;
70096
+ }
70097
+
69992
70098
  .lg\:psui-inset-y-0{
69993
70099
  top: 0;
69994
70100
  bottom: 0;
@@ -70009,6 +70115,16 @@ html {
70009
70115
  left: auto;
70010
70116
  }
70011
70117
 
70118
+ .lg\:psui--inset-y-1{
70119
+ top: -1rem;
70120
+ bottom: -1rem;
70121
+ }
70122
+
70123
+ .lg\:psui--inset-x-1{
70124
+ right: -1rem;
70125
+ left: -1rem;
70126
+ }
70127
+
70012
70128
  .lg\:psui-top-0{
70013
70129
  top: 0;
70014
70130
  }
@@ -70041,6 +70157,22 @@ html {
70041
70157
  left: auto;
70042
70158
  }
70043
70159
 
70160
+ .lg\:psui--top-1{
70161
+ top: -1rem;
70162
+ }
70163
+
70164
+ .lg\:psui--right-1{
70165
+ right: -1rem;
70166
+ }
70167
+
70168
+ .lg\:psui--bottom-1{
70169
+ bottom: -1rem;
70170
+ }
70171
+
70172
+ .lg\:psui--left-1{
70173
+ left: -1rem;
70174
+ }
70175
+
70044
70176
  .lg\:psui-resize-none{
70045
70177
  resize: none;
70046
70178
  }
@@ -87184,6 +87316,13 @@ html {
87184
87316
  left: auto;
87185
87317
  }
87186
87318
 
87319
+ .xl\:psui--inset-1{
87320
+ top: -1rem;
87321
+ right: -1rem;
87322
+ bottom: -1rem;
87323
+ left: -1rem;
87324
+ }
87325
+
87187
87326
  .xl\:psui-inset-y-0{
87188
87327
  top: 0;
87189
87328
  bottom: 0;
@@ -87204,6 +87343,16 @@ html {
87204
87343
  left: auto;
87205
87344
  }
87206
87345
 
87346
+ .xl\:psui--inset-y-1{
87347
+ top: -1rem;
87348
+ bottom: -1rem;
87349
+ }
87350
+
87351
+ .xl\:psui--inset-x-1{
87352
+ right: -1rem;
87353
+ left: -1rem;
87354
+ }
87355
+
87207
87356
  .xl\:psui-top-0{
87208
87357
  top: 0;
87209
87358
  }
@@ -87236,6 +87385,22 @@ html {
87236
87385
  left: auto;
87237
87386
  }
87238
87387
 
87388
+ .xl\:psui--top-1{
87389
+ top: -1rem;
87390
+ }
87391
+
87392
+ .xl\:psui--right-1{
87393
+ right: -1rem;
87394
+ }
87395
+
87396
+ .xl\:psui--bottom-1{
87397
+ bottom: -1rem;
87398
+ }
87399
+
87400
+ .xl\:psui--left-1{
87401
+ left: -1rem;
87402
+ }
87403
+
87239
87404
  .xl\:psui-resize-none{
87240
87405
  resize: none;
87241
87406
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@policystudio/policy-studio-ui-vue",
3
- "version": "1.1.19",
3
+ "version": "1.1.22",
4
4
  "description": "Policy Studio UI",
5
5
  "main": "src/index.js",
6
6
  "author": "Policy Studio Team",
@@ -31,11 +31,11 @@
31
31
  @mouseenter="onRowHover(index)"
32
32
  @mouseleave="onRowHover(false)"
33
33
  >
34
- <td>
35
- <div class="psui-flex psui-justify-between">
34
+ <td :style="`background-color:${getBackgroundColor(item.background_color)};`">
35
+ <div class="psui-flex psui-justify-between psui-relative">
36
36
  <div
37
37
  class="psui-flex psui-items-center actions psui-space-x-3"
38
- :style="{ paddingLeft: `${item.deep * 16}px` }"
38
+ :style="{paddingLeft: `${item.deep * 16}px`}"
39
39
  >
40
40
  <PsIcon
41
41
  v-if="!item.last_deep || item.type === 'total'"
@@ -47,16 +47,19 @@
47
47
  :class="[checkRowIsVisible(item) ? 'psui-rotate-0' : 'psui--rotate-90', { 'psui-pointer-events-none' : item.is_disabled }]"
48
48
  @click.native="onCollapse(item)"
49
49
  />
50
-
50
+
51
51
  <PsRichTooltip
52
- v-if="item.is_disabled"
52
+ v-if="item.is_disabled || item.tooltip_text"
53
53
  layout="gray"
54
54
  position="top"
55
55
  class="psui-inline-flex psui-cursor-default sticky"
56
56
  :class="{ 'is-last-deep' : item.last_deep }"
57
57
  >
58
58
  <template v-slot:trigger>
59
+ <div class="flex psui-items-center psui-relative ">
60
+ <PsIcon v-if="item.is_disabled" icon="do_disturb_alt" size="14" icon-classes="psui-absolute psui--left-1 psui-text-gray-50"/>
59
61
  <p class="title psui-text-gray-50 opacity-100-childrens-on-hover">
62
+
60
63
  {{ item.title }}
61
64
 
62
65
  <PsIcon
@@ -68,16 +71,17 @@
68
71
  @click.native="$eventBus.$emit('openDescriptionModal', { type: 'helper', slug: `table-results-${item.helper_slug}` })"
69
72
  />
70
73
  </p>
74
+ </div>
71
75
  </template>
72
76
  <template v-slot:content>
73
- <p
74
- v-if="item.disabled_text"
77
+ <p
78
+ v-if="item.tooltip_text || item.is_disabled"
75
79
  class="psui-font-bold psui-text-gray-80 psui-text-xsmall"
76
80
  >
77
- {{ item.disabled_text }}
81
+ {{ item.tooltip_text }}
78
82
  </p>
79
83
  <p
80
- v-else
84
+ v-else-if="item.is_disabled"
81
85
  class="psui-font-bold psui-text-gray-80 psui-text-xsmall"
82
86
  >
83
87
  {{ item.title }} buildings are <br>not allowed.
@@ -98,7 +102,8 @@
98
102
  v-if="item.has_helper"
99
103
  icon="info"
100
104
  size="14"
101
- class="psui-text-blue-60 psui-opacity-0 psui-transition psui-leading-none psui-cursor-pointer psui-ml-1"
105
+ :class="[{'psui-text-gray-50': item.tooltip_text}, {'psui-text-blue-60': !item.tooltip_text}]"
106
+ class="psui-opacity-0 psui-transition psui-leading-none psui-cursor-pointer psui-ml-1"
102
107
  display="flex"
103
108
  @click.native="$eventBus.$emit('openDescriptionModal', { type: 'helper', slug: `table-results-${item.helper_slug}` })"
104
109
  />
@@ -156,7 +161,7 @@
156
161
  />
157
162
  </template>
158
163
  <template v-slot:items>
159
- <ul class="psui-w-full psui-font-bold psui-my-3">
164
+ <ul class="psui-w-full psui-font-bold psui-my-3">
160
165
  <li
161
166
  v-for="(action, index) in item.actions"
162
167
  :key="index"
@@ -170,19 +175,21 @@
170
175
  </template>
171
176
  </PsDropdown>
172
177
  </div>
173
- </div>
178
+ </div>
174
179
  </td>
175
180
 
176
181
  <template v-for="(columnGroup, indexColumn) of columnGroups">
177
182
  <td
183
+ :style="`background-color:${getBackgroundColor(item.background_color)};`"
178
184
  v-for="column of columnGroup.columns"
179
185
  :key="indexColumn + '-' + columnGroup.key + '-' + column.key"
186
+
180
187
  >
181
188
  <div
182
189
  v-if="layout != 'comparison'"
183
190
  class="psui-space-x-2 psui-show-childrens-on-hover"
184
191
  >
185
- <PsTooltip v-if="column.hasProjections && !item.is_disabled && selectedRow == item.id && columnSelectedKey == column.key">
192
+ <PsTooltip v-if="isSelectedRow(column,item)">
186
193
  <template v-slot:trigger>
187
194
  <PsIcon
188
195
  icon="close"
@@ -198,7 +205,7 @@
198
205
  </template>
199
206
  </PsTooltip>
200
207
 
201
- <PsTooltip v-else>
208
+ <PsTooltip v-else-if="column.hasProjections">
202
209
  <template v-slot:trigger>
203
210
  <PsIcon
204
211
  icon="bar_chart"
@@ -276,6 +283,7 @@ import PsProgressBar from '../badges-and-tags/PsProgressBar.vue'
276
283
  import PsTagScope from '../badges-and-tags/PsTagScope.vue'
277
284
  import PsBarChart from '../data-graphics/PsBarChart.vue'
278
285
  import PsTooltip from '../tooltip/PsTooltip.vue'
286
+ import tailwindConfig from '../../../tailwind.config'
279
287
 
280
288
  export const tableLayout = ['results', 'comparison']
281
289
 
@@ -416,6 +424,7 @@ export default {
416
424
  const item = this.summaryData[index]
417
425
  this.addRow(item, 0, `${index}`, rows)
418
426
  }
427
+
419
428
  return rows
420
429
  },
421
430
  },
@@ -535,6 +544,18 @@ export default {
535
544
  },
536
545
  onCloseSelectRow(item) {
537
546
  this.$eventBus.$emit('resetPolicyImpactItemSelected', item)
547
+ },
548
+ isSelectedRow(column,item){
549
+ if(!item.id){
550
+ return this.selectedRow === item.id && this.columnSelectedKey == column.key
551
+ }
552
+ return column.hasProjections && !item.is_disabled && this.selectedRow == item.id && this.columnSelectedKey == column.key
553
+ },
554
+ getBackgroundColor(value){
555
+ if(value && value.includes('psui-bg-')) {
556
+ return tailwindConfig.theme.colors[value.replace('psui-bg-', '')]
557
+ }
558
+ return value || '#ffffff'
538
559
  }
539
560
  },
540
561
  }
@@ -114,6 +114,9 @@ module.exports = {
114
114
  },
115
115
  padding: {
116
116
  '0.5': '0.125rem',
117
+ },
118
+ inset:{
119
+ '-1': '-1rem',
117
120
  }
118
121
  },
119
122
  },